Skip to content

Improve JSDoc comments in @rtk-query/codegen-openapi #5032

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 15 additions & 16 deletions packages/rtk-query-codegen-openapi/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,77 +38,76 @@ export interface CommonOptions {
*/
schemaFile: string;
/**
* defaults to "api"
* @default "api"
*/
apiImport?: string;
/**
* defaults to "enhancedApi"
* @default "enhancedApi"
*/
exportName?: string;
/**
* defaults to "ApiArg"
* @default "ApiArg"
*/
argSuffix?: string;
/**
* defaults to "ApiResponse"
* @default "ApiResponse"
*/
responseSuffix?: string;
/**
* defaults to empty
* @default ""
*/
operationNameSuffix?: string;
/**
* defaults to `false`
* `true` will generate hooks for queries and mutations, but no lazyQueries
* @default false
*/
hooks?: boolean | { queries: boolean; lazyQueries: boolean; mutations: boolean };
/**
* defaults to false
* `true` will generate a union type for `undefined` properties like: `{ id?: string | undefined }` instead of `{ id?: string }`
* @default false
*/
unionUndefined?: boolean;
/**
* defaults to false
* `true` will result in all generated endpoints having `providesTags`/`invalidatesTags` declarations for the `tags` of their respective operation definition
* @default false
* @see https://redux-toolkit.js.org/rtk-query/usage/code-generation for more information
*/
tag?: boolean;
/**
* defaults to false
* `true` will add `encodeURIComponent` to the generated path parameters
* @default false
*/
encodePathParams?: boolean;
/**
* defaults to false
* `true` will add `encodeURIComponent` to the generated query parameters
* @default false
*/
encodeQueryParams?: boolean;
/**
* defaults to false
* `true` will "flatten" the arg so that you can do things like `useGetEntityById(1)` instead of `useGetEntityById({ entityId: 1 })`
* @default false
*/
flattenArg?: boolean;
/**
* default to false
* If set to `true`, the default response type will be included in the generated code for all endpoints.
* @default false
* @see https://swagger.io/docs/specification/describing-responses/#default
*/
includeDefault?: boolean;
/**
* default to false
* `true` will not generate separate types for read-only and write-only properties.
* @default false
*/
mergeReadWriteOnly?: boolean;
/**
*
* HTTPResolverOptions object that is passed to the SwaggerParser bundle function.
*/
httpResolverOptions?: SwaggerParser.HTTPResolverOptions;

/**
* defaults to undefined
* If present the given file will be used as prettier config when formatting the generated code. If undefined the default prettier config
* resolution mechanism will be used.
* @default undefined
*/
prettierConfigFile?: string;
}
Expand All @@ -128,8 +127,8 @@ export interface OutputFileOptions extends Partial<CommonOptions> {
filterEndpoints?: EndpointMatcher;
endpointOverrides?: EndpointOverrides[];
/**
* defaults to false
* If passed as true it will generate TS enums instead of union of strings
* @default false
*/
useEnumType?: boolean;
}
Expand Down