From 225b640b5ac628cb7ba3b7afb39ff271a0608055 Mon Sep 17 00:00:00 2001 From: Lubos Date: Mon, 12 Aug 2024 03:27:22 +0100 Subject: [PATCH] fix: do not generate types tree by default if services are enabled as it is unused --- .changeset/short-suits-hunt.md | 5 + packages/openapi-ts/src/index.ts | 9 +- .../test/generated/v2/types.gen.ts.snap | 271 +------------ .../types.gen.ts.snap | 369 ------------------ .../types.gen.ts.snap | 69 ---- .../types.gen.ts.snap | 369 ------------------ .../types.gen.ts.snap | 69 ---- .../types.gen.ts.snap | 369 ------------------ .../types.gen.ts.snap | 69 ---- .../v3-hey-api-client-axios/types.gen.ts.snap | 369 ------------------ .../types.gen.ts.snap | 69 ---- .../types.gen.ts.snap | 369 ------------------ .../types.gen.ts.snap | 69 ---- .../types.gen.ts.snap | 369 ------------------ .../types.gen.ts.snap | 69 ---- .../types.gen.ts.snap | 369 ------------------ .../types.gen.ts.snap | 69 ---- .../v3-hey-api-client-fetch/types.gen.ts.snap | 369 ------------------ .../types.gen.ts.snap | 69 ---- .../test/generated/v3/types.gen.ts.snap | 369 ------------------ .../generated/v3_angular/types.gen.ts.snap | 369 ------------------ .../v3_angular_transform/types.gen.ts.snap | 69 ---- .../test/generated/v3_axios/types.gen.ts.snap | 369 ------------------ .../v3_axios_transform/types.gen.ts.snap | 69 ---- .../generated/v3_client/types.gen.ts.snap | 369 ------------------ .../v3_client_transform/types.gen.ts.snap | 69 ---- .../v3_enums_typescript/types.gen.ts.snap | 369 ------------------ .../types.gen.ts.snap | 369 ------------------ .../types.gen.ts.snap | 14 - .../test/generated/v3_node/types.gen.ts.snap | 369 ------------------ .../v3_node_transform/types.gen.ts.snap | 69 ---- .../generated/v3_options/types.gen.ts.snap | 14 - .../v3_services_name/types.gen.ts.snap | 48 +-- .../generated/v3_transform/types.gen.ts.snap | 69 ---- .../v3_tree_shakeable/types.gen.ts.snap | 369 ------------------ .../test/generated/v3_xhr/types.gen.ts.snap | 369 ------------------ .../v3_xhr_transform/types.gen.ts.snap | 69 ---- packages/openapi-ts/test/sample.cjs | 5 +- 38 files changed, 16 insertions(+), 7589 deletions(-) create mode 100644 .changeset/short-suits-hunt.md diff --git a/.changeset/short-suits-hunt.md b/.changeset/short-suits-hunt.md new file mode 100644 index 000000000..f85e3ebd3 --- /dev/null +++ b/.changeset/short-suits-hunt.md @@ -0,0 +1,5 @@ +--- +'@hey-api/openapi-ts': patch +--- + +fix: do not generate types tree by default if services are enabled as it is unused diff --git a/packages/openapi-ts/src/index.ts b/packages/openapi-ts/src/index.ts index bd7344dd4..0e0c46fd6 100644 --- a/packages/openapi-ts/src/index.ts +++ b/packages/openapi-ts/src/index.ts @@ -180,13 +180,16 @@ const getServices = (userConfig: ClientConfig): Config['services'] => { return services; }; -const getTypes = (userConfig: ClientConfig): Config['types'] => { +const getTypes = ( + userConfig: ClientConfig, + services: Config['services'], +): Config['types'] => { let types: Config['types'] = { dates: false, enums: false, export: true, name: 'preserve', - tree: true, + tree: !services.export, }; if (typeof userConfig.types === 'boolean') { types.export = userConfig.types; @@ -273,7 +276,7 @@ const initConfigs = async (userConfig: UserConfig): Promise => { const plugins = getPlugins(userConfig); const schemas = getSchemas(userConfig); const services = getServices(userConfig); - const types = getTypes(userConfig); + const types = getTypes(userConfig, services); output.path = path.resolve(process.cwd(), output.path); diff --git a/packages/openapi-ts/test/__snapshots__/test/generated/v2/types.gen.ts.snap b/packages/openapi-ts/test/__snapshots__/test/generated/v2/types.gen.ts.snap index 469cdf35e..94a37d354 100644 --- a/packages/openapi-ts/test/__snapshots__/test/generated/v2/types.gen.ts.snap +++ b/packages/openapi-ts/test/__snapshots__/test/generated/v2/types.gen.ts.snap @@ -755,273 +755,4 @@ export type NonAsciiæøåÆøÅöôêÊ字符串Data = { nonAsciiParamæøåÆøÅöôêÊ: number; }; -export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiStringæøåÆØÅöôêÊ字符串; - -export type $OpenApiTs = { - '/api/v{api-version}/body': { - post: { - req: PostApiBodyData; - res: { - /** - * OK - */ - 200: response_PostActivityResponse; - /** - * Bad Request - */ - 400: failure_Failure; - /** - * Internal Server Error - */ - 500: failure_Failure; - }; - }; - }; - '/api/v{api-version}/descriptions/': { - post: { - req: CallWithDescriptionsData; - }; - }; - '/api/v{api-version}/parameters/{parameterPath}': { - post: { - req: CallWithParametersData; - }; - }; - '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}': { - post: { - req: CallWithWeirdParameterNamesData; - }; - }; - '/api/v{api-version}/defaults': { - get: { - req: CallWithDefaultParametersData; - }; - post: { - req: CallWithDefaultOptionalParametersData; - }; - put: { - req: CallToTestOrderOfParamsData; - }; - }; - '/api/v{api-version}/no-content': { - get: { - res: { - /** - * Success - */ - 204: void; - }; - }; - }; - '/api/v{api-version}/multiple-tags/response-and-no-content': { - get: { - res: { - /** - * Response is a simple number - */ - 200: unknown; - /** - * Success - */ - 204: void; - }; - }; - }; - '/api/v{api-version}/response': { - get: { - res: { - /** - * Message for default response - */ - default: ModelWithString; - }; - }; - post: { - res: { - /** - * Message for 201 response - */ - 201: ModelWithString; - /** - * Message for 202 response - */ - 202: ModelWithString; - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithString; - }; - }; - put: { - res: { - /** - * Message for 200 response - */ - 200: { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithString; - }; - }; - }; - '/api/v{api-version}/multiple-tags/a': { - get: { - res: { - /** - * Success - */ - 204: void; - }; - }; - }; - '/api/v{api-version}/multiple-tags/b': { - get: { - res: { - /** - * Success - */ - 204: void; - }; - }; - }; - '/api/v{api-version}/collectionFormat': { - get: { - req: CollectionFormatData; - }; - }; - '/api/v{api-version}/types': { - get: { - req: TypesData; - res: { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: unknown; - }; - }; - }; - '/api/v{api-version}/complex': { - get: { - req: ComplexTypesData; - res: { - /** - * Successful response - */ - 200: Array; - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; - }; - }; - }; - '/api/v{api-version}/header': { - post: { - res: { - /** - * Successful response - */ - 200: string; - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; - }; - }; - }; - '/api/v{api-version}/error': { - post: { - req: TestErrorCodeData; - res: { - /** - * Custom message: Successful response - */ - 200: unknown; - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; - }; - }; - }; - '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串': { - post: { - req: NonAsciiæøåÆøÅöôêÊ字符串Data; - res: { - /** - * Successful response - */ - 200: NonAsciiStringæøåÆØÅöôêÊ字符串; - }; - }; - }; -}; \ No newline at end of file +export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiStringæøåÆØÅöôêÊ字符串; \ No newline at end of file diff --git a/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-bundle/types.gen.ts.snap b/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-bundle/types.gen.ts.snap index aec28c987..817014a4d 100644 --- a/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-bundle/types.gen.ts.snap +++ b/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-bundle/types.gen.ts.snap @@ -1578,373 +1578,4 @@ export type NonAsciiæøåÆøÅöôêÊ字符串Error = unknown; export type PutWithFormUrlEncodedData = { body: ArrayWithStrings; -}; - -export type $OpenApiTs = { - '/api/v{api-version}/no-tag': { - post: { - req: ImportData; - res: { - /** - * Success - */ - '200': Model_From_Zendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnly; - }; - }; - }; - '/api/v{api-version}/simple/$count': { - get: { - res: { - /** - * Success - */ - '200': Model_From_Zendesk; - }; - }; - }; - '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}': { - delete: { - req: DeleteFooData3; - }; - }; - '/api/v{api-version}/descriptions/': { - post: { - req: CallWithDescriptionsData; - }; - }; - '/api/v{api-version}/parameters/deprecated': { - post: { - req: DeprecatedCallData; - }; - }; - '/api/v{api-version}/parameters/{parameterPath}': { - post: { - req: CallWithParametersData; - }; - }; - '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}': { - post: { - req: CallWithWeirdParameterNamesData; - }; - }; - '/api/v{api-version}/parameters/': { - get: { - req: GetCallWithOptionalParamData; - }; - post: { - req: PostCallWithOptionalParamData; - res: { - /** - * Response is a simple number - */ - '200': number; - /** - * Success - */ - '204': void; - }; - }; - }; - '/api/v{api-version}/requestBody/': { - post: { - req: PostApiVbyApiVersionRequestBodyData; - }; - }; - '/api/v{api-version}/formData/': { - post: { - req: PostApiVbyApiVersionFormDataData; - }; - }; - '/api/v{api-version}/defaults': { - get: { - req: CallWithDefaultParametersData; - }; - post: { - req: CallWithDefaultOptionalParametersData; - }; - put: { - req: CallToTestOrderOfParamsData; - }; - }; - '/api/v{api-version}/no-content': { - get: { - res: { - /** - * Success - */ - '204': void; - }; - }; - }; - '/api/v{api-version}/multiple-tags/response-and-no-content': { - get: { - res: { - /** - * Response is a simple number - */ - '200': number; - /** - * Success - */ - '204': void; - }; - }; - }; - '/api/v{api-version}/multiple-tags/a': { - get: { - res: { - '200': _400; - }; - }; - }; - '/api/v{api-version}/multiple-tags/b': { - get: { - res: { - /** - * Success - */ - '204': void; - }; - }; - }; - '/api/v{api-version}/response': { - get: { - res: { - default: _import; - }; - }; - post: { - res: { - /** - * Message for 200 response - */ - '200': ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - '201': ModelWithString; - /** - * Message for 202 response - */ - '202': ModelWithString; - /** - * Message for 500 error - */ - '500': ModelWithStringError; - /** - * Message for 501 error - */ - '501': ModelWithStringError; - /** - * Message for 502 error - */ - '502': ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; - }; - }; - put: { - res: { - /** - * Message for 200 response - */ - '200': { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - '201': ModelThatExtends; - /** - * Message for 202 response - */ - '202': ModelThatExtendsExtends; - /** - * Message for 500 error - */ - '500': ModelWithStringError; - /** - * Message for 501 error - */ - '501': ModelWithStringError; - /** - * Message for 502 error - */ - '502': ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; - }; - }; - }; - '/api/v{api-version}/collectionFormat': { - get: { - req: CollectionFormatData; - }; - }; - '/api/v{api-version}/types': { - get: { - req: TypesData; - res: { - /** - * Response is a simple number - */ - '200': number; - /** - * Response is a simple string - */ - '201': string; - /** - * Response is a simple boolean - */ - '202': boolean; - /** - * Response is a simple object - */ - '203': { - [key: string]: unknown; - }; - }; - }; - }; - '/api/v{api-version}/upload': { - post: { - req: UploadFileData; - res: { - '200': boolean; - }; - }; - }; - '/api/v{api-version}/file/{id}': { - get: { - req: FileResponseData; - res: { - /** - * Success - */ - '200': (Blob | File); - }; - }; - }; - '/api/v{api-version}/complex': { - get: { - req: ComplexTypesData; - res: { - /** - * Successful response - */ - '200': Array; - /** - * 400 `server` error - */ - '400': unknown; - /** - * 500 server error - */ - '500': unknown; - }; - }; - }; - '/api/v{api-version}/multipart': { - post: { - req: MultipartRequestData; - }; - get: { - res: { - /** - * OK - */ - '200': { - file?: (Blob | File); - metadata?: { - foo?: string; - bar?: string; - }; - }; - }; - }; - }; - '/api/v{api-version}/complex/{id}': { - put: { - req: ComplexParamsData; - res: { - /** - * Success - */ - '200': ModelWithString; - }; - }; - }; - '/api/v{api-version}/header': { - post: { - res: { - /** - * Successful response - */ - '200': string; - /** - * 400 server error - */ - '400': unknown; - /** - * 500 server error - */ - '500': unknown; - }; - }; - }; - '/api/v{api-version}/error': { - post: { - req: TestErrorCodeData; - res: { - /** - * Custom message: Successful response - */ - '200': unknown; - /** - * Custom message: Internal Server Error - */ - '500': unknown; - /** - * Custom message: Not Implemented - */ - '501': unknown; - /** - * Custom message: Bad Gateway - */ - '502': unknown; - /** - * Custom message: Service Unavailable - */ - '503': unknown; - }; - }; - }; - '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串': { - post: { - req: NonAsciiæøåÆøÅöôêÊ字符串Data; - res: { - /** - * Successful response - */ - '200': Array; - }; - }; - put: { - req: PutWithFormUrlEncodedData; - }; - }; }; \ No newline at end of file diff --git a/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-bundle_transform/types.gen.ts.snap b/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-bundle_transform/types.gen.ts.snap index 95bd3b551..da954d95f 100644 --- a/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-bundle_transform/types.gen.ts.snap +++ b/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-bundle_transform/types.gen.ts.snap @@ -58,75 +58,6 @@ export type MultipleResponsesResponse = Array | Array; - }; - }; - }; - '/api/array-of-dates': { - put: { - res: { - /** - * Success - */ - '200': Array<(Date)>; - }; - }; - }; - '/api/date': { - put: { - res: { - /** - * Success - */ - '200': Date; - }; - }; - }; - '/api/multiple-responses': { - put: { - res: { - /** - * Updated - */ - '200': Array; - /** - * Created - */ - '201': Array; - }; - }; - }; -}; - export type ParentModelWithDatesResponseTransformer = (data: any) => Promise; export type ParentModelWithDatesModelResponseTransformer = (data: any) => ParentModelWithDates; diff --git a/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-class/types.gen.ts.snap b/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-class/types.gen.ts.snap index 11ae84da1..524b2061c 100644 --- a/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-class/types.gen.ts.snap +++ b/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-class/types.gen.ts.snap @@ -1578,373 +1578,4 @@ export type NonAsciiæøåÆøÅöôêÊ字符串Error = unknown; export type PutWithFormUrlEncodedData = { body: ArrayWithStrings; -}; - -export type $OpenApiTs = { - '/api/v{api-version}/no-tag': { - post: { - req: ImportData; - res: { - /** - * Success - */ - '200': Model_From_Zendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnly; - }; - }; - }; - '/api/v{api-version}/simple/$count': { - get: { - res: { - /** - * Success - */ - '200': Model_From_Zendesk; - }; - }; - }; - '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}': { - delete: { - req: DeleteFooData3; - }; - }; - '/api/v{api-version}/parameters/{parameterPath}': { - post: { - req: CallWithParametersData; - }; - }; - '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}': { - post: { - req: CallWithWeirdParameterNamesData; - }; - }; - '/api/v{api-version}/parameters/': { - get: { - req: GetCallWithOptionalParamData; - }; - post: { - req: PostCallWithOptionalParamData; - res: { - /** - * Response is a simple number - */ - '200': number; - /** - * Success - */ - '204': void; - }; - }; - }; - '/api/v{api-version}/descriptions/': { - post: { - req: CallWithDescriptionsData; - }; - }; - '/api/v{api-version}/parameters/deprecated': { - post: { - req: DeprecatedCallData; - }; - }; - '/api/v{api-version}/requestBody/': { - post: { - req: PostApiVbyApiVersionRequestBodyData; - }; - }; - '/api/v{api-version}/formData/': { - post: { - req: PostApiVbyApiVersionFormDataData; - }; - }; - '/api/v{api-version}/defaults': { - get: { - req: CallWithDefaultParametersData; - }; - post: { - req: CallWithDefaultOptionalParametersData; - }; - put: { - req: CallToTestOrderOfParamsData; - }; - }; - '/api/v{api-version}/no-content': { - get: { - res: { - /** - * Success - */ - '204': void; - }; - }; - }; - '/api/v{api-version}/multiple-tags/response-and-no-content': { - get: { - res: { - /** - * Response is a simple number - */ - '200': number; - /** - * Success - */ - '204': void; - }; - }; - }; - '/api/v{api-version}/response': { - get: { - res: { - default: _import; - }; - }; - post: { - res: { - /** - * Message for 200 response - */ - '200': ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - '201': ModelWithString; - /** - * Message for 202 response - */ - '202': ModelWithString; - /** - * Message for 500 error - */ - '500': ModelWithStringError; - /** - * Message for 501 error - */ - '501': ModelWithStringError; - /** - * Message for 502 error - */ - '502': ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; - }; - }; - put: { - res: { - /** - * Message for 200 response - */ - '200': { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - '201': ModelThatExtends; - /** - * Message for 202 response - */ - '202': ModelThatExtendsExtends; - /** - * Message for 500 error - */ - '500': ModelWithStringError; - /** - * Message for 501 error - */ - '501': ModelWithStringError; - /** - * Message for 502 error - */ - '502': ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; - }; - }; - }; - '/api/v{api-version}/multiple-tags/a': { - get: { - res: { - '200': _400; - }; - }; - }; - '/api/v{api-version}/multiple-tags/b': { - get: { - res: { - /** - * Success - */ - '204': void; - }; - }; - }; - '/api/v{api-version}/collectionFormat': { - get: { - req: CollectionFormatData; - }; - }; - '/api/v{api-version}/types': { - get: { - req: TypesData; - res: { - /** - * Response is a simple number - */ - '200': number; - /** - * Response is a simple string - */ - '201': string; - /** - * Response is a simple boolean - */ - '202': boolean; - /** - * Response is a simple object - */ - '203': { - [key: string]: unknown; - }; - }; - }; - }; - '/api/v{api-version}/upload': { - post: { - req: UploadFileData; - res: { - '200': boolean; - }; - }; - }; - '/api/v{api-version}/file/{id}': { - get: { - req: FileResponseData; - res: { - /** - * Success - */ - '200': (Blob | File); - }; - }; - }; - '/api/v{api-version}/complex': { - get: { - req: ComplexTypesData; - res: { - /** - * Successful response - */ - '200': Array; - /** - * 400 `server` error - */ - '400': unknown; - /** - * 500 server error - */ - '500': unknown; - }; - }; - }; - '/api/v{api-version}/complex/{id}': { - put: { - req: ComplexParamsData; - res: { - /** - * Success - */ - '200': ModelWithString; - }; - }; - }; - '/api/v{api-version}/multipart': { - post: { - req: MultipartRequestData; - }; - get: { - res: { - /** - * OK - */ - '200': { - file?: (Blob | File); - metadata?: { - foo?: string; - bar?: string; - }; - }; - }; - }; - }; - '/api/v{api-version}/header': { - post: { - res: { - /** - * Successful response - */ - '200': string; - /** - * 400 server error - */ - '400': unknown; - /** - * 500 server error - */ - '500': unknown; - }; - }; - }; - '/api/v{api-version}/error': { - post: { - req: TestErrorCodeData; - res: { - /** - * Custom message: Successful response - */ - '200': unknown; - /** - * Custom message: Internal Server Error - */ - '500': unknown; - /** - * Custom message: Not Implemented - */ - '501': unknown; - /** - * Custom message: Bad Gateway - */ - '502': unknown; - /** - * Custom message: Service Unavailable - */ - '503': unknown; - }; - }; - }; - '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串': { - post: { - req: NonAsciiæøåÆøÅöôêÊ字符串Data; - res: { - /** - * Successful response - */ - '200': Array; - }; - }; - put: { - req: PutWithFormUrlEncodedData; - }; - }; }; \ No newline at end of file diff --git a/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-class_transform/types.gen.ts.snap b/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-class_transform/types.gen.ts.snap index 95bd3b551..da954d95f 100644 --- a/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-class_transform/types.gen.ts.snap +++ b/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-class_transform/types.gen.ts.snap @@ -58,75 +58,6 @@ export type MultipleResponsesResponse = Array | Array; - }; - }; - }; - '/api/array-of-dates': { - put: { - res: { - /** - * Success - */ - '200': Array<(Date)>; - }; - }; - }; - '/api/date': { - put: { - res: { - /** - * Success - */ - '200': Date; - }; - }; - }; - '/api/multiple-responses': { - put: { - res: { - /** - * Updated - */ - '200': Array; - /** - * Created - */ - '201': Array; - }; - }; - }; -}; - export type ParentModelWithDatesResponseTransformer = (data: any) => Promise; export type ParentModelWithDatesModelResponseTransformer = (data: any) => ParentModelWithDates; diff --git a/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-plugin-tanstack-react-query/types.gen.ts.snap b/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-plugin-tanstack-react-query/types.gen.ts.snap index aec28c987..817014a4d 100644 --- a/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-plugin-tanstack-react-query/types.gen.ts.snap +++ b/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-plugin-tanstack-react-query/types.gen.ts.snap @@ -1578,373 +1578,4 @@ export type NonAsciiæøåÆøÅöôêÊ字符串Error = unknown; export type PutWithFormUrlEncodedData = { body: ArrayWithStrings; -}; - -export type $OpenApiTs = { - '/api/v{api-version}/no-tag': { - post: { - req: ImportData; - res: { - /** - * Success - */ - '200': Model_From_Zendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnly; - }; - }; - }; - '/api/v{api-version}/simple/$count': { - get: { - res: { - /** - * Success - */ - '200': Model_From_Zendesk; - }; - }; - }; - '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}': { - delete: { - req: DeleteFooData3; - }; - }; - '/api/v{api-version}/descriptions/': { - post: { - req: CallWithDescriptionsData; - }; - }; - '/api/v{api-version}/parameters/deprecated': { - post: { - req: DeprecatedCallData; - }; - }; - '/api/v{api-version}/parameters/{parameterPath}': { - post: { - req: CallWithParametersData; - }; - }; - '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}': { - post: { - req: CallWithWeirdParameterNamesData; - }; - }; - '/api/v{api-version}/parameters/': { - get: { - req: GetCallWithOptionalParamData; - }; - post: { - req: PostCallWithOptionalParamData; - res: { - /** - * Response is a simple number - */ - '200': number; - /** - * Success - */ - '204': void; - }; - }; - }; - '/api/v{api-version}/requestBody/': { - post: { - req: PostApiVbyApiVersionRequestBodyData; - }; - }; - '/api/v{api-version}/formData/': { - post: { - req: PostApiVbyApiVersionFormDataData; - }; - }; - '/api/v{api-version}/defaults': { - get: { - req: CallWithDefaultParametersData; - }; - post: { - req: CallWithDefaultOptionalParametersData; - }; - put: { - req: CallToTestOrderOfParamsData; - }; - }; - '/api/v{api-version}/no-content': { - get: { - res: { - /** - * Success - */ - '204': void; - }; - }; - }; - '/api/v{api-version}/multiple-tags/response-and-no-content': { - get: { - res: { - /** - * Response is a simple number - */ - '200': number; - /** - * Success - */ - '204': void; - }; - }; - }; - '/api/v{api-version}/multiple-tags/a': { - get: { - res: { - '200': _400; - }; - }; - }; - '/api/v{api-version}/multiple-tags/b': { - get: { - res: { - /** - * Success - */ - '204': void; - }; - }; - }; - '/api/v{api-version}/response': { - get: { - res: { - default: _import; - }; - }; - post: { - res: { - /** - * Message for 200 response - */ - '200': ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - '201': ModelWithString; - /** - * Message for 202 response - */ - '202': ModelWithString; - /** - * Message for 500 error - */ - '500': ModelWithStringError; - /** - * Message for 501 error - */ - '501': ModelWithStringError; - /** - * Message for 502 error - */ - '502': ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; - }; - }; - put: { - res: { - /** - * Message for 200 response - */ - '200': { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - '201': ModelThatExtends; - /** - * Message for 202 response - */ - '202': ModelThatExtendsExtends; - /** - * Message for 500 error - */ - '500': ModelWithStringError; - /** - * Message for 501 error - */ - '501': ModelWithStringError; - /** - * Message for 502 error - */ - '502': ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; - }; - }; - }; - '/api/v{api-version}/collectionFormat': { - get: { - req: CollectionFormatData; - }; - }; - '/api/v{api-version}/types': { - get: { - req: TypesData; - res: { - /** - * Response is a simple number - */ - '200': number; - /** - * Response is a simple string - */ - '201': string; - /** - * Response is a simple boolean - */ - '202': boolean; - /** - * Response is a simple object - */ - '203': { - [key: string]: unknown; - }; - }; - }; - }; - '/api/v{api-version}/upload': { - post: { - req: UploadFileData; - res: { - '200': boolean; - }; - }; - }; - '/api/v{api-version}/file/{id}': { - get: { - req: FileResponseData; - res: { - /** - * Success - */ - '200': (Blob | File); - }; - }; - }; - '/api/v{api-version}/complex': { - get: { - req: ComplexTypesData; - res: { - /** - * Successful response - */ - '200': Array; - /** - * 400 `server` error - */ - '400': unknown; - /** - * 500 server error - */ - '500': unknown; - }; - }; - }; - '/api/v{api-version}/multipart': { - post: { - req: MultipartRequestData; - }; - get: { - res: { - /** - * OK - */ - '200': { - file?: (Blob | File); - metadata?: { - foo?: string; - bar?: string; - }; - }; - }; - }; - }; - '/api/v{api-version}/complex/{id}': { - put: { - req: ComplexParamsData; - res: { - /** - * Success - */ - '200': ModelWithString; - }; - }; - }; - '/api/v{api-version}/header': { - post: { - res: { - /** - * Successful response - */ - '200': string; - /** - * 400 server error - */ - '400': unknown; - /** - * 500 server error - */ - '500': unknown; - }; - }; - }; - '/api/v{api-version}/error': { - post: { - req: TestErrorCodeData; - res: { - /** - * Custom message: Successful response - */ - '200': unknown; - /** - * Custom message: Internal Server Error - */ - '500': unknown; - /** - * Custom message: Not Implemented - */ - '501': unknown; - /** - * Custom message: Bad Gateway - */ - '502': unknown; - /** - * Custom message: Service Unavailable - */ - '503': unknown; - }; - }; - }; - '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串': { - post: { - req: NonAsciiæøåÆøÅöôêÊ字符串Data; - res: { - /** - * Successful response - */ - '200': Array; - }; - }; - put: { - req: PutWithFormUrlEncodedData; - }; - }; }; \ No newline at end of file diff --git a/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-plugin-tanstack-react-query_transform/types.gen.ts.snap b/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-plugin-tanstack-react-query_transform/types.gen.ts.snap index 95bd3b551..da954d95f 100644 --- a/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-plugin-tanstack-react-query_transform/types.gen.ts.snap +++ b/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-plugin-tanstack-react-query_transform/types.gen.ts.snap @@ -58,75 +58,6 @@ export type MultipleResponsesResponse = Array | Array; - }; - }; - }; - '/api/array-of-dates': { - put: { - res: { - /** - * Success - */ - '200': Array<(Date)>; - }; - }; - }; - '/api/date': { - put: { - res: { - /** - * Success - */ - '200': Date; - }; - }; - }; - '/api/multiple-responses': { - put: { - res: { - /** - * Updated - */ - '200': Array; - /** - * Created - */ - '201': Array; - }; - }; - }; -}; - export type ParentModelWithDatesResponseTransformer = (data: any) => Promise; export type ParentModelWithDatesModelResponseTransformer = (data: any) => ParentModelWithDates; diff --git a/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios/types.gen.ts.snap b/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios/types.gen.ts.snap index aec28c987..817014a4d 100644 --- a/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios/types.gen.ts.snap +++ b/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios/types.gen.ts.snap @@ -1578,373 +1578,4 @@ export type NonAsciiæøåÆøÅöôêÊ字符串Error = unknown; export type PutWithFormUrlEncodedData = { body: ArrayWithStrings; -}; - -export type $OpenApiTs = { - '/api/v{api-version}/no-tag': { - post: { - req: ImportData; - res: { - /** - * Success - */ - '200': Model_From_Zendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnly; - }; - }; - }; - '/api/v{api-version}/simple/$count': { - get: { - res: { - /** - * Success - */ - '200': Model_From_Zendesk; - }; - }; - }; - '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}': { - delete: { - req: DeleteFooData3; - }; - }; - '/api/v{api-version}/descriptions/': { - post: { - req: CallWithDescriptionsData; - }; - }; - '/api/v{api-version}/parameters/deprecated': { - post: { - req: DeprecatedCallData; - }; - }; - '/api/v{api-version}/parameters/{parameterPath}': { - post: { - req: CallWithParametersData; - }; - }; - '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}': { - post: { - req: CallWithWeirdParameterNamesData; - }; - }; - '/api/v{api-version}/parameters/': { - get: { - req: GetCallWithOptionalParamData; - }; - post: { - req: PostCallWithOptionalParamData; - res: { - /** - * Response is a simple number - */ - '200': number; - /** - * Success - */ - '204': void; - }; - }; - }; - '/api/v{api-version}/requestBody/': { - post: { - req: PostApiVbyApiVersionRequestBodyData; - }; - }; - '/api/v{api-version}/formData/': { - post: { - req: PostApiVbyApiVersionFormDataData; - }; - }; - '/api/v{api-version}/defaults': { - get: { - req: CallWithDefaultParametersData; - }; - post: { - req: CallWithDefaultOptionalParametersData; - }; - put: { - req: CallToTestOrderOfParamsData; - }; - }; - '/api/v{api-version}/no-content': { - get: { - res: { - /** - * Success - */ - '204': void; - }; - }; - }; - '/api/v{api-version}/multiple-tags/response-and-no-content': { - get: { - res: { - /** - * Response is a simple number - */ - '200': number; - /** - * Success - */ - '204': void; - }; - }; - }; - '/api/v{api-version}/multiple-tags/a': { - get: { - res: { - '200': _400; - }; - }; - }; - '/api/v{api-version}/multiple-tags/b': { - get: { - res: { - /** - * Success - */ - '204': void; - }; - }; - }; - '/api/v{api-version}/response': { - get: { - res: { - default: _import; - }; - }; - post: { - res: { - /** - * Message for 200 response - */ - '200': ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - '201': ModelWithString; - /** - * Message for 202 response - */ - '202': ModelWithString; - /** - * Message for 500 error - */ - '500': ModelWithStringError; - /** - * Message for 501 error - */ - '501': ModelWithStringError; - /** - * Message for 502 error - */ - '502': ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; - }; - }; - put: { - res: { - /** - * Message for 200 response - */ - '200': { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - '201': ModelThatExtends; - /** - * Message for 202 response - */ - '202': ModelThatExtendsExtends; - /** - * Message for 500 error - */ - '500': ModelWithStringError; - /** - * Message for 501 error - */ - '501': ModelWithStringError; - /** - * Message for 502 error - */ - '502': ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; - }; - }; - }; - '/api/v{api-version}/collectionFormat': { - get: { - req: CollectionFormatData; - }; - }; - '/api/v{api-version}/types': { - get: { - req: TypesData; - res: { - /** - * Response is a simple number - */ - '200': number; - /** - * Response is a simple string - */ - '201': string; - /** - * Response is a simple boolean - */ - '202': boolean; - /** - * Response is a simple object - */ - '203': { - [key: string]: unknown; - }; - }; - }; - }; - '/api/v{api-version}/upload': { - post: { - req: UploadFileData; - res: { - '200': boolean; - }; - }; - }; - '/api/v{api-version}/file/{id}': { - get: { - req: FileResponseData; - res: { - /** - * Success - */ - '200': (Blob | File); - }; - }; - }; - '/api/v{api-version}/complex': { - get: { - req: ComplexTypesData; - res: { - /** - * Successful response - */ - '200': Array; - /** - * 400 `server` error - */ - '400': unknown; - /** - * 500 server error - */ - '500': unknown; - }; - }; - }; - '/api/v{api-version}/multipart': { - post: { - req: MultipartRequestData; - }; - get: { - res: { - /** - * OK - */ - '200': { - file?: (Blob | File); - metadata?: { - foo?: string; - bar?: string; - }; - }; - }; - }; - }; - '/api/v{api-version}/complex/{id}': { - put: { - req: ComplexParamsData; - res: { - /** - * Success - */ - '200': ModelWithString; - }; - }; - }; - '/api/v{api-version}/header': { - post: { - res: { - /** - * Successful response - */ - '200': string; - /** - * 400 server error - */ - '400': unknown; - /** - * 500 server error - */ - '500': unknown; - }; - }; - }; - '/api/v{api-version}/error': { - post: { - req: TestErrorCodeData; - res: { - /** - * Custom message: Successful response - */ - '200': unknown; - /** - * Custom message: Internal Server Error - */ - '500': unknown; - /** - * Custom message: Not Implemented - */ - '501': unknown; - /** - * Custom message: Bad Gateway - */ - '502': unknown; - /** - * Custom message: Service Unavailable - */ - '503': unknown; - }; - }; - }; - '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串': { - post: { - req: NonAsciiæøåÆøÅöôêÊ字符串Data; - res: { - /** - * Successful response - */ - '200': Array; - }; - }; - put: { - req: PutWithFormUrlEncodedData; - }; - }; }; \ No newline at end of file diff --git a/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios_transform/types.gen.ts.snap b/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios_transform/types.gen.ts.snap index 95bd3b551..da954d95f 100644 --- a/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios_transform/types.gen.ts.snap +++ b/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios_transform/types.gen.ts.snap @@ -58,75 +58,6 @@ export type MultipleResponsesResponse = Array | Array; - }; - }; - }; - '/api/array-of-dates': { - put: { - res: { - /** - * Success - */ - '200': Array<(Date)>; - }; - }; - }; - '/api/date': { - put: { - res: { - /** - * Success - */ - '200': Date; - }; - }; - }; - '/api/multiple-responses': { - put: { - res: { - /** - * Updated - */ - '200': Array; - /** - * Created - */ - '201': Array; - }; - }; - }; -}; - export type ParentModelWithDatesResponseTransformer = (data: any) => Promise; export type ParentModelWithDatesModelResponseTransformer = (data: any) => ParentModelWithDates; diff --git a/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-bundle/types.gen.ts.snap b/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-bundle/types.gen.ts.snap index aec28c987..817014a4d 100644 --- a/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-bundle/types.gen.ts.snap +++ b/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-bundle/types.gen.ts.snap @@ -1578,373 +1578,4 @@ export type NonAsciiæøåÆøÅöôêÊ字符串Error = unknown; export type PutWithFormUrlEncodedData = { body: ArrayWithStrings; -}; - -export type $OpenApiTs = { - '/api/v{api-version}/no-tag': { - post: { - req: ImportData; - res: { - /** - * Success - */ - '200': Model_From_Zendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnly; - }; - }; - }; - '/api/v{api-version}/simple/$count': { - get: { - res: { - /** - * Success - */ - '200': Model_From_Zendesk; - }; - }; - }; - '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}': { - delete: { - req: DeleteFooData3; - }; - }; - '/api/v{api-version}/descriptions/': { - post: { - req: CallWithDescriptionsData; - }; - }; - '/api/v{api-version}/parameters/deprecated': { - post: { - req: DeprecatedCallData; - }; - }; - '/api/v{api-version}/parameters/{parameterPath}': { - post: { - req: CallWithParametersData; - }; - }; - '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}': { - post: { - req: CallWithWeirdParameterNamesData; - }; - }; - '/api/v{api-version}/parameters/': { - get: { - req: GetCallWithOptionalParamData; - }; - post: { - req: PostCallWithOptionalParamData; - res: { - /** - * Response is a simple number - */ - '200': number; - /** - * Success - */ - '204': void; - }; - }; - }; - '/api/v{api-version}/requestBody/': { - post: { - req: PostApiVbyApiVersionRequestBodyData; - }; - }; - '/api/v{api-version}/formData/': { - post: { - req: PostApiVbyApiVersionFormDataData; - }; - }; - '/api/v{api-version}/defaults': { - get: { - req: CallWithDefaultParametersData; - }; - post: { - req: CallWithDefaultOptionalParametersData; - }; - put: { - req: CallToTestOrderOfParamsData; - }; - }; - '/api/v{api-version}/no-content': { - get: { - res: { - /** - * Success - */ - '204': void; - }; - }; - }; - '/api/v{api-version}/multiple-tags/response-and-no-content': { - get: { - res: { - /** - * Response is a simple number - */ - '200': number; - /** - * Success - */ - '204': void; - }; - }; - }; - '/api/v{api-version}/multiple-tags/a': { - get: { - res: { - '200': _400; - }; - }; - }; - '/api/v{api-version}/multiple-tags/b': { - get: { - res: { - /** - * Success - */ - '204': void; - }; - }; - }; - '/api/v{api-version}/response': { - get: { - res: { - default: _import; - }; - }; - post: { - res: { - /** - * Message for 200 response - */ - '200': ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - '201': ModelWithString; - /** - * Message for 202 response - */ - '202': ModelWithString; - /** - * Message for 500 error - */ - '500': ModelWithStringError; - /** - * Message for 501 error - */ - '501': ModelWithStringError; - /** - * Message for 502 error - */ - '502': ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; - }; - }; - put: { - res: { - /** - * Message for 200 response - */ - '200': { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - '201': ModelThatExtends; - /** - * Message for 202 response - */ - '202': ModelThatExtendsExtends; - /** - * Message for 500 error - */ - '500': ModelWithStringError; - /** - * Message for 501 error - */ - '501': ModelWithStringError; - /** - * Message for 502 error - */ - '502': ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; - }; - }; - }; - '/api/v{api-version}/collectionFormat': { - get: { - req: CollectionFormatData; - }; - }; - '/api/v{api-version}/types': { - get: { - req: TypesData; - res: { - /** - * Response is a simple number - */ - '200': number; - /** - * Response is a simple string - */ - '201': string; - /** - * Response is a simple boolean - */ - '202': boolean; - /** - * Response is a simple object - */ - '203': { - [key: string]: unknown; - }; - }; - }; - }; - '/api/v{api-version}/upload': { - post: { - req: UploadFileData; - res: { - '200': boolean; - }; - }; - }; - '/api/v{api-version}/file/{id}': { - get: { - req: FileResponseData; - res: { - /** - * Success - */ - '200': (Blob | File); - }; - }; - }; - '/api/v{api-version}/complex': { - get: { - req: ComplexTypesData; - res: { - /** - * Successful response - */ - '200': Array; - /** - * 400 `server` error - */ - '400': unknown; - /** - * 500 server error - */ - '500': unknown; - }; - }; - }; - '/api/v{api-version}/multipart': { - post: { - req: MultipartRequestData; - }; - get: { - res: { - /** - * OK - */ - '200': { - file?: (Blob | File); - metadata?: { - foo?: string; - bar?: string; - }; - }; - }; - }; - }; - '/api/v{api-version}/complex/{id}': { - put: { - req: ComplexParamsData; - res: { - /** - * Success - */ - '200': ModelWithString; - }; - }; - }; - '/api/v{api-version}/header': { - post: { - res: { - /** - * Successful response - */ - '200': string; - /** - * 400 server error - */ - '400': unknown; - /** - * 500 server error - */ - '500': unknown; - }; - }; - }; - '/api/v{api-version}/error': { - post: { - req: TestErrorCodeData; - res: { - /** - * Custom message: Successful response - */ - '200': unknown; - /** - * Custom message: Internal Server Error - */ - '500': unknown; - /** - * Custom message: Not Implemented - */ - '501': unknown; - /** - * Custom message: Bad Gateway - */ - '502': unknown; - /** - * Custom message: Service Unavailable - */ - '503': unknown; - }; - }; - }; - '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串': { - post: { - req: NonAsciiæøåÆøÅöôêÊ字符串Data; - res: { - /** - * Successful response - */ - '200': Array; - }; - }; - put: { - req: PutWithFormUrlEncodedData; - }; - }; }; \ No newline at end of file diff --git a/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-bundle_transform/types.gen.ts.snap b/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-bundle_transform/types.gen.ts.snap index 95bd3b551..da954d95f 100644 --- a/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-bundle_transform/types.gen.ts.snap +++ b/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-bundle_transform/types.gen.ts.snap @@ -58,75 +58,6 @@ export type MultipleResponsesResponse = Array | Array; - }; - }; - }; - '/api/array-of-dates': { - put: { - res: { - /** - * Success - */ - '200': Array<(Date)>; - }; - }; - }; - '/api/date': { - put: { - res: { - /** - * Success - */ - '200': Date; - }; - }; - }; - '/api/multiple-responses': { - put: { - res: { - /** - * Updated - */ - '200': Array; - /** - * Created - */ - '201': Array; - }; - }; - }; -}; - export type ParentModelWithDatesResponseTransformer = (data: any) => Promise; export type ParentModelWithDatesModelResponseTransformer = (data: any) => ParentModelWithDates; diff --git a/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-class/types.gen.ts.snap b/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-class/types.gen.ts.snap index 11ae84da1..524b2061c 100644 --- a/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-class/types.gen.ts.snap +++ b/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-class/types.gen.ts.snap @@ -1578,373 +1578,4 @@ export type NonAsciiæøåÆøÅöôêÊ字符串Error = unknown; export type PutWithFormUrlEncodedData = { body: ArrayWithStrings; -}; - -export type $OpenApiTs = { - '/api/v{api-version}/no-tag': { - post: { - req: ImportData; - res: { - /** - * Success - */ - '200': Model_From_Zendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnly; - }; - }; - }; - '/api/v{api-version}/simple/$count': { - get: { - res: { - /** - * Success - */ - '200': Model_From_Zendesk; - }; - }; - }; - '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}': { - delete: { - req: DeleteFooData3; - }; - }; - '/api/v{api-version}/parameters/{parameterPath}': { - post: { - req: CallWithParametersData; - }; - }; - '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}': { - post: { - req: CallWithWeirdParameterNamesData; - }; - }; - '/api/v{api-version}/parameters/': { - get: { - req: GetCallWithOptionalParamData; - }; - post: { - req: PostCallWithOptionalParamData; - res: { - /** - * Response is a simple number - */ - '200': number; - /** - * Success - */ - '204': void; - }; - }; - }; - '/api/v{api-version}/descriptions/': { - post: { - req: CallWithDescriptionsData; - }; - }; - '/api/v{api-version}/parameters/deprecated': { - post: { - req: DeprecatedCallData; - }; - }; - '/api/v{api-version}/requestBody/': { - post: { - req: PostApiVbyApiVersionRequestBodyData; - }; - }; - '/api/v{api-version}/formData/': { - post: { - req: PostApiVbyApiVersionFormDataData; - }; - }; - '/api/v{api-version}/defaults': { - get: { - req: CallWithDefaultParametersData; - }; - post: { - req: CallWithDefaultOptionalParametersData; - }; - put: { - req: CallToTestOrderOfParamsData; - }; - }; - '/api/v{api-version}/no-content': { - get: { - res: { - /** - * Success - */ - '204': void; - }; - }; - }; - '/api/v{api-version}/multiple-tags/response-and-no-content': { - get: { - res: { - /** - * Response is a simple number - */ - '200': number; - /** - * Success - */ - '204': void; - }; - }; - }; - '/api/v{api-version}/response': { - get: { - res: { - default: _import; - }; - }; - post: { - res: { - /** - * Message for 200 response - */ - '200': ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - '201': ModelWithString; - /** - * Message for 202 response - */ - '202': ModelWithString; - /** - * Message for 500 error - */ - '500': ModelWithStringError; - /** - * Message for 501 error - */ - '501': ModelWithStringError; - /** - * Message for 502 error - */ - '502': ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; - }; - }; - put: { - res: { - /** - * Message for 200 response - */ - '200': { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - '201': ModelThatExtends; - /** - * Message for 202 response - */ - '202': ModelThatExtendsExtends; - /** - * Message for 500 error - */ - '500': ModelWithStringError; - /** - * Message for 501 error - */ - '501': ModelWithStringError; - /** - * Message for 502 error - */ - '502': ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; - }; - }; - }; - '/api/v{api-version}/multiple-tags/a': { - get: { - res: { - '200': _400; - }; - }; - }; - '/api/v{api-version}/multiple-tags/b': { - get: { - res: { - /** - * Success - */ - '204': void; - }; - }; - }; - '/api/v{api-version}/collectionFormat': { - get: { - req: CollectionFormatData; - }; - }; - '/api/v{api-version}/types': { - get: { - req: TypesData; - res: { - /** - * Response is a simple number - */ - '200': number; - /** - * Response is a simple string - */ - '201': string; - /** - * Response is a simple boolean - */ - '202': boolean; - /** - * Response is a simple object - */ - '203': { - [key: string]: unknown; - }; - }; - }; - }; - '/api/v{api-version}/upload': { - post: { - req: UploadFileData; - res: { - '200': boolean; - }; - }; - }; - '/api/v{api-version}/file/{id}': { - get: { - req: FileResponseData; - res: { - /** - * Success - */ - '200': (Blob | File); - }; - }; - }; - '/api/v{api-version}/complex': { - get: { - req: ComplexTypesData; - res: { - /** - * Successful response - */ - '200': Array; - /** - * 400 `server` error - */ - '400': unknown; - /** - * 500 server error - */ - '500': unknown; - }; - }; - }; - '/api/v{api-version}/complex/{id}': { - put: { - req: ComplexParamsData; - res: { - /** - * Success - */ - '200': ModelWithString; - }; - }; - }; - '/api/v{api-version}/multipart': { - post: { - req: MultipartRequestData; - }; - get: { - res: { - /** - * OK - */ - '200': { - file?: (Blob | File); - metadata?: { - foo?: string; - bar?: string; - }; - }; - }; - }; - }; - '/api/v{api-version}/header': { - post: { - res: { - /** - * Successful response - */ - '200': string; - /** - * 400 server error - */ - '400': unknown; - /** - * 500 server error - */ - '500': unknown; - }; - }; - }; - '/api/v{api-version}/error': { - post: { - req: TestErrorCodeData; - res: { - /** - * Custom message: Successful response - */ - '200': unknown; - /** - * Custom message: Internal Server Error - */ - '500': unknown; - /** - * Custom message: Not Implemented - */ - '501': unknown; - /** - * Custom message: Bad Gateway - */ - '502': unknown; - /** - * Custom message: Service Unavailable - */ - '503': unknown; - }; - }; - }; - '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串': { - post: { - req: NonAsciiæøåÆøÅöôêÊ字符串Data; - res: { - /** - * Successful response - */ - '200': Array; - }; - }; - put: { - req: PutWithFormUrlEncodedData; - }; - }; }; \ No newline at end of file diff --git a/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-class_transform/types.gen.ts.snap b/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-class_transform/types.gen.ts.snap index 95bd3b551..da954d95f 100644 --- a/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-class_transform/types.gen.ts.snap +++ b/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-class_transform/types.gen.ts.snap @@ -58,75 +58,6 @@ export type MultipleResponsesResponse = Array | Array; - }; - }; - }; - '/api/array-of-dates': { - put: { - res: { - /** - * Success - */ - '200': Array<(Date)>; - }; - }; - }; - '/api/date': { - put: { - res: { - /** - * Success - */ - '200': Date; - }; - }; - }; - '/api/multiple-responses': { - put: { - res: { - /** - * Updated - */ - '200': Array; - /** - * Created - */ - '201': Array; - }; - }; - }; -}; - export type ParentModelWithDatesResponseTransformer = (data: any) => Promise; export type ParentModelWithDatesModelResponseTransformer = (data: any) => ParentModelWithDates; diff --git a/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-plugin-tanstack-react-query/types.gen.ts.snap b/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-plugin-tanstack-react-query/types.gen.ts.snap index aec28c987..817014a4d 100644 --- a/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-plugin-tanstack-react-query/types.gen.ts.snap +++ b/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-plugin-tanstack-react-query/types.gen.ts.snap @@ -1578,373 +1578,4 @@ export type NonAsciiæøåÆøÅöôêÊ字符串Error = unknown; export type PutWithFormUrlEncodedData = { body: ArrayWithStrings; -}; - -export type $OpenApiTs = { - '/api/v{api-version}/no-tag': { - post: { - req: ImportData; - res: { - /** - * Success - */ - '200': Model_From_Zendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnly; - }; - }; - }; - '/api/v{api-version}/simple/$count': { - get: { - res: { - /** - * Success - */ - '200': Model_From_Zendesk; - }; - }; - }; - '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}': { - delete: { - req: DeleteFooData3; - }; - }; - '/api/v{api-version}/descriptions/': { - post: { - req: CallWithDescriptionsData; - }; - }; - '/api/v{api-version}/parameters/deprecated': { - post: { - req: DeprecatedCallData; - }; - }; - '/api/v{api-version}/parameters/{parameterPath}': { - post: { - req: CallWithParametersData; - }; - }; - '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}': { - post: { - req: CallWithWeirdParameterNamesData; - }; - }; - '/api/v{api-version}/parameters/': { - get: { - req: GetCallWithOptionalParamData; - }; - post: { - req: PostCallWithOptionalParamData; - res: { - /** - * Response is a simple number - */ - '200': number; - /** - * Success - */ - '204': void; - }; - }; - }; - '/api/v{api-version}/requestBody/': { - post: { - req: PostApiVbyApiVersionRequestBodyData; - }; - }; - '/api/v{api-version}/formData/': { - post: { - req: PostApiVbyApiVersionFormDataData; - }; - }; - '/api/v{api-version}/defaults': { - get: { - req: CallWithDefaultParametersData; - }; - post: { - req: CallWithDefaultOptionalParametersData; - }; - put: { - req: CallToTestOrderOfParamsData; - }; - }; - '/api/v{api-version}/no-content': { - get: { - res: { - /** - * Success - */ - '204': void; - }; - }; - }; - '/api/v{api-version}/multiple-tags/response-and-no-content': { - get: { - res: { - /** - * Response is a simple number - */ - '200': number; - /** - * Success - */ - '204': void; - }; - }; - }; - '/api/v{api-version}/multiple-tags/a': { - get: { - res: { - '200': _400; - }; - }; - }; - '/api/v{api-version}/multiple-tags/b': { - get: { - res: { - /** - * Success - */ - '204': void; - }; - }; - }; - '/api/v{api-version}/response': { - get: { - res: { - default: _import; - }; - }; - post: { - res: { - /** - * Message for 200 response - */ - '200': ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - '201': ModelWithString; - /** - * Message for 202 response - */ - '202': ModelWithString; - /** - * Message for 500 error - */ - '500': ModelWithStringError; - /** - * Message for 501 error - */ - '501': ModelWithStringError; - /** - * Message for 502 error - */ - '502': ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; - }; - }; - put: { - res: { - /** - * Message for 200 response - */ - '200': { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - '201': ModelThatExtends; - /** - * Message for 202 response - */ - '202': ModelThatExtendsExtends; - /** - * Message for 500 error - */ - '500': ModelWithStringError; - /** - * Message for 501 error - */ - '501': ModelWithStringError; - /** - * Message for 502 error - */ - '502': ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; - }; - }; - }; - '/api/v{api-version}/collectionFormat': { - get: { - req: CollectionFormatData; - }; - }; - '/api/v{api-version}/types': { - get: { - req: TypesData; - res: { - /** - * Response is a simple number - */ - '200': number; - /** - * Response is a simple string - */ - '201': string; - /** - * Response is a simple boolean - */ - '202': boolean; - /** - * Response is a simple object - */ - '203': { - [key: string]: unknown; - }; - }; - }; - }; - '/api/v{api-version}/upload': { - post: { - req: UploadFileData; - res: { - '200': boolean; - }; - }; - }; - '/api/v{api-version}/file/{id}': { - get: { - req: FileResponseData; - res: { - /** - * Success - */ - '200': (Blob | File); - }; - }; - }; - '/api/v{api-version}/complex': { - get: { - req: ComplexTypesData; - res: { - /** - * Successful response - */ - '200': Array; - /** - * 400 `server` error - */ - '400': unknown; - /** - * 500 server error - */ - '500': unknown; - }; - }; - }; - '/api/v{api-version}/multipart': { - post: { - req: MultipartRequestData; - }; - get: { - res: { - /** - * OK - */ - '200': { - file?: (Blob | File); - metadata?: { - foo?: string; - bar?: string; - }; - }; - }; - }; - }; - '/api/v{api-version}/complex/{id}': { - put: { - req: ComplexParamsData; - res: { - /** - * Success - */ - '200': ModelWithString; - }; - }; - }; - '/api/v{api-version}/header': { - post: { - res: { - /** - * Successful response - */ - '200': string; - /** - * 400 server error - */ - '400': unknown; - /** - * 500 server error - */ - '500': unknown; - }; - }; - }; - '/api/v{api-version}/error': { - post: { - req: TestErrorCodeData; - res: { - /** - * Custom message: Successful response - */ - '200': unknown; - /** - * Custom message: Internal Server Error - */ - '500': unknown; - /** - * Custom message: Not Implemented - */ - '501': unknown; - /** - * Custom message: Bad Gateway - */ - '502': unknown; - /** - * Custom message: Service Unavailable - */ - '503': unknown; - }; - }; - }; - '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串': { - post: { - req: NonAsciiæøåÆøÅöôêÊ字符串Data; - res: { - /** - * Successful response - */ - '200': Array; - }; - }; - put: { - req: PutWithFormUrlEncodedData; - }; - }; }; \ No newline at end of file diff --git a/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-plugin-tanstack-react-query_transform/types.gen.ts.snap b/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-plugin-tanstack-react-query_transform/types.gen.ts.snap index 95bd3b551..da954d95f 100644 --- a/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-plugin-tanstack-react-query_transform/types.gen.ts.snap +++ b/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-plugin-tanstack-react-query_transform/types.gen.ts.snap @@ -58,75 +58,6 @@ export type MultipleResponsesResponse = Array | Array; - }; - }; - }; - '/api/array-of-dates': { - put: { - res: { - /** - * Success - */ - '200': Array<(Date)>; - }; - }; - }; - '/api/date': { - put: { - res: { - /** - * Success - */ - '200': Date; - }; - }; - }; - '/api/multiple-responses': { - put: { - res: { - /** - * Updated - */ - '200': Array; - /** - * Created - */ - '201': Array; - }; - }; - }; -}; - export type ParentModelWithDatesResponseTransformer = (data: any) => Promise; export type ParentModelWithDatesModelResponseTransformer = (data: any) => ParentModelWithDates; diff --git a/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch/types.gen.ts.snap b/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch/types.gen.ts.snap index aec28c987..817014a4d 100644 --- a/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch/types.gen.ts.snap +++ b/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch/types.gen.ts.snap @@ -1578,373 +1578,4 @@ export type NonAsciiæøåÆøÅöôêÊ字符串Error = unknown; export type PutWithFormUrlEncodedData = { body: ArrayWithStrings; -}; - -export type $OpenApiTs = { - '/api/v{api-version}/no-tag': { - post: { - req: ImportData; - res: { - /** - * Success - */ - '200': Model_From_Zendesk; - /** - * Default success response - */ - default: ModelWithReadOnlyAndWriteOnly; - }; - }; - }; - '/api/v{api-version}/simple/$count': { - get: { - res: { - /** - * Success - */ - '200': Model_From_Zendesk; - }; - }; - }; - '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}': { - delete: { - req: DeleteFooData3; - }; - }; - '/api/v{api-version}/descriptions/': { - post: { - req: CallWithDescriptionsData; - }; - }; - '/api/v{api-version}/parameters/deprecated': { - post: { - req: DeprecatedCallData; - }; - }; - '/api/v{api-version}/parameters/{parameterPath}': { - post: { - req: CallWithParametersData; - }; - }; - '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}': { - post: { - req: CallWithWeirdParameterNamesData; - }; - }; - '/api/v{api-version}/parameters/': { - get: { - req: GetCallWithOptionalParamData; - }; - post: { - req: PostCallWithOptionalParamData; - res: { - /** - * Response is a simple number - */ - '200': number; - /** - * Success - */ - '204': void; - }; - }; - }; - '/api/v{api-version}/requestBody/': { - post: { - req: PostApiVbyApiVersionRequestBodyData; - }; - }; - '/api/v{api-version}/formData/': { - post: { - req: PostApiVbyApiVersionFormDataData; - }; - }; - '/api/v{api-version}/defaults': { - get: { - req: CallWithDefaultParametersData; - }; - post: { - req: CallWithDefaultOptionalParametersData; - }; - put: { - req: CallToTestOrderOfParamsData; - }; - }; - '/api/v{api-version}/no-content': { - get: { - res: { - /** - * Success - */ - '204': void; - }; - }; - }; - '/api/v{api-version}/multiple-tags/response-and-no-content': { - get: { - res: { - /** - * Response is a simple number - */ - '200': number; - /** - * Success - */ - '204': void; - }; - }; - }; - '/api/v{api-version}/multiple-tags/a': { - get: { - res: { - '200': _400; - }; - }; - }; - '/api/v{api-version}/multiple-tags/b': { - get: { - res: { - /** - * Success - */ - '204': void; - }; - }; - }; - '/api/v{api-version}/response': { - get: { - res: { - default: _import; - }; - }; - post: { - res: { - /** - * Message for 200 response - */ - '200': ModelWithBoolean & ModelWithInteger; - /** - * Message for 201 response - */ - '201': ModelWithString; - /** - * Message for 202 response - */ - '202': ModelWithString; - /** - * Message for 500 error - */ - '500': ModelWithStringError; - /** - * Message for 501 error - */ - '501': ModelWithStringError; - /** - * Message for 502 error - */ - '502': ModelWithStringError; - /** - * Message for 4XX errors - */ - '4XX': DictionaryWithArray; - /** - * Default error response - */ - default: ModelWithBoolean; - }; - }; - put: { - res: { - /** - * Message for 200 response - */ - '200': { - readonly '@namespace.string'?: string; - readonly '@namespace.integer'?: number; - readonly value?: Array; - }; - /** - * Message for 201 response - */ - '201': ModelThatExtends; - /** - * Message for 202 response - */ - '202': ModelThatExtendsExtends; - /** - * Message for 500 error - */ - '500': ModelWithStringError; - /** - * Message for 501 error - */ - '501': ModelWithStringError; - /** - * Message for 502 error - */ - '502': ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; - }; - }; - }; - '/api/v{api-version}/collectionFormat': { - get: { - req: CollectionFormatData; - }; - }; - '/api/v{api-version}/types': { - get: { - req: TypesData; - res: { - /** - * Response is a simple number - */ - '200': number; - /** - * Response is a simple string - */ - '201': string; - /** - * Response is a simple boolean - */ - '202': boolean; - /** - * Response is a simple object - */ - '203': { - [key: string]: unknown; - }; - }; - }; - }; - '/api/v{api-version}/upload': { - post: { - req: UploadFileData; - res: { - '200': boolean; - }; - }; - }; - '/api/v{api-version}/file/{id}': { - get: { - req: FileResponseData; - res: { - /** - * Success - */ - '200': (Blob | File); - }; - }; - }; - '/api/v{api-version}/complex': { - get: { - req: ComplexTypesData; - res: { - /** - * Successful response - */ - '200': Array; - /** - * 400 `server` error - */ - '400': unknown; - /** - * 500 server error - */ - '500': unknown; - }; - }; - }; - '/api/v{api-version}/multipart': { - post: { - req: MultipartRequestData; - }; - get: { - res: { - /** - * OK - */ - '200': { - file?: (Blob | File); - metadata?: { - foo?: string; - bar?: string; - }; - }; - }; - }; - }; - '/api/v{api-version}/complex/{id}': { - put: { - req: ComplexParamsData; - res: { - /** - * Success - */ - '200': ModelWithString; - }; - }; - }; - '/api/v{api-version}/header': { - post: { - res: { - /** - * Successful response - */ - '200': string; - /** - * 400 server error - */ - '400': unknown; - /** - * 500 server error - */ - '500': unknown; - }; - }; - }; - '/api/v{api-version}/error': { - post: { - req: TestErrorCodeData; - res: { - /** - * Custom message: Successful response - */ - '200': unknown; - /** - * Custom message: Internal Server Error - */ - '500': unknown; - /** - * Custom message: Not Implemented - */ - '501': unknown; - /** - * Custom message: Bad Gateway - */ - '502': unknown; - /** - * Custom message: Service Unavailable - */ - '503': unknown; - }; - }; - }; - '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串': { - post: { - req: NonAsciiæøåÆøÅöôêÊ字符串Data; - res: { - /** - * Successful response - */ - '200': Array; - }; - }; - put: { - req: PutWithFormUrlEncodedData; - }; - }; }; \ No newline at end of file diff --git a/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch_transform/types.gen.ts.snap b/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch_transform/types.gen.ts.snap index 95bd3b551..da954d95f 100644 --- a/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch_transform/types.gen.ts.snap +++ b/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch_transform/types.gen.ts.snap @@ -58,75 +58,6 @@ export type MultipleResponsesResponse = Array | Array; - }; - }; - }; - '/api/array-of-dates': { - put: { - res: { - /** - * Success - */ - '200': Array<(Date)>; - }; - }; - }; - '/api/date': { - put: { - res: { - /** - * Success - */ - '200': Date; - }; - }; - }; - '/api/multiple-responses': { - put: { - res: { - /** - * Updated - */ - '200': Array; - /** - * Created - */ - '201': Array; - }; - }; - }; -}; - export type ParentModelWithDatesResponseTransformer = (data: any) => Promise; export type ParentModelWithDatesModelResponseTransformer = (data: any) => ParentModelWithDates; diff --git a/packages/openapi-ts/test/__snapshots__/test/generated/v3/types.gen.ts.snap b/packages/openapi-ts/test/__snapshots__/test/generated/v3/types.gen.ts.snap index fe62233ab..54d54f45d 100644 --- a/packages/openapi-ts/test/__snapshots__/test/generated/v3/types.gen.ts.snap +++ b/packages/openapi-ts/test/__snapshots__/test/generated/v3/types.gen.ts.snap @@ -1476,373 +1476,4 @@ export type NonAsciiæøåÆøÅöôêÊ字符串Response = Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; - }; - }; - }; - '/api/v{api-version}/multiple-tags/a': { - get: { - res: { - 200: _400; - }; - }; - }; - '/api/v{api-version}/multiple-tags/b': { - get: { - res: { - /** - * Success - */ - 204: void; - }; - }; - }; - '/api/v{api-version}/collectionFormat': { - get: { - req: CollectionFormatData; - }; - }; - '/api/v{api-version}/types': { - get: { - req: TypesData; - res: { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; - }; - }; - }; - '/api/v{api-version}/upload': { - post: { - req: UploadFileData; - res: { - 200: boolean; - }; - }; - }; - '/api/v{api-version}/file/{id}': { - get: { - req: FileResponseData; - res: { - /** - * Success - */ - 200: (Blob | File); - }; - }; - }; - '/api/v{api-version}/complex': { - get: { - req: ComplexTypesData; - res: { - /** - * Successful response - */ - 200: Array; - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; - }; - }; - }; - '/api/v{api-version}/complex/{id}': { - put: { - req: ComplexParamsData; - res: { - /** - * Success - */ - 200: ModelWithString; - }; - }; - }; - '/api/v{api-version}/multipart': { - post: { - req: MultipartRequestData; - }; - get: { - res: { - /** - * OK - */ - 200: { - file?: (Blob | File); - metadata?: { - foo?: string; - bar?: string; - }; - }; - }; - }; - }; - '/api/v{api-version}/header': { - post: { - res: { - /** - * Successful response - */ - 200: string; - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; - }; - }; - }; - '/api/v{api-version}/error': { - post: { - req: TestErrorCodeData; - res: { - /** - * Custom message: Successful response - */ - 200: unknown; - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; - }; - }; - }; - '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串': { - post: { - req: NonAsciiæøåÆøÅöôêÊ字符串Data; - res: { - /** - * Successful response - */ - 200: Array; - }; - }; - put: { - req: PutWithFormUrlEncodedData; - }; - }; }; \ No newline at end of file diff --git a/packages/openapi-ts/test/__snapshots__/test/generated/v3_angular/types.gen.ts.snap b/packages/openapi-ts/test/__snapshots__/test/generated/v3_angular/types.gen.ts.snap index 0d43f8e53..137a7eb0f 100644 --- a/packages/openapi-ts/test/__snapshots__/test/generated/v3_angular/types.gen.ts.snap +++ b/packages/openapi-ts/test/__snapshots__/test/generated/v3_angular/types.gen.ts.snap @@ -1353,373 +1353,4 @@ export type NonAsciiæøåÆøÅöôêÊ字符串Response = Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; - }; - }; - }; - '/api/v{api-version}/multiple-tags/a': { - get: { - res: { - 200: _400; - }; - }; - }; - '/api/v{api-version}/multiple-tags/b': { - get: { - res: { - /** - * Success - */ - 204: void; - }; - }; - }; - '/api/v{api-version}/collectionFormat': { - get: { - req: CollectionFormatData; - }; - }; - '/api/v{api-version}/types': { - get: { - req: TypesData; - res: { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; - }; - }; - }; - '/api/v{api-version}/upload': { - post: { - req: UploadFileData; - res: { - 200: boolean; - }; - }; - }; - '/api/v{api-version}/file/{id}': { - get: { - req: FileResponseData; - res: { - /** - * Success - */ - 200: (Blob | File); - }; - }; - }; - '/api/v{api-version}/complex': { - get: { - req: ComplexTypesData; - res: { - /** - * Successful response - */ - 200: Array; - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; - }; - }; - }; - '/api/v{api-version}/complex/{id}': { - put: { - req: ComplexParamsData; - res: { - /** - * Success - */ - 200: ModelWithString; - }; - }; - }; - '/api/v{api-version}/multipart': { - post: { - req: MultipartRequestData; - }; - get: { - res: { - /** - * OK - */ - 200: { - file?: (Blob | File); - metadata?: { - foo?: string; - bar?: string; - }; - }; - }; - }; - }; - '/api/v{api-version}/header': { - post: { - res: { - /** - * Successful response - */ - 200: string; - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; - }; - }; - }; - '/api/v{api-version}/error': { - post: { - req: TestErrorCodeData; - res: { - /** - * Custom message: Successful response - */ - 200: unknown; - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; - }; - }; - }; - '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串': { - post: { - req: NonAsciiæøåÆøÅöôêÊ字符串Data; - res: { - /** - * Successful response - */ - 200: Array; - }; - }; - put: { - req: PutWithFormUrlEncodedData; - }; - }; }; \ No newline at end of file diff --git a/packages/openapi-ts/test/__snapshots__/test/generated/v3_angular_transform/types.gen.ts.snap b/packages/openapi-ts/test/__snapshots__/test/generated/v3_angular_transform/types.gen.ts.snap index 55217bd5e..93ef80d54 100644 --- a/packages/openapi-ts/test/__snapshots__/test/generated/v3_angular_transform/types.gen.ts.snap +++ b/packages/openapi-ts/test/__snapshots__/test/generated/v3_angular_transform/types.gen.ts.snap @@ -46,75 +46,6 @@ export type DateResponse = Date; export type MultipleResponsesResponse = Array | Array; -export type $OpenApiTs = { - '/api/model-with-dates': { - post: { - res: { - /** - * Success - */ - 200: ParentModelWithDates; - /** - * Success - */ - 201: unknown; - }; - }; - put: { - res: { - /** - * Success - */ - 200: ModelWithDates; - }; - }; - }; - '/api/model-with-dates-array': { - put: { - res: { - /** - * Success - */ - 200: Array; - }; - }; - }; - '/api/array-of-dates': { - put: { - res: { - /** - * Success - */ - 200: Array<(Date)>; - }; - }; - }; - '/api/date': { - put: { - res: { - /** - * Success - */ - 200: Date; - }; - }; - }; - '/api/multiple-responses': { - put: { - res: { - /** - * Updated - */ - 200: Array; - /** - * Created - */ - 201: Array; - }; - }; - }; -}; - export type ParentModelWithDatesResponseTransformer = (data: any) => Promise; export type ParentModelWithDatesModelResponseTransformer = (data: any) => ParentModelWithDates; diff --git a/packages/openapi-ts/test/__snapshots__/test/generated/v3_axios/types.gen.ts.snap b/packages/openapi-ts/test/__snapshots__/test/generated/v3_axios/types.gen.ts.snap index fe62233ab..54d54f45d 100644 --- a/packages/openapi-ts/test/__snapshots__/test/generated/v3_axios/types.gen.ts.snap +++ b/packages/openapi-ts/test/__snapshots__/test/generated/v3_axios/types.gen.ts.snap @@ -1476,373 +1476,4 @@ export type NonAsciiæøåÆøÅöôêÊ字符串Response = Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; - }; - }; - }; - '/api/v{api-version}/multiple-tags/a': { - get: { - res: { - 200: _400; - }; - }; - }; - '/api/v{api-version}/multiple-tags/b': { - get: { - res: { - /** - * Success - */ - 204: void; - }; - }; - }; - '/api/v{api-version}/collectionFormat': { - get: { - req: CollectionFormatData; - }; - }; - '/api/v{api-version}/types': { - get: { - req: TypesData; - res: { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; - }; - }; - }; - '/api/v{api-version}/upload': { - post: { - req: UploadFileData; - res: { - 200: boolean; - }; - }; - }; - '/api/v{api-version}/file/{id}': { - get: { - req: FileResponseData; - res: { - /** - * Success - */ - 200: (Blob | File); - }; - }; - }; - '/api/v{api-version}/complex': { - get: { - req: ComplexTypesData; - res: { - /** - * Successful response - */ - 200: Array; - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; - }; - }; - }; - '/api/v{api-version}/complex/{id}': { - put: { - req: ComplexParamsData; - res: { - /** - * Success - */ - 200: ModelWithString; - }; - }; - }; - '/api/v{api-version}/multipart': { - post: { - req: MultipartRequestData; - }; - get: { - res: { - /** - * OK - */ - 200: { - file?: (Blob | File); - metadata?: { - foo?: string; - bar?: string; - }; - }; - }; - }; - }; - '/api/v{api-version}/header': { - post: { - res: { - /** - * Successful response - */ - 200: string; - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; - }; - }; - }; - '/api/v{api-version}/error': { - post: { - req: TestErrorCodeData; - res: { - /** - * Custom message: Successful response - */ - 200: unknown; - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; - }; - }; - }; - '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串': { - post: { - req: NonAsciiæøåÆøÅöôêÊ字符串Data; - res: { - /** - * Successful response - */ - 200: Array; - }; - }; - put: { - req: PutWithFormUrlEncodedData; - }; - }; }; \ No newline at end of file diff --git a/packages/openapi-ts/test/__snapshots__/test/generated/v3_axios_transform/types.gen.ts.snap b/packages/openapi-ts/test/__snapshots__/test/generated/v3_axios_transform/types.gen.ts.snap index 55217bd5e..93ef80d54 100644 --- a/packages/openapi-ts/test/__snapshots__/test/generated/v3_axios_transform/types.gen.ts.snap +++ b/packages/openapi-ts/test/__snapshots__/test/generated/v3_axios_transform/types.gen.ts.snap @@ -46,75 +46,6 @@ export type DateResponse = Date; export type MultipleResponsesResponse = Array | Array; -export type $OpenApiTs = { - '/api/model-with-dates': { - post: { - res: { - /** - * Success - */ - 200: ParentModelWithDates; - /** - * Success - */ - 201: unknown; - }; - }; - put: { - res: { - /** - * Success - */ - 200: ModelWithDates; - }; - }; - }; - '/api/model-with-dates-array': { - put: { - res: { - /** - * Success - */ - 200: Array; - }; - }; - }; - '/api/array-of-dates': { - put: { - res: { - /** - * Success - */ - 200: Array<(Date)>; - }; - }; - }; - '/api/date': { - put: { - res: { - /** - * Success - */ - 200: Date; - }; - }; - }; - '/api/multiple-responses': { - put: { - res: { - /** - * Updated - */ - 200: Array; - /** - * Created - */ - 201: Array; - }; - }; - }; -}; - export type ParentModelWithDatesResponseTransformer = (data: any) => Promise; export type ParentModelWithDatesModelResponseTransformer = (data: any) => ParentModelWithDates; diff --git a/packages/openapi-ts/test/__snapshots__/test/generated/v3_client/types.gen.ts.snap b/packages/openapi-ts/test/__snapshots__/test/generated/v3_client/types.gen.ts.snap index 6f276d9d0..ed9e8aad4 100644 --- a/packages/openapi-ts/test/__snapshots__/test/generated/v3_client/types.gen.ts.snap +++ b/packages/openapi-ts/test/__snapshots__/test/generated/v3_client/types.gen.ts.snap @@ -1353,373 +1353,4 @@ export type NonAsciiæøåÆøÅöôêÊ字符串Response = Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; - }; - }; - }; - '/api/v{api-version}/multiple-tags/a': { - get: { - res: { - 200: _400; - }; - }; - }; - '/api/v{api-version}/multiple-tags/b': { - get: { - res: { - /** - * Success - */ - 204: void; - }; - }; - }; - '/api/v{api-version}/collectionFormat': { - get: { - req: CollectionFormatData; - }; - }; - '/api/v{api-version}/types': { - get: { - req: TypesData; - res: { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; - }; - }; - }; - '/api/v{api-version}/upload': { - post: { - req: UploadFileData; - res: { - 200: boolean; - }; - }; - }; - '/api/v{api-version}/file/{id}': { - get: { - req: FileResponseData; - res: { - /** - * Success - */ - 200: (Blob | File); - }; - }; - }; - '/api/v{api-version}/complex': { - get: { - req: ComplexTypesData; - res: { - /** - * Successful response - */ - 200: Array; - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; - }; - }; - }; - '/api/v{api-version}/complex/{id}': { - put: { - req: ComplexParamsData; - res: { - /** - * Success - */ - 200: ModelWithString; - }; - }; - }; - '/api/v{api-version}/multipart': { - post: { - req: MultipartRequestData; - }; - get: { - res: { - /** - * OK - */ - 200: { - file?: (Blob | File); - metadata?: { - foo?: string; - bar?: string; - }; - }; - }; - }; - }; - '/api/v{api-version}/header': { - post: { - res: { - /** - * Successful response - */ - 200: string; - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; - }; - }; - }; - '/api/v{api-version}/error': { - post: { - req: TestErrorCodeData; - res: { - /** - * Custom message: Successful response - */ - 200: unknown; - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; - }; - }; - }; - '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串': { - post: { - req: NonAsciiæøåÆøÅöôêÊ字符串Data; - res: { - /** - * Successful response - */ - 200: Array; - }; - }; - put: { - req: PutWithFormUrlEncodedData; - }; - }; }; \ No newline at end of file diff --git a/packages/openapi-ts/test/__snapshots__/test/generated/v3_client_transform/types.gen.ts.snap b/packages/openapi-ts/test/__snapshots__/test/generated/v3_client_transform/types.gen.ts.snap index 55217bd5e..93ef80d54 100644 --- a/packages/openapi-ts/test/__snapshots__/test/generated/v3_client_transform/types.gen.ts.snap +++ b/packages/openapi-ts/test/__snapshots__/test/generated/v3_client_transform/types.gen.ts.snap @@ -46,75 +46,6 @@ export type DateResponse = Date; export type MultipleResponsesResponse = Array | Array; -export type $OpenApiTs = { - '/api/model-with-dates': { - post: { - res: { - /** - * Success - */ - 200: ParentModelWithDates; - /** - * Success - */ - 201: unknown; - }; - }; - put: { - res: { - /** - * Success - */ - 200: ModelWithDates; - }; - }; - }; - '/api/model-with-dates-array': { - put: { - res: { - /** - * Success - */ - 200: Array; - }; - }; - }; - '/api/array-of-dates': { - put: { - res: { - /** - * Success - */ - 200: Array<(Date)>; - }; - }; - }; - '/api/date': { - put: { - res: { - /** - * Success - */ - 200: Date; - }; - }; - }; - '/api/multiple-responses': { - put: { - res: { - /** - * Updated - */ - 200: Array; - /** - * Created - */ - 201: Array; - }; - }; - }; -}; - export type ParentModelWithDatesResponseTransformer = (data: any) => Promise; export type ParentModelWithDatesModelResponseTransformer = (data: any) => ParentModelWithDates; diff --git a/packages/openapi-ts/test/__snapshots__/test/generated/v3_enums_typescript/types.gen.ts.snap b/packages/openapi-ts/test/__snapshots__/test/generated/v3_enums_typescript/types.gen.ts.snap index 7203708b5..bae6b8a0f 100644 --- a/packages/openapi-ts/test/__snapshots__/test/generated/v3_enums_typescript/types.gen.ts.snap +++ b/packages/openapi-ts/test/__snapshots__/test/generated/v3_enums_typescript/types.gen.ts.snap @@ -1432,373 +1432,4 @@ export type NonAsciiæøåÆøÅöôêÊ字符串Response = Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; - }; - }; - }; - '/api/v{api-version}/multiple-tags/a': { - get: { - res: { - 200: _400; - }; - }; - }; - '/api/v{api-version}/multiple-tags/b': { - get: { - res: { - /** - * Success - */ - 204: void; - }; - }; - }; - '/api/v{api-version}/collectionFormat': { - get: { - req: CollectionFormatData; - }; - }; - '/api/v{api-version}/types': { - get: { - req: TypesData; - res: { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; - }; - }; - }; - '/api/v{api-version}/upload': { - post: { - req: UploadFileData; - res: { - 200: boolean; - }; - }; - }; - '/api/v{api-version}/file/{id}': { - get: { - req: FileResponseData; - res: { - /** - * Success - */ - 200: (Blob | File); - }; - }; - }; - '/api/v{api-version}/complex': { - get: { - req: ComplexTypesData; - res: { - /** - * Successful response - */ - 200: Array; - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; - }; - }; - }; - '/api/v{api-version}/complex/{id}': { - put: { - req: ComplexParamsData; - res: { - /** - * Success - */ - 200: ModelWithString; - }; - }; - }; - '/api/v{api-version}/multipart': { - post: { - req: MultipartRequestData; - }; - get: { - res: { - /** - * OK - */ - 200: { - file?: (Blob | File); - metadata?: { - foo?: string; - bar?: string; - }; - }; - }; - }; - }; - '/api/v{api-version}/header': { - post: { - res: { - /** - * Successful response - */ - 200: string; - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; - }; - }; - }; - '/api/v{api-version}/error': { - post: { - req: TestErrorCodeData; - res: { - /** - * Custom message: Successful response - */ - 200: unknown; - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; - }; - }; - }; - '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串': { - post: { - req: NonAsciiæøåÆøÅöôêÊ字符串Data; - res: { - /** - * Successful response - */ - 200: Array; - }; - }; - put: { - req: PutWithFormUrlEncodedData; - }; - }; }; \ No newline at end of file diff --git a/packages/openapi-ts/test/__snapshots__/test/generated/v3_enums_typescript_namespace/types.gen.ts.snap b/packages/openapi-ts/test/__snapshots__/test/generated/v3_enums_typescript_namespace/types.gen.ts.snap index 41e6e1bc1..5b069e8ee 100644 --- a/packages/openapi-ts/test/__snapshots__/test/generated/v3_enums_typescript_namespace/types.gen.ts.snap +++ b/packages/openapi-ts/test/__snapshots__/test/generated/v3_enums_typescript_namespace/types.gen.ts.snap @@ -1463,373 +1463,4 @@ export type NonAsciiæøåÆøÅöôêÊ字符串Response = Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; - }; - }; - }; - '/api/v{api-version}/multiple-tags/a': { - get: { - res: { - 200: _400; - }; - }; - }; - '/api/v{api-version}/multiple-tags/b': { - get: { - res: { - /** - * Success - */ - 204: void; - }; - }; - }; - '/api/v{api-version}/collectionFormat': { - get: { - req: CollectionFormatData; - }; - }; - '/api/v{api-version}/types': { - get: { - req: TypesData; - res: { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; - }; - }; - }; - '/api/v{api-version}/upload': { - post: { - req: UploadFileData; - res: { - 200: boolean; - }; - }; - }; - '/api/v{api-version}/file/{id}': { - get: { - req: FileResponseData; - res: { - /** - * Success - */ - 200: (Blob | File); - }; - }; - }; - '/api/v{api-version}/complex': { - get: { - req: ComplexTypesData; - res: { - /** - * Successful response - */ - 200: Array; - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; - }; - }; - }; - '/api/v{api-version}/complex/{id}': { - put: { - req: ComplexParamsData; - res: { - /** - * Success - */ - 200: ModelWithString; - }; - }; - }; - '/api/v{api-version}/multipart': { - post: { - req: MultipartRequestData; - }; - get: { - res: { - /** - * OK - */ - 200: { - file?: (Blob | File); - metadata?: { - foo?: string; - bar?: string; - }; - }; - }; - }; - }; - '/api/v{api-version}/header': { - post: { - res: { - /** - * Successful response - */ - 200: string; - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; - }; - }; - }; - '/api/v{api-version}/error': { - post: { - req: TestErrorCodeData; - res: { - /** - * Custom message: Successful response - */ - 200: unknown; - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; - }; - }; - }; - '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串': { - post: { - req: NonAsciiæøåÆøÅöôêÊ字符串Data; - res: { - /** - * Successful response - */ - 200: Array; - }; - }; - put: { - req: PutWithFormUrlEncodedData; - }; - }; }; \ No newline at end of file diff --git a/packages/openapi-ts/test/__snapshots__/test/generated/v3_legacy_positional_args/types.gen.ts.snap b/packages/openapi-ts/test/__snapshots__/test/generated/v3_legacy_positional_args/types.gen.ts.snap index c1e3e09f8..ab827ffa3 100644 --- a/packages/openapi-ts/test/__snapshots__/test/generated/v3_legacy_positional_args/types.gen.ts.snap +++ b/packages/openapi-ts/test/__snapshots__/test/generated/v3_legacy_positional_args/types.gen.ts.snap @@ -99,18 +99,4 @@ export type CallToTestOrderOfParamsData = { * This is a string with no default */ parameterStringWithNoDefault: string; -}; - -export type $OpenApiTs = { - '/api/v{api-version}/defaults': { - get: { - req: CallWithDefaultParametersData; - }; - post: { - req: CallWithDefaultOptionalParametersData; - }; - put: { - req: CallToTestOrderOfParamsData; - }; - }; }; \ No newline at end of file diff --git a/packages/openapi-ts/test/__snapshots__/test/generated/v3_node/types.gen.ts.snap b/packages/openapi-ts/test/__snapshots__/test/generated/v3_node/types.gen.ts.snap index fe62233ab..54d54f45d 100644 --- a/packages/openapi-ts/test/__snapshots__/test/generated/v3_node/types.gen.ts.snap +++ b/packages/openapi-ts/test/__snapshots__/test/generated/v3_node/types.gen.ts.snap @@ -1476,373 +1476,4 @@ export type NonAsciiæøåÆøÅöôêÊ字符串Response = Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; - }; - }; - }; - '/api/v{api-version}/multiple-tags/a': { - get: { - res: { - 200: _400; - }; - }; - }; - '/api/v{api-version}/multiple-tags/b': { - get: { - res: { - /** - * Success - */ - 204: void; - }; - }; - }; - '/api/v{api-version}/collectionFormat': { - get: { - req: CollectionFormatData; - }; - }; - '/api/v{api-version}/types': { - get: { - req: TypesData; - res: { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; - }; - }; - }; - '/api/v{api-version}/upload': { - post: { - req: UploadFileData; - res: { - 200: boolean; - }; - }; - }; - '/api/v{api-version}/file/{id}': { - get: { - req: FileResponseData; - res: { - /** - * Success - */ - 200: (Blob | File); - }; - }; - }; - '/api/v{api-version}/complex': { - get: { - req: ComplexTypesData; - res: { - /** - * Successful response - */ - 200: Array; - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; - }; - }; - }; - '/api/v{api-version}/complex/{id}': { - put: { - req: ComplexParamsData; - res: { - /** - * Success - */ - 200: ModelWithString; - }; - }; - }; - '/api/v{api-version}/multipart': { - post: { - req: MultipartRequestData; - }; - get: { - res: { - /** - * OK - */ - 200: { - file?: (Blob | File); - metadata?: { - foo?: string; - bar?: string; - }; - }; - }; - }; - }; - '/api/v{api-version}/header': { - post: { - res: { - /** - * Successful response - */ - 200: string; - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; - }; - }; - }; - '/api/v{api-version}/error': { - post: { - req: TestErrorCodeData; - res: { - /** - * Custom message: Successful response - */ - 200: unknown; - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; - }; - }; - }; - '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串': { - post: { - req: NonAsciiæøåÆøÅöôêÊ字符串Data; - res: { - /** - * Successful response - */ - 200: Array; - }; - }; - put: { - req: PutWithFormUrlEncodedData; - }; - }; }; \ No newline at end of file diff --git a/packages/openapi-ts/test/__snapshots__/test/generated/v3_node_transform/types.gen.ts.snap b/packages/openapi-ts/test/__snapshots__/test/generated/v3_node_transform/types.gen.ts.snap index 55217bd5e..93ef80d54 100644 --- a/packages/openapi-ts/test/__snapshots__/test/generated/v3_node_transform/types.gen.ts.snap +++ b/packages/openapi-ts/test/__snapshots__/test/generated/v3_node_transform/types.gen.ts.snap @@ -46,75 +46,6 @@ export type DateResponse = Date; export type MultipleResponsesResponse = Array | Array; -export type $OpenApiTs = { - '/api/model-with-dates': { - post: { - res: { - /** - * Success - */ - 200: ParentModelWithDates; - /** - * Success - */ - 201: unknown; - }; - }; - put: { - res: { - /** - * Success - */ - 200: ModelWithDates; - }; - }; - }; - '/api/model-with-dates-array': { - put: { - res: { - /** - * Success - */ - 200: Array; - }; - }; - }; - '/api/array-of-dates': { - put: { - res: { - /** - * Success - */ - 200: Array<(Date)>; - }; - }; - }; - '/api/date': { - put: { - res: { - /** - * Success - */ - 200: Date; - }; - }; - }; - '/api/multiple-responses': { - put: { - res: { - /** - * Updated - */ - 200: Array; - /** - * Created - */ - 201: Array; - }; - }; - }; -}; - export type ParentModelWithDatesResponseTransformer = (data: any) => Promise; export type ParentModelWithDatesModelResponseTransformer = (data: any) => ParentModelWithDates; diff --git a/packages/openapi-ts/test/__snapshots__/test/generated/v3_options/types.gen.ts.snap b/packages/openapi-ts/test/__snapshots__/test/generated/v3_options/types.gen.ts.snap index c1e3e09f8..ab827ffa3 100644 --- a/packages/openapi-ts/test/__snapshots__/test/generated/v3_options/types.gen.ts.snap +++ b/packages/openapi-ts/test/__snapshots__/test/generated/v3_options/types.gen.ts.snap @@ -99,18 +99,4 @@ export type CallToTestOrderOfParamsData = { * This is a string with no default */ parameterStringWithNoDefault: string; -}; - -export type $OpenApiTs = { - '/api/v{api-version}/defaults': { - get: { - req: CallWithDefaultParametersData; - }; - post: { - req: CallWithDefaultOptionalParametersData; - }; - put: { - req: CallToTestOrderOfParamsData; - }; - }; }; \ No newline at end of file diff --git a/packages/openapi-ts/test/__snapshots__/test/generated/v3_services_name/types.gen.ts.snap b/packages/openapi-ts/test/__snapshots__/test/generated/v3_services_name/types.gen.ts.snap index d763700a3..5ebba4ab7 100644 --- a/packages/openapi-ts/test/__snapshots__/test/generated/v3_services_name/types.gen.ts.snap +++ b/packages/openapi-ts/test/__snapshots__/test/generated/v3_services_name/types.gen.ts.snap @@ -1156,50 +1156,4 @@ export type PostCallWithOptionalParamData = { }; }; -export type PostCallWithOptionalParamResponse = number | void; - -export type $OpenApiTs = { - '/api/v{api-version}/simple/$count': { - get: { - res: { - /** - * Success - */ - 200: Model_From_Zendesk; - }; - }; - }; - '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}': { - delete: { - req: DeleteFooData3; - }; - }; - '/api/v{api-version}/parameters/{parameterPath}': { - post: { - req: CallWithParametersData; - }; - }; - '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}': { - post: { - req: CallWithWeirdParameterNamesData; - }; - }; - '/api/v{api-version}/parameters/': { - get: { - req: GetCallWithOptionalParamData; - }; - post: { - req: PostCallWithOptionalParamData; - res: { - /** - * Response is a simple number - */ - 200: number; - /** - * Success - */ - 204: void; - }; - }; - }; -}; \ No newline at end of file +export type PostCallWithOptionalParamResponse = number | void; \ No newline at end of file diff --git a/packages/openapi-ts/test/__snapshots__/test/generated/v3_transform/types.gen.ts.snap b/packages/openapi-ts/test/__snapshots__/test/generated/v3_transform/types.gen.ts.snap index 55217bd5e..93ef80d54 100644 --- a/packages/openapi-ts/test/__snapshots__/test/generated/v3_transform/types.gen.ts.snap +++ b/packages/openapi-ts/test/__snapshots__/test/generated/v3_transform/types.gen.ts.snap @@ -46,75 +46,6 @@ export type DateResponse = Date; export type MultipleResponsesResponse = Array | Array; -export type $OpenApiTs = { - '/api/model-with-dates': { - post: { - res: { - /** - * Success - */ - 200: ParentModelWithDates; - /** - * Success - */ - 201: unknown; - }; - }; - put: { - res: { - /** - * Success - */ - 200: ModelWithDates; - }; - }; - }; - '/api/model-with-dates-array': { - put: { - res: { - /** - * Success - */ - 200: Array; - }; - }; - }; - '/api/array-of-dates': { - put: { - res: { - /** - * Success - */ - 200: Array<(Date)>; - }; - }; - }; - '/api/date': { - put: { - res: { - /** - * Success - */ - 200: Date; - }; - }; - }; - '/api/multiple-responses': { - put: { - res: { - /** - * Updated - */ - 200: Array; - /** - * Created - */ - 201: Array; - }; - }; - }; -}; - export type ParentModelWithDatesResponseTransformer = (data: any) => Promise; export type ParentModelWithDatesModelResponseTransformer = (data: any) => ParentModelWithDates; diff --git a/packages/openapi-ts/test/__snapshots__/test/generated/v3_tree_shakeable/types.gen.ts.snap b/packages/openapi-ts/test/__snapshots__/test/generated/v3_tree_shakeable/types.gen.ts.snap index cc5154eb9..68b7b79e9 100644 --- a/packages/openapi-ts/test/__snapshots__/test/generated/v3_tree_shakeable/types.gen.ts.snap +++ b/packages/openapi-ts/test/__snapshots__/test/generated/v3_tree_shakeable/types.gen.ts.snap @@ -1476,373 +1476,4 @@ export type NonAsciiæøåÆøÅöôêÊ字符串Response = Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; - }; - }; - }; - '/api/v{api-version}/collectionFormat': { - get: { - req: CollectionFormatData; - }; - }; - '/api/v{api-version}/types': { - get: { - req: TypesData; - res: { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; - }; - }; - }; - '/api/v{api-version}/upload': { - post: { - req: UploadFileData; - res: { - 200: boolean; - }; - }; - }; - '/api/v{api-version}/file/{id}': { - get: { - req: FileResponseData; - res: { - /** - * Success - */ - 200: (Blob | File); - }; - }; - }; - '/api/v{api-version}/complex': { - get: { - req: ComplexTypesData; - res: { - /** - * Successful response - */ - 200: Array; - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; - }; - }; - }; - '/api/v{api-version}/multipart': { - post: { - req: MultipartRequestData; - }; - get: { - res: { - /** - * OK - */ - 200: { - file?: (Blob | File); - metadata?: { - foo?: string; - bar?: string; - }; - }; - }; - }; - }; - '/api/v{api-version}/complex/{id}': { - put: { - req: ComplexParamsData; - res: { - /** - * Success - */ - 200: ModelWithString; - }; - }; - }; - '/api/v{api-version}/header': { - post: { - res: { - /** - * Successful response - */ - 200: string; - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; - }; - }; - }; - '/api/v{api-version}/error': { - post: { - req: TestErrorCodeData; - res: { - /** - * Custom message: Successful response - */ - 200: unknown; - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; - }; - }; - }; - '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串': { - post: { - req: NonAsciiæøåÆøÅöôêÊ字符串Data; - res: { - /** - * Successful response - */ - 200: Array; - }; - }; - put: { - req: PutWithFormUrlEncodedData; - }; - }; }; \ No newline at end of file diff --git a/packages/openapi-ts/test/__snapshots__/test/generated/v3_xhr/types.gen.ts.snap b/packages/openapi-ts/test/__snapshots__/test/generated/v3_xhr/types.gen.ts.snap index fe62233ab..54d54f45d 100644 --- a/packages/openapi-ts/test/__snapshots__/test/generated/v3_xhr/types.gen.ts.snap +++ b/packages/openapi-ts/test/__snapshots__/test/generated/v3_xhr/types.gen.ts.snap @@ -1476,373 +1476,4 @@ export type NonAsciiæøåÆøÅöôêÊ字符串Response = Array; - }; - /** - * Message for 201 response - */ - 201: ModelThatExtends; - /** - * Message for 202 response - */ - 202: ModelThatExtendsExtends; - /** - * Message for 500 error - */ - 500: ModelWithStringError; - /** - * Message for 501 error - */ - 501: ModelWithStringError; - /** - * Message for 502 error - */ - 502: ModelWithStringError; - /** - * Message for default response - */ - default: ModelWithStringError; - }; - }; - }; - '/api/v{api-version}/multiple-tags/a': { - get: { - res: { - 200: _400; - }; - }; - }; - '/api/v{api-version}/multiple-tags/b': { - get: { - res: { - /** - * Success - */ - 204: void; - }; - }; - }; - '/api/v{api-version}/collectionFormat': { - get: { - req: CollectionFormatData; - }; - }; - '/api/v{api-version}/types': { - get: { - req: TypesData; - res: { - /** - * Response is a simple number - */ - 200: number; - /** - * Response is a simple string - */ - 201: string; - /** - * Response is a simple boolean - */ - 202: boolean; - /** - * Response is a simple object - */ - 203: { - [key: string]: unknown; - }; - }; - }; - }; - '/api/v{api-version}/upload': { - post: { - req: UploadFileData; - res: { - 200: boolean; - }; - }; - }; - '/api/v{api-version}/file/{id}': { - get: { - req: FileResponseData; - res: { - /** - * Success - */ - 200: (Blob | File); - }; - }; - }; - '/api/v{api-version}/complex': { - get: { - req: ComplexTypesData; - res: { - /** - * Successful response - */ - 200: Array; - /** - * 400 `server` error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; - }; - }; - }; - '/api/v{api-version}/complex/{id}': { - put: { - req: ComplexParamsData; - res: { - /** - * Success - */ - 200: ModelWithString; - }; - }; - }; - '/api/v{api-version}/multipart': { - post: { - req: MultipartRequestData; - }; - get: { - res: { - /** - * OK - */ - 200: { - file?: (Blob | File); - metadata?: { - foo?: string; - bar?: string; - }; - }; - }; - }; - }; - '/api/v{api-version}/header': { - post: { - res: { - /** - * Successful response - */ - 200: string; - /** - * 400 server error - */ - 400: unknown; - /** - * 500 server error - */ - 500: unknown; - }; - }; - }; - '/api/v{api-version}/error': { - post: { - req: TestErrorCodeData; - res: { - /** - * Custom message: Successful response - */ - 200: unknown; - /** - * Custom message: Internal Server Error - */ - 500: unknown; - /** - * Custom message: Not Implemented - */ - 501: unknown; - /** - * Custom message: Bad Gateway - */ - 502: unknown; - /** - * Custom message: Service Unavailable - */ - 503: unknown; - }; - }; - }; - '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串': { - post: { - req: NonAsciiæøåÆøÅöôêÊ字符串Data; - res: { - /** - * Successful response - */ - 200: Array; - }; - }; - put: { - req: PutWithFormUrlEncodedData; - }; - }; }; \ No newline at end of file diff --git a/packages/openapi-ts/test/__snapshots__/test/generated/v3_xhr_transform/types.gen.ts.snap b/packages/openapi-ts/test/__snapshots__/test/generated/v3_xhr_transform/types.gen.ts.snap index 55217bd5e..93ef80d54 100644 --- a/packages/openapi-ts/test/__snapshots__/test/generated/v3_xhr_transform/types.gen.ts.snap +++ b/packages/openapi-ts/test/__snapshots__/test/generated/v3_xhr_transform/types.gen.ts.snap @@ -46,75 +46,6 @@ export type DateResponse = Date; export type MultipleResponsesResponse = Array | Array; -export type $OpenApiTs = { - '/api/model-with-dates': { - post: { - res: { - /** - * Success - */ - 200: ParentModelWithDates; - /** - * Success - */ - 201: unknown; - }; - }; - put: { - res: { - /** - * Success - */ - 200: ModelWithDates; - }; - }; - }; - '/api/model-with-dates-array': { - put: { - res: { - /** - * Success - */ - 200: Array; - }; - }; - }; - '/api/array-of-dates': { - put: { - res: { - /** - * Success - */ - 200: Array<(Date)>; - }; - }; - }; - '/api/date': { - put: { - res: { - /** - * Success - */ - 200: Date; - }; - }; - }; - '/api/multiple-responses': { - put: { - res: { - /** - * Updated - */ - 200: Array; - /** - * Created - */ - 201: Array; - }; - }; - }; -}; - export type ParentModelWithDatesResponseTransformer = (data: any) => Promise; export type ParentModelWithDatesModelResponseTransformer = (data: any) => ParentModelWithDates; diff --git a/packages/openapi-ts/test/sample.cjs b/packages/openapi-ts/test/sample.cjs index fa21ad397..88a4d8ff7 100644 --- a/packages/openapi-ts/test/sample.cjs +++ b/packages/openapi-ts/test/sample.cjs @@ -29,6 +29,7 @@ const main = async () => { export: false, }, services: { + export: false, // asClass: true, // filter: '^POST /api/v{api-version}/upload$', // export: false, @@ -40,8 +41,8 @@ const main = async () => { // export: false, // include: // '^(_400|CompositionWithOneOfAndProperties)', - name: 'PascalCase', - // tree: false, + // name: 'PascalCase', + tree: false, }, // useOptions: false, };