From f659b061ceef64ddad49fee15f2b79001e02a739 Mon Sep 17 00:00:00 2001 From: Lubos Date: Tue, 18 Nov 2025 06:03:59 +0800 Subject: [PATCH] refactor: client plugin use dsl --- dev/openapi-ts.config.ts | 8 +- .../src/client/client.gen.ts | 4 +- .../src/client/client.gen.ts | 4 +- .../src/client/client.gen.ts | 4 +- .../src/client/client.gen.ts | 4 +- .../common/default-class/client.gen.ts | 4 +- .../@angular/common/default/client.gen.ts | 4 +- .../sdk-nested-classes-instance/client.gen.ts | 4 +- .../sdk-nested-classes/client.gen.ts | 4 +- .../@hey-api/schemas/default/schemas.gen.ts | 621 ++++--- .../@hey-api/sdk/default/client.gen.ts | 4 +- .../@hey-api/sdk/throwOnError/client.gen.ts | 5 +- .../plugins/@pinia/colada/fetch/client.gen.ts | 4 +- .../axios/client.gen.ts | 4 +- .../fetch/client.gen.ts | 4 +- .../@tanstack/react-query/axios/client.gen.ts | 4 +- .../@tanstack/react-query/fetch/client.gen.ts | 4 +- .../@tanstack/solid-query/axios/client.gen.ts | 4 +- .../@tanstack/solid-query/fetch/client.gen.ts | 4 +- .../svelte-query/axios/client.gen.ts | 4 +- .../svelte-query/fetch/client.gen.ts | 4 +- .../@tanstack/vue-query/axios/client.gen.ts | 4 +- .../@tanstack/vue-query/fetch/client.gen.ts | 4 +- .../2.0.x/servers-base-path/client.gen.ts | 4 +- .../__snapshots__/2.0.x/servers/client.gen.ts | 4 +- .../common/default-class/client.gen.ts | 4 +- .../@angular/common/default/client.gen.ts | 4 +- .../sdk-nested-classes-instance/client.gen.ts | 4 +- .../sdk-nested-classes/client.gen.ts | 4 +- .../@hey-api/schemas/default/schemas.gen.ts | 1546 +++++++++------- .../@hey-api/sdk/default/client.gen.ts | 4 +- .../@hey-api/sdk/throwOnError/client.gen.ts | 5 +- .../plugins/@pinia/colada/fetch/client.gen.ts | 4 +- .../axios/client.gen.ts | 4 +- .../fetch/client.gen.ts | 4 +- .../@tanstack/react-query/axios/client.gen.ts | 4 +- .../@tanstack/react-query/fetch/client.gen.ts | 4 +- .../@tanstack/solid-query/axios/client.gen.ts | 4 +- .../@tanstack/solid-query/fetch/client.gen.ts | 4 +- .../svelte-query/axios/client.gen.ts | 4 +- .../svelte-query/fetch/client.gen.ts | 4 +- .../@tanstack/vue-query/axios/client.gen.ts | 4 +- .../@tanstack/vue-query/fetch/client.gen.ts | 4 +- .../__snapshots__/3.0.x/servers/client.gen.ts | 4 +- .../transformers-all-of/transformers.gen.ts | 8 +- .../transformers.gen.ts | 4 +- .../transformers.gen.ts | 8 +- .../base-url-number/client.gen.ts | 4 +- .../base-url-strict/client.gen.ts | 4 +- .../base-url-string/client.gen.ts | 4 +- .../client-angular/clean-false/client.gen.ts | 4 +- .../client-angular/default/client.gen.ts | 4 +- .../import-file-extension-ts/client.gen.ts | 4 +- .../sdk-client-optional/client.gen.ts | 4 +- .../sdk-client-required/client.gen.ts | 4 +- .../tsconfig-nodenext-sdk/client.gen.ts | 4 +- .../base-url-number/client.gen.ts | 4 +- .../base-url-strict/client.gen.ts | 4 +- .../base-url-string/client.gen.ts | 4 +- .../client-axios/clean-false/client.gen.ts | 4 +- .../client-axios/default/client.gen.ts | 4 +- .../import-file-extension-ts/client.gen.ts | 4 +- .../sdk-client-optional/client.gen.ts | 4 +- .../sdk-client-required/client.gen.ts | 4 +- .../tsconfig-nodenext-sdk/client.gen.ts | 4 +- .../base-url-number/client.gen.ts | 4 +- .../base-url-strict/client.gen.ts | 4 +- .../base-url-string/client.gen.ts | 4 +- .../client-fetch/clean-false/client.gen.ts | 4 +- .../client-fetch/default/client.gen.ts | 4 +- .../import-file-extension-ts/client.gen.ts | 4 +- .../sdk-client-optional/client.gen.ts | 4 +- .../sdk-client-required/client.gen.ts | 4 +- .../tsconfig-nodenext-sdk/client.gen.ts | 4 +- .../client-ky/base-url-number/client.gen.ts | 4 +- .../client-ky/base-url-strict/client.gen.ts | 4 +- .../client-ky/base-url-string/client.gen.ts | 4 +- .../client-ky/clean-false/client.gen.ts | 4 +- .../@hey-api/client-ky/default/client.gen.ts | 4 +- .../import-file-extension-ts/client.gen.ts | 4 +- .../sdk-client-optional/client.gen.ts | 4 +- .../sdk-client-required/client.gen.ts | 4 +- .../tsconfig-nodenext-sdk/client.gen.ts | 4 +- .../client-next/base-url-number/client.gen.ts | 4 +- .../client-next/base-url-strict/client.gen.ts | 4 +- .../client-next/base-url-string/client.gen.ts | 4 +- .../client-next/clean-false/client.gen.ts | 4 +- .../client-next/default/client.gen.ts | 4 +- .../import-file-extension-ts/client.gen.ts | 4 +- .../sdk-client-optional/client.gen.ts | 4 +- .../sdk-client-required/client.gen.ts | 4 +- .../tsconfig-nodenext-sdk/client.gen.ts | 4 +- .../client-nuxt/base-url-number/client.gen.ts | 4 +- .../client-nuxt/base-url-strict/client.gen.ts | 4 +- .../client-nuxt/base-url-string/client.gen.ts | 4 +- .../client-nuxt/clean-false/client.gen.ts | 4 +- .../client-nuxt/default/client.gen.ts | 4 +- .../import-file-extension-ts/client.gen.ts | 4 +- .../sdk-client-optional/client.gen.ts | 4 +- .../sdk-client-required/client.gen.ts | 4 +- .../tsconfig-nodenext-sdk/client.gen.ts | 4 +- .../base-url-number/client.gen.ts | 4 +- .../base-url-strict/client.gen.ts | 4 +- .../base-url-string/client.gen.ts | 4 +- .../client-ofetch/clean-false/client.gen.ts | 4 +- .../client-ofetch/default/client.gen.ts | 4 +- .../import-file-extension-ts/client.gen.ts | 4 +- .../sdk-client-optional/client.gen.ts | 4 +- .../sdk-client-required/client.gen.ts | 4 +- .../tsconfig-nodenext-sdk/client.gen.ts | 4 +- .../base-url-number/custom-client.gen.ts | 4 +- .../base-url-strict/custom-client.gen.ts | 4 +- .../base-url-string/custom-client.gen.ts | 4 +- .../client-custom/bundle/custom-client.gen.ts | 4 +- .../default/custom-client.gen.ts | 4 +- .../sdk-client-optional/custom-client.gen.ts | 4 +- .../sdk-client-required/custom-client.gen.ts | 4 +- .../my-client/base-url-number/custom.gen.ts | 4 +- .../my-client/base-url-strict/custom.gen.ts | 4 +- .../my-client/base-url-string/custom.gen.ts | 4 +- .../clients/my-client/bundle/custom.gen.ts | 4 +- .../clients/my-client/default/custom.gen.ts | 4 +- .../sdk-client-optional/custom.gen.ts | 4 +- .../sdk-client-required/custom.gen.ts | 4 +- .../common/default-class/client.gen.ts | 4 +- .../@angular/common/default/client.gen.ts | 4 +- .../@hey-api/schemas/default/schemas.gen.ts | 1619 ++++++++++------- .../@hey-api/sdk/default/client.gen.ts | 4 +- .../@hey-api/sdk/throwOnError/client.gen.ts | 5 +- .../plugins/@pinia/colada/fetch/client.gen.ts | 4 +- .../axios/client.gen.ts | 4 +- .../fetch/client.gen.ts | 4 +- .../@tanstack/react-query/axios/client.gen.ts | 4 +- .../@tanstack/react-query/fetch/client.gen.ts | 4 +- .../@tanstack/solid-query/axios/client.gen.ts | 4 +- .../@tanstack/solid-query/fetch/client.gen.ts | 4 +- .../svelte-query/axios/client.gen.ts | 4 +- .../svelte-query/fetch/client.gen.ts | 4 +- .../@tanstack/vue-query/axios/client.gen.ts | 4 +- .../@tanstack/vue-query/fetch/client.gen.ts | 4 +- .../__snapshots__/3.1.x/servers/client.gen.ts | 4 +- .../transformers-all-of/transformers.gen.ts | 8 +- .../transformers.gen.ts | 4 +- .../transformers.gen.ts | 8 +- .../plugins/@hey-api/client-core/client.ts | 62 +- .../client-core/createClientConfig.ts | 84 +- .../src/plugins/@hey-api/schemas/plugin.ts | 47 +- .../@hey-api/transformers/expressions.ts | 47 +- .../plugins/@hey-api/transformers/plugin.ts | 186 +- packages/openapi-ts/src/ts-dsl/array.ts | 7 +- packages/openapi-ts/src/ts-dsl/as.ts | 9 +- packages/openapi-ts/src/ts-dsl/attr.ts | 38 +- packages/openapi-ts/src/ts-dsl/base.ts | 6 +- packages/openapi-ts/src/ts-dsl/binary.ts | 7 +- packages/openapi-ts/src/ts-dsl/call.ts | 9 +- packages/openapi-ts/src/ts-dsl/class.ts | 2 +- packages/openapi-ts/src/ts-dsl/expr.ts | 18 +- packages/openapi-ts/src/ts-dsl/field.ts | 2 +- packages/openapi-ts/src/ts-dsl/func.ts | 5 +- packages/openapi-ts/src/ts-dsl/getter.ts | 2 +- packages/openapi-ts/src/ts-dsl/index.ts | 11 +- packages/openapi-ts/src/ts-dsl/init.ts | 2 +- packages/openapi-ts/src/ts-dsl/literal.ts | 6 + packages/openapi-ts/src/ts-dsl/method.ts | 2 +- .../openapi-ts/src/ts-dsl/mixins/apply.ts | 14 +- packages/openapi-ts/src/ts-dsl/mixins/as.ts | 24 + packages/openapi-ts/src/ts-dsl/mixins/doc.ts | 17 +- packages/openapi-ts/src/ts-dsl/mixins/expr.ts | 26 +- packages/openapi-ts/src/ts-dsl/mixins/hint.ts | 17 +- packages/openapi-ts/src/ts-dsl/mixins/note.ts | 17 +- .../openapi-ts/src/ts-dsl/mixins/type-expr.ts | 5 - packages/openapi-ts/src/ts-dsl/object.ts | 14 +- packages/openapi-ts/src/ts-dsl/setter.ts | 2 +- .../src/ts-dsl/{utils.ts => toExpr.ts} | 14 +- packages/openapi-ts/src/ts-dsl/toStmt.ts | 4 + packages/openapi-ts/src/ts-dsl/type/func.ts | 33 + packages/openapi-ts/src/ts-dsl/type/object.ts | 2 +- packages/openapi-ts/src/ts-dsl/var.ts | 4 +- 178 files changed, 2644 insertions(+), 2474 deletions(-) create mode 100644 packages/openapi-ts/src/ts-dsl/mixins/as.ts rename packages/openapi-ts/src/ts-dsl/{utils.ts => toExpr.ts} (65%) create mode 100644 packages/openapi-ts/src/ts-dsl/toStmt.ts create mode 100644 packages/openapi-ts/src/ts-dsl/type/func.ts diff --git a/dev/openapi-ts.config.ts b/dev/openapi-ts.config.ts index 4baf5c276f..d5f9042176 100644 --- a/dev/openapi-ts.config.ts +++ b/dev/openapi-ts.config.ts @@ -40,13 +40,13 @@ export default defineConfig(() => { // 'circular.yaml', // 'dutchie.json', // 'invalid', - 'full.yaml', + // 'full.yaml', // 'openai.yaml', // 'opencode.yaml', // 'pagination-ref.yaml', // 'sdk-instance.yaml', // 'string-with-format.yaml', - // 'transformers.json', + 'transformers.json', // 'type-format.yaml', // 'validators.yaml', // 'validators-circular-ref.json', @@ -216,7 +216,7 @@ export default defineConfig(() => { { // baseUrl: false, // exportFromIndex: true, - name: '@hey-api/client-nuxt', + name: '@hey-api/client-fetch', // runtimeConfigPath: path.resolve(__dirname, 'hey-api.ts'), // runtimeConfigPath: './src/hey-api.ts', // strictBaseUrl: true, @@ -292,7 +292,7 @@ export default defineConfig(() => { { // bigInt: true, dates: true, - // name: '@hey-api/transformers', + name: '@hey-api/transformers', }, { // name: 'fastify', diff --git a/examples/openapi-ts-fastify/src/client/client.gen.ts b/examples/openapi-ts-fastify/src/client/client.gen.ts index db8c989645..98b5a32f73 100644 --- a/examples/openapi-ts-fastify/src/client/client.gen.ts +++ b/examples/openapi-ts-fastify/src/client/client.gen.ts @@ -21,7 +21,5 @@ export type CreateClientConfig = ( ) => Config & T>; export const client = createClient( - createConfig({ - baseUrl: 'http://petstore.swagger.io/v1', - }), + createConfig({ baseUrl: 'http://petstore.swagger.io/v1' }), ); diff --git a/examples/openapi-ts-openai/src/client/client.gen.ts b/examples/openapi-ts-openai/src/client/client.gen.ts index 60a14f713b..9f59510951 100644 --- a/examples/openapi-ts-openai/src/client/client.gen.ts +++ b/examples/openapi-ts-openai/src/client/client.gen.ts @@ -21,7 +21,5 @@ export type CreateClientConfig = ( ) => Config & T>; export const client = createClient( - createConfig({ - baseUrl: 'https://api.openai.com/v1', - }), + createConfig({ baseUrl: 'https://api.openai.com/v1' }), ); diff --git a/examples/openapi-ts-pinia-colada/src/client/client.gen.ts b/examples/openapi-ts-pinia-colada/src/client/client.gen.ts index 3431b130d4..1d374e90be 100644 --- a/examples/openapi-ts-pinia-colada/src/client/client.gen.ts +++ b/examples/openapi-ts-pinia-colada/src/client/client.gen.ts @@ -16,7 +16,5 @@ export type CreateClientConfig = ( ) => Config & T> export const client = createClient( - createConfig({ - baseUrl: 'https://petstore3.swagger.io/api/v3' - }) + createConfig({ baseUrl: 'https://petstore3.swagger.io/api/v3' }) ) diff --git a/examples/openapi-ts-tanstack-vue-query/src/client/client.gen.ts b/examples/openapi-ts-tanstack-vue-query/src/client/client.gen.ts index 3431b130d4..1d374e90be 100644 --- a/examples/openapi-ts-tanstack-vue-query/src/client/client.gen.ts +++ b/examples/openapi-ts-tanstack-vue-query/src/client/client.gen.ts @@ -16,7 +16,5 @@ export type CreateClientConfig = ( ) => Config & T> export const client = createClient( - createConfig({ - baseUrl: 'https://petstore3.swagger.io/api/v3' - }) + createConfig({ baseUrl: 'https://petstore3.swagger.io/api/v3' }) ) diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@angular/common/default-class/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@angular/common/default-class/client.gen.ts index 6b55ac80f9..bf942100b1 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@angular/common/default-class/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@angular/common/default-class/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@angular/common/default/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@angular/common/default/client.gen.ts index 6b55ac80f9..bf942100b1 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@angular/common/default/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@angular/common/default/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/client-fetch/sdk-nested-classes-instance/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/client-fetch/sdk-nested-classes-instance/client.gen.ts index 7f92a6b239..8c4b791ee7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/client-fetch/sdk-nested-classes-instance/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/client-fetch/sdk-nested-classes-instance/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'https://api.example.com/v1' -})); +export const client = createClient(createConfig({ baseUrl: "https://api.example.com/v1" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/client-fetch/sdk-nested-classes/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/client-fetch/sdk-nested-classes/client.gen.ts index 7f92a6b239..8c4b791ee7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/client-fetch/sdk-nested-classes/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/client-fetch/sdk-nested-classes/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'https://api.example.com/v1' -})); +export const client = createClient(createConfig({ baseUrl: "https://api.example.com/v1" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/schemas/default/schemas.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/schemas/default/schemas.gen.ts index a30065bdd2..ba63bd7c10 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/schemas/default/schemas.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/schemas/default/schemas.gen.ts @@ -1,477 +1,542 @@ // This file is auto-generated by @hey-api/openapi-ts export const ExternalRefASchema = { - description: 'External ref to shared model (A)', - '$ref': '#/definitions/external-shared_ExternalSharedModel' + description: "External ref to shared model (A)", + '$ref': "#/definitions/external-shared_ExternalSharedModel" } as const; export const ExternalRefBSchema = { - description: 'External ref to shared model (B)', - '$ref': '#/definitions/external-shared_ExternalSharedModel' + description: "External ref to shared model (B)", + '$ref': "#/definitions/external-shared_ExternalSharedModel" } as const; export const CommentWithBreaksSchema = { - description: `Testing multiline comments in string: First line -Second line - -Fourth line`, - type: 'integer' + description: "Testing multiline comments in string: First line\nSecond line\n\nFourth line", + type: "integer" } as const; export const CommentWithBackticksSchema = { - description: 'Testing backticks in string: `backticks` and ```multiple backticks``` should work', - type: 'integer' + description: "Testing backticks in string: `backticks` and ```multiple backticks``` should work", + type: "integer" } as const; export const CommentWithBackticksAndQuotesSchema = { - description: `Testing backticks and quotes in string: \`backticks\`, 'quotes', "double quotes" and \`\`\`multiple backticks\`\`\` should work`, - type: 'integer' + description: "Testing backticks and quotes in string: `backticks`, 'quotes', \"double quotes\" and ```multiple backticks``` should work", + type: "integer" } as const; export const CommentWithSlashesSchema = { - description: 'Testing slashes in string: \\backwards\\\\\\ and /forwards/// should work', - type: 'integer' + description: "Testing slashes in string: \\backwards\\\\\\ and /forwards/// should work", + type: "integer" } as const; export const CommentWithExpressionPlaceholdersSchema = { - description: 'Testing expression placeholders in string: ${expression} should work', - type: 'integer' + description: "Testing expression placeholders in string: ${expression} should work", + type: "integer" } as const; export const CommentWithQuotesSchema = { - description: `Testing quotes in string: 'single quote''' and "double quotes""" should work`, - type: 'integer' + description: "Testing quotes in string: 'single quote''' and \"double quotes\"\"\" should work", + type: "integer" } as const; export const CommentWithReservedCharactersSchema = { - description: 'Testing reserved characters in string: /* inline */ and /** inline **/ should work', - type: 'integer' + description: "Testing reserved characters in string: /* inline */ and /** inline **/ should work", + type: "integer" } as const; export const SimpleIntegerSchema = { - description: 'This is a simple number', - type: 'integer' + description: "This is a simple number", + type: "integer" } as const; export const SimpleBooleanSchema = { - description: 'This is a simple boolean', - type: 'boolean' + description: "This is a simple boolean", + type: "boolean" } as const; export const SimpleStringSchema = { - description: 'This is a simple string', - type: 'string' + description: "This is a simple string", + type: "string" } as const; export const NonAsciiStringæøåÆØÅöôêÊ字符串Schema = { - description: 'A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串)', - type: 'string' + description: "A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串)", + type: "string" } as const; export const SimpleFileSchema = { - description: 'This is a simple file', - format: 'binary', - type: 'string' + description: "This is a simple file", + format: "binary", + type: "string" } as const; export const SimpleReferenceSchema = { - description: 'This is a simple reference', - '$ref': '#/definitions/ModelWithString' + description: "This is a simple reference", + '$ref': "#/definitions/ModelWithString" } as const; export const SimpleStringWithPatternSchema = { - description: 'This is a simple string', - type: 'string', + description: "This is a simple string", + type: "string", maxLength: 64, - pattern: '^[a-zA-Z0-9_]*$' + pattern: "^[a-zA-Z0-9_]*$" } as const; export const EnumWithStringsSchema = { - description: 'This is a simple enum with strings', - enum: ['Success', 'Warning', 'Error', "'Single Quote'", '"Double Quotes"', 'Non-ascii: øæåôöØÆÅÔÖ字符串'] + description: "This is a simple enum with strings", + enum: [ + "Success", + "Warning", + "Error", + "'Single Quote'", + "\"Double Quotes\"", + "Non-ascii: øæåôöØÆÅÔÖ字符串" + ] } as const; export const EnumWithNumbersSchema = { - description: 'This is a simple enum with numbers', - enum: [1, 2, 3, 1.1, 1.2, 1.3, 100, 200, 300, -100, -200, -300, -1.1, -1.2, -1.3] + description: "This is a simple enum with numbers", + enum: [ + 1, + 2, + 3, + 1.1, + 1.2, + 1.3, + 100, + 200, + 300, + -100, + -200, + -300, + -1.1, + -1.2, + -1.3 + ] } as const; export const EnumFromDescriptionSchema = { - description: 'Success=1,Warning=2,Error=3', - type: 'number' + description: "Success=1,Warning=2,Error=3", + type: "number" } as const; export const EnumWithExtensionsSchema = { - description: 'This is a simple enum with numbers', - enum: [200, 400, 500], - 'x-enum-varnames': ['CUSTOM_SUCCESS', 'CUSTOM_WARNING', 'CUSTOM_ERROR'], - 'x-enum-descriptions': ['Used when the status of something is successful', 'Used when the status of something has a warning', 'Used when the status of something has an error'] + description: "This is a simple enum with numbers", + enum: [ + 200, + 400, + 500 + ], + 'x-enum-varnames': [ + "CUSTOM_SUCCESS", + "CUSTOM_WARNING", + "CUSTOM_ERROR" + ], + 'x-enum-descriptions': [ + "Used when the status of something is successful", + "Used when the status of something has a warning", + "Used when the status of something has an error" + ] } as const; export const ArrayWithNumbersSchema = { - description: 'This is a simple array with numbers', - type: 'array', + description: "This is a simple array with numbers", + type: "array", items: { - type: 'integer' + type: "integer" } } as const; export const ArrayWithBooleansSchema = { - description: 'This is a simple array with booleans', - type: 'array', + description: "This is a simple array with booleans", + type: "array", items: { - type: 'boolean' + type: "boolean" } } as const; export const ArrayWithStringsSchema = { - description: 'This is a simple array with strings', - type: 'array', + description: "This is a simple array with strings", + type: "array", items: { - type: 'string' + type: "string" } } as const; export const ArrayWithReferencesSchema = { - description: 'This is a simple array with references', - type: 'array', + description: "This is a simple array with references", + type: "array", items: { - '$ref': '#/definitions/ModelWithString' + '$ref': "#/definitions/ModelWithString" } } as const; export const ArrayWithArraySchema = { - description: 'This is a simple array containing an array', - type: 'array', + description: "This is a simple array containing an array", + type: "array", items: { - type: 'array', + type: "array", items: { - '$ref': '#/definitions/ModelWithString' + '$ref': "#/definitions/ModelWithString" } } } as const; export const ArrayWithPropertiesSchema = { - description: 'This is a simple array with properties', - type: 'array', + description: "This is a simple array with properties", + type: "array", items: { - type: 'object', + type: "object", properties: { foo: { - type: 'string' + type: "string" }, bar: { - type: 'string' + type: "string" } } } } as const; export const DictionaryWithStringSchema = { - description: 'This is a string dictionary', - type: 'object', + description: "This is a string dictionary", + type: "object", additionalProperties: { - type: 'string' + type: "string" } } as const; export const DictionaryWithReferenceSchema = { - description: 'This is a string reference', - type: 'object', + description: "This is a string reference", + type: "object", additionalProperties: { - '$ref': '#/definitions/ModelWithString' + '$ref': "#/definitions/ModelWithString" } } as const; export const DictionaryWithArraySchema = { - description: 'This is a complex dictionary', - type: 'object', + description: "This is a complex dictionary", + type: "object", additionalProperties: { - type: 'array', + type: "array", items: { - '$ref': '#/definitions/ModelWithString' + '$ref': "#/definitions/ModelWithString" } } } as const; export const DictionaryWithDictionarySchema = { - description: 'This is a string dictionary', - type: 'object', + description: "This is a string dictionary", + type: "object", additionalProperties: { - type: 'object', + type: "object", additionalProperties: { - type: 'string' + type: "string" } } } as const; export const DictionaryWithPropertiesSchema = { - description: 'This is a complex dictionary', - type: 'object', + description: "This is a complex dictionary", + type: "object", additionalProperties: { - type: 'object', + type: "object", properties: { foo: { - type: 'string' + type: "string" }, bar: { - type: 'string' + type: "string" } } } } as const; export const DateSchema = { - description: 'This is a type-only model that defines Date as a string', - type: 'string' + description: "This is a type-only model that defines Date as a string", + type: "string" } as const; export const ModelWithIntegerSchema = { - description: 'This is a model with one number property', - type: 'object', + description: "This is a model with one number property", + type: "object", properties: { prop: { - description: 'This is a simple number property', - type: 'integer' + description: "This is a simple number property", + type: "integer" } } } as const; export const ModelWithBooleanSchema = { - description: 'This is a model with one boolean property', - type: 'object', + description: "This is a model with one boolean property", + type: "object", properties: { prop: { - description: 'This is a simple boolean property', - type: 'boolean' + description: "This is a simple boolean property", + type: "boolean" } } } as const; export const ModelWithStringSchema = { - description: 'This is a model with one string property', - type: 'object', + description: "This is a model with one string property", + type: "object", properties: { prop: { - description: 'This is a simple string property', - type: 'string' + description: "This is a simple string property", + type: "string" } } } as const; export const ModelWithStringErrorSchema = { - description: 'This is a model with one string property', - type: 'object', + description: "This is a model with one string property", + type: "object", properties: { prop: { - description: 'This is a simple string property', - type: 'string' + description: "This is a simple string property", + type: "string" } } } as const; export const ModelWithNullableStringSchema = { - description: 'This is a model with one string property', - type: 'object', - required: ['nullableRequiredProp'], + description: "This is a model with one string property", + type: "object", + required: [ + "nullableRequiredProp" + ], properties: { nullableProp: { - description: 'This is a simple string property', - type: 'string', + description: "This is a simple string property", + type: "string", 'x-nullable': true }, nullableRequiredProp: { - description: 'This is a simple string property', - type: 'string', + description: "This is a simple string property", + type: "string", 'x-nullable': true } } } as const; export const ModelWithEnumSchema = { - description: 'This is a model with one enum', - type: 'object', + description: "This is a model with one enum", + type: "object", properties: { test: { - description: 'This is a simple enum with strings', - enum: ['Success', 'Warning', 'Error', 'ØÆÅ字符串'] + description: "This is a simple enum with strings", + enum: [ + "Success", + "Warning", + "Error", + "ØÆÅ字符串" + ] }, statusCode: { - description: 'These are the HTTP error code enums', - enum: ['100', '200 FOO', '300 FOO_BAR', '400 foo-bar', '500 foo.bar', '600 foo&bar'] + description: "These are the HTTP error code enums", + enum: [ + "100", + "200 FOO", + "300 FOO_BAR", + "400 foo-bar", + "500 foo.bar", + "600 foo&bar" + ] }, bool: { - description: 'Simple boolean enum', - type: 'boolean', - enum: [true] + description: "Simple boolean enum", + type: "boolean", + enum: [ + true + ] } } } as const; export const ModelWithEnumFromDescriptionSchema = { - description: 'This is a model with one enum', - type: 'object', + description: "This is a model with one enum", + type: "object", properties: { test: { - type: 'integer', - description: 'Success=1,Warning=2,Error=3' + type: "integer", + description: "Success=1,Warning=2,Error=3" } } } as const; export const ModelWithNestedEnumsSchema = { - description: 'This is a model with nested enums', - type: 'object', + description: "This is a model with nested enums", + type: "object", properties: { dictionaryWithEnum: { - type: 'object', + type: "object", additionalProperties: { - enum: ['Success', 'Warning', 'Error'] + enum: [ + "Success", + "Warning", + "Error" + ] } }, dictionaryWithEnumFromDescription: { - type: 'object', + type: "object", additionalProperties: { - type: 'integer', - description: 'Success=1,Warning=2,Error=3' + type: "integer", + description: "Success=1,Warning=2,Error=3" } }, arrayWithEnum: { - type: 'array', + type: "array", items: { - enum: ['Success', 'Warning', 'Error'] + enum: [ + "Success", + "Warning", + "Error" + ] } }, arrayWithDescription: { - type: 'array', + type: "array", items: { - type: 'integer', - description: 'Success=1,Warning=2,Error=3' + type: "integer", + description: "Success=1,Warning=2,Error=3" } } } } as const; export const ModelWithReferenceSchema = { - description: 'This is a model with one property containing a reference', - type: 'object', + description: "This is a model with one property containing a reference", + type: "object", properties: { prop: { - '$ref': '#/definitions/ModelWithProperties' + '$ref': "#/definitions/ModelWithProperties" } } } as const; export const ModelWithArraySchema = { - description: 'This is a model with one property containing an array', - type: 'object', + description: "This is a model with one property containing an array", + type: "object", properties: { prop: { - type: 'array', + type: "array", items: { - '$ref': '#/definitions/ModelWithString' + '$ref': "#/definitions/ModelWithString" } }, propWithFile: { - type: 'array', + type: "array", items: { - format: 'binary', - type: 'string' + format: "binary", + type: "string" } }, propWithNumber: { - type: 'array', + type: "array", items: { - type: 'number' + type: "number" } } } } as const; export const ModelWithDictionarySchema = { - description: 'This is a model with one property containing a dictionary', - type: 'object', + description: "This is a model with one property containing a dictionary", + type: "object", properties: { prop: { - type: 'object', + type: "object", additionalProperties: { - type: 'string' + type: "string" } } } } as const; export const ModelWithCircularReferenceSchema = { - description: 'This is a model with one property containing a circular reference', - type: 'object', + description: "This is a model with one property containing a circular reference", + type: "object", properties: { prop: { - '$ref': '#/definitions/ModelWithCircularReference' + '$ref': "#/definitions/ModelWithCircularReference" } } } as const; export const ModelWithPropertiesSchema = { - description: 'This is a model with one nested property', - type: 'object', - required: ['required', 'requiredAndReadOnly'], + description: "This is a model with one nested property", + type: "object", + required: [ + "required", + "requiredAndReadOnly" + ], properties: { required: { - type: 'string' + type: "string" }, requiredAndReadOnly: { - type: 'string', + type: "string", readOnly: true }, string: { - type: 'string' + type: "string" }, number: { - type: 'number' + type: "number" }, boolean: { - type: 'boolean' + type: "boolean" }, reference: { - '$ref': '#/definitions/ModelWithString' + '$ref': "#/definitions/ModelWithString" }, 'property with space': { - type: 'string' + type: "string" }, default: { - type: 'string' + type: "string" }, try: { - type: 'string' + type: "string" }, '@namespace.string': { - type: 'string', + type: "string", readOnly: true }, '@namespace.integer': { - type: 'integer', + type: "integer", readOnly: true } } } as const; export const ModelWithNestedPropertiesSchema = { - description: 'This is a model with one nested property', - type: 'object', - required: ['first'], + description: "This is a model with one nested property", + type: "object", + required: [ + "first" + ], properties: { first: { - type: 'object', - required: ['second'], + type: "object", + required: [ + "second" + ], readOnly: true, properties: { second: { - type: 'object', - required: ['third'], + type: "object", + required: [ + "third" + ], readOnly: true, properties: { third: { - type: 'string', + type: "string", readOnly: true } } @@ -482,62 +547,62 @@ export const ModelWithNestedPropertiesSchema = { } as const; export const ModelWithDuplicatePropertiesSchema = { - description: 'This is a model with duplicated properties', - type: 'object', + description: "This is a model with duplicated properties", + type: "object", properties: { prop: { - '$ref': '#/definitions/ModelWithString' + '$ref': "#/definitions/ModelWithString" } } } as const; export const ModelWithOrderedPropertiesSchema = { - description: 'This is a model with ordered properties', - type: 'object', + description: "This is a model with ordered properties", + type: "object", properties: { zebra: { - type: 'string' + type: "string" }, apple: { - type: 'string' + type: "string" }, hawaii: { - type: 'string' + type: "string" } } } as const; export const ModelWithDuplicateImportsSchema = { - description: 'This is a model with duplicated imports', - type: 'object', + description: "This is a model with duplicated imports", + type: "object", properties: { propA: { - '$ref': '#/definitions/ModelWithString' + '$ref': "#/definitions/ModelWithString" }, propB: { - '$ref': '#/definitions/ModelWithString' + '$ref': "#/definitions/ModelWithString" }, propC: { - '$ref': '#/definitions/ModelWithString' + '$ref': "#/definitions/ModelWithString" } } } as const; export const ModelThatExtendsSchema = { - description: 'This is a model that extends another model', - type: 'object', + description: "This is a model that extends another model", + type: "object", allOf: [ { - '$ref': '#/definitions/ModelWithString' + '$ref': "#/definitions/ModelWithString" }, { - type: 'object', + type: "object", properties: { propExtendsA: { - type: 'string' + type: "string" }, propExtendsB: { - '$ref': '#/definitions/ModelWithString' + '$ref': "#/definitions/ModelWithString" } } } @@ -545,23 +610,23 @@ export const ModelThatExtendsSchema = { } as const; export const ModelThatExtendsExtendsSchema = { - description: 'This is a model that extends another model', - type: 'object', + description: "This is a model that extends another model", + type: "object", allOf: [ { - '$ref': '#/definitions/ModelWithString' + '$ref': "#/definitions/ModelWithString" }, { - '$ref': '#/definitions/ModelThatExtends' + '$ref': "#/definitions/ModelThatExtends" }, { - type: 'object', + type: "object", properties: { propExtendsC: { - type: 'string' + type: "string" }, propExtendsD: { - '$ref': '#/definitions/ModelWithString' + '$ref': "#/definitions/ModelWithString" } } } @@ -569,205 +634,215 @@ export const ModelThatExtendsExtendsSchema = { } as const; export const defaultSchema = { - type: 'object', + type: "object", properties: { name: { - type: 'string' + type: "string" } } } as const; export const ModelWithPatternSchema = { - description: 'This is a model that contains a some patterns', - type: 'object', - required: ['key', 'name'], + description: "This is a model that contains a some patterns", + type: "object", + required: [ + "key", + "name" + ], properties: { key: { maxLength: 64, - pattern: '^[a-zA-Z0-9_]*$', - type: 'string' + pattern: "^[a-zA-Z0-9_]*$", + type: "string" }, name: { maxLength: 255, - type: 'string' + type: "string" }, enabled: { - type: 'boolean', + type: "boolean", readOnly: true }, modified: { - type: 'string', - format: 'date-time', + type: "string", + format: "date-time", readOnly: true }, id: { - type: 'string', - pattern: '^\\d{2}-\\d{3}-\\d{4}$' + type: "string", + pattern: "^\\d{2}-\\d{3}-\\d{4}$" }, text: { - type: 'string', - pattern: '^\\w+$' + type: "string", + pattern: "^\\w+$" }, patternWithSingleQuotes: { - type: 'string', + type: "string", pattern: "^[a-zA-Z0-9']*$" }, patternWithNewline: { - type: 'string', - pattern: 'aaa\\nbbb' + type: "string", + pattern: "aaa\\nbbb" }, patternWithBacktick: { - type: 'string', - pattern: 'aaa`bbb' + type: "string", + pattern: "aaa`bbb" } } } as const; export const parameter_ActivityParamsSchema = { - type: 'object', + type: "object", properties: { description: { - type: 'string' + type: "string" }, graduate_id: { - type: 'integer' + type: "integer" }, organization_id: { - type: 'integer' + type: "integer" }, parent_activity: { - type: 'integer' + type: "integer" }, post_id: { - type: 'integer' + type: "integer" } } } as const; export const response_PostActivityResponseSchema = { - type: 'object', + type: "object", properties: { description: { - type: 'string' + type: "string" }, graduate_id: { - type: 'integer' + type: "integer" }, organization_id: { - type: 'integer' + type: "integer" }, parent_activity_id: { - type: 'integer' + type: "integer" }, post_id: { - type: 'integer' + type: "integer" } } } as const; export const failure_FailureSchema = { - type: 'object', + type: "object", properties: { error: { - type: 'string' + type: "string" }, message: { - type: 'string' + type: "string" }, reference_code: { - type: 'string' + type: "string" } } } as const; export const external_shared_ExternalSharedModelSchema = { - type: 'object', + type: "object", properties: { id: { - type: 'string' + type: "string" }, name: { - type: 'string' + type: "string" } }, - required: ['id'] + required: [ + "id" + ] } as const; export const ModelWithReferenceWritableSchema = { - description: 'This is a model with one property containing a reference', - type: 'object', + description: "This is a model with one property containing a reference", + type: "object", properties: { prop: { - '$ref': '#/definitions/ModelWithPropertiesWritable' + '$ref': "#/definitions/ModelWithPropertiesWritable" } } } as const; export const ModelWithPropertiesWritableSchema = { - description: 'This is a model with one nested property', - type: 'object', - required: ['required'], + description: "This is a model with one nested property", + type: "object", + required: [ + "required" + ], properties: { required: { - type: 'string' + type: "string" }, string: { - type: 'string' + type: "string" }, number: { - type: 'number' + type: "number" }, boolean: { - type: 'boolean' + type: "boolean" }, reference: { - '$ref': '#/definitions/ModelWithString' + '$ref': "#/definitions/ModelWithString" }, 'property with space': { - type: 'string' + type: "string" }, default: { - type: 'string' + type: "string" }, try: { - type: 'string' + type: "string" } } } as const; export const ModelWithPatternWritableSchema = { - description: 'This is a model that contains a some patterns', - type: 'object', - required: ['key', 'name'], + description: "This is a model that contains a some patterns", + type: "object", + required: [ + "key", + "name" + ], properties: { key: { maxLength: 64, - pattern: '^[a-zA-Z0-9_]*$', - type: 'string' + pattern: "^[a-zA-Z0-9_]*$", + type: "string" }, name: { maxLength: 255, - type: 'string' + type: "string" }, id: { - type: 'string', - pattern: '^\\d{2}-\\d{3}-\\d{4}$' + type: "string", + pattern: "^\\d{2}-\\d{3}-\\d{4}$" }, text: { - type: 'string', - pattern: '^\\w+$' + type: "string", + pattern: "^\\w+$" }, patternWithSingleQuotes: { - type: 'string', + type: "string", pattern: "^[a-zA-Z0-9']*$" }, patternWithNewline: { - type: 'string', - pattern: 'aaa\\nbbb' + type: "string", + pattern: "aaa\\nbbb" }, patternWithBacktick: { - type: 'string', - pattern: 'aaa`bbb' + type: "string", + pattern: "aaa`bbb" } } } as const; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/sdk/default/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/sdk/default/client.gen.ts index 6b55ac80f9..bf942100b1 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/sdk/default/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/sdk/default/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/sdk/throwOnError/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/sdk/throwOnError/client.gen.ts index 778e50856f..a789b61b80 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/sdk/throwOnError/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/sdk/throwOnError/client.gen.ts @@ -13,7 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base', - throwOnError: true -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base", throwOnError: true })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@pinia/colada/fetch/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@pinia/colada/fetch/client.gen.ts index 6b55ac80f9..bf942100b1 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@pinia/colada/fetch/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@pinia/colada/fetch/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/angular-query-experimental/axios/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/angular-query-experimental/axios/client.gen.ts index 27214c60f4..0bce44d4c2 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/angular-query-experimental/axios/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/angular-query-experimental/axios/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseURL: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseURL: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/angular-query-experimental/fetch/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/angular-query-experimental/fetch/client.gen.ts index 6b55ac80f9..bf942100b1 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/angular-query-experimental/fetch/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/angular-query-experimental/fetch/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/react-query/axios/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/react-query/axios/client.gen.ts index 27214c60f4..0bce44d4c2 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/react-query/axios/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/react-query/axios/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseURL: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseURL: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/react-query/fetch/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/react-query/fetch/client.gen.ts index 6b55ac80f9..bf942100b1 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/react-query/fetch/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/react-query/fetch/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/solid-query/axios/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/solid-query/axios/client.gen.ts index 27214c60f4..0bce44d4c2 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/solid-query/axios/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/solid-query/axios/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseURL: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseURL: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/solid-query/fetch/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/solid-query/fetch/client.gen.ts index 6b55ac80f9..bf942100b1 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/solid-query/fetch/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/solid-query/fetch/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/svelte-query/axios/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/svelte-query/axios/client.gen.ts index 27214c60f4..0bce44d4c2 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/svelte-query/axios/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/svelte-query/axios/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseURL: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseURL: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/svelte-query/fetch/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/svelte-query/fetch/client.gen.ts index 6b55ac80f9..bf942100b1 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/svelte-query/fetch/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/svelte-query/fetch/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/vue-query/axios/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/vue-query/axios/client.gen.ts index 27214c60f4..0bce44d4c2 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/vue-query/axios/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/vue-query/axios/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseURL: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseURL: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/vue-query/fetch/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/vue-query/fetch/client.gen.ts index 6b55ac80f9..bf942100b1 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/vue-query/fetch/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/vue-query/fetch/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/servers-base-path/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/servers-base-path/client.gen.ts index aadb5db4ac..40ff0c07c3 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/servers-base-path/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/servers-base-path/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: '/v1' -})); +export const client = createClient(createConfig({ baseUrl: "/v1" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/servers/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/servers/client.gen.ts index fd7b9d4cce..6b69288b55 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/servers/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/servers/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'https://foo.com/v1' -})); +export const client = createClient(createConfig({ baseUrl: "https://foo.com/v1" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@angular/common/default-class/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@angular/common/default-class/client.gen.ts index 6b55ac80f9..bf942100b1 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@angular/common/default-class/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@angular/common/default-class/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@angular/common/default/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@angular/common/default/client.gen.ts index 6b55ac80f9..bf942100b1 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@angular/common/default/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@angular/common/default/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/client-fetch/sdk-nested-classes-instance/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/client-fetch/sdk-nested-classes-instance/client.gen.ts index 7f92a6b239..8c4b791ee7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/client-fetch/sdk-nested-classes-instance/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/client-fetch/sdk-nested-classes-instance/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'https://api.example.com/v1' -})); +export const client = createClient(createConfig({ baseUrl: "https://api.example.com/v1" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/client-fetch/sdk-nested-classes/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/client-fetch/sdk-nested-classes/client.gen.ts index 7f92a6b239..8c4b791ee7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/client-fetch/sdk-nested-classes/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/client-fetch/sdk-nested-classes/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'https://api.example.com/v1' -})); +export const client = createClient(createConfig({ baseUrl: "https://api.example.com/v1" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/schemas/default/schemas.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/schemas/default/schemas.gen.ts index c4f981ac00..1e9018cc2d 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/schemas/default/schemas.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/schemas/default/schemas.gen.ts @@ -1,221 +1,266 @@ // This file is auto-generated by @hey-api/openapi-ts export const _400Schema = { - description: 'Model with number-only name', - type: 'string' + description: "Model with number-only name", + type: "string" } as const; export const ExternalRefASchema = { - description: 'External ref to shared model (A)', - '$ref': '#/components/schemas/external-shared_ExternalSharedModel' + description: "External ref to shared model (A)", + '$ref': "#/components/schemas/external-shared_ExternalSharedModel" } as const; export const ExternalRefBSchema = { - description: 'External ref to shared model (B)', - '$ref': '#/components/schemas/external-shared_ExternalSharedModel' + description: "External ref to shared model (B)", + '$ref': "#/components/schemas/external-shared_ExternalSharedModel" } as const; export const camelCaseCommentWithBreaksSchema = { - description: `Testing multiline comments in string: First line -Second line - -Fourth line`, - type: 'integer' + description: "Testing multiline comments in string: First line\nSecond line\n\nFourth line", + type: "integer" } as const; export const CommentWithBreaksSchema = { - description: `Testing multiline comments in string: First line -Second line - -Fourth line`, - type: 'integer' + description: "Testing multiline comments in string: First line\nSecond line\n\nFourth line", + type: "integer" } as const; export const CommentWithBackticksSchema = { - description: 'Testing backticks in string: `backticks` and ```multiple backticks``` should work', - type: 'integer' + description: "Testing backticks in string: `backticks` and ```multiple backticks``` should work", + type: "integer" } as const; export const CommentWithBackticksAndQuotesSchema = { - description: `Testing backticks and quotes in string: \`backticks\`, 'quotes', "double quotes" and \`\`\`multiple backticks\`\`\` should work`, - type: 'integer' + description: "Testing backticks and quotes in string: `backticks`, 'quotes', \"double quotes\" and ```multiple backticks``` should work", + type: "integer" } as const; export const CommentWithSlashesSchema = { - description: 'Testing slashes in string: \\backwards\\\\\\ and /forwards/// should work', - type: 'integer' + description: "Testing slashes in string: \\backwards\\\\\\ and /forwards/// should work", + type: "integer" } as const; export const CommentWithExpressionPlaceholdersSchema = { - description: 'Testing expression placeholders in string: ${expression} should work', - type: 'integer' + description: "Testing expression placeholders in string: ${expression} should work", + type: "integer" } as const; export const CommentWithQuotesSchema = { - description: `Testing quotes in string: 'single quote''' and "double quotes""" should work`, - type: 'integer' + description: "Testing quotes in string: 'single quote''' and \"double quotes\"\"\" should work", + type: "integer" } as const; export const CommentWithReservedCharactersSchema = { - description: 'Testing reserved characters in string: /* inline */ and /** inline **/ should work', - type: 'integer' + description: "Testing reserved characters in string: /* inline */ and /** inline **/ should work", + type: "integer" } as const; export const SimpleIntegerSchema = { - description: 'This is a simple number', - type: 'integer' + description: "This is a simple number", + type: "integer" } as const; export const SimpleBooleanSchema = { - description: 'This is a simple boolean', - type: 'boolean' + description: "This is a simple boolean", + type: "boolean" } as const; export const SimpleStringSchema = { - description: 'This is a simple string', - type: 'string' + description: "This is a simple string", + type: "string" } as const; export const NonAsciiStringæøåÆØÅöôêÊ字符串Schema = { - description: 'A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串)', - type: 'string' + description: "A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串)", + type: "string" } as const; export const SimpleFileSchema = { - description: 'This is a simple file', - format: 'binary', - type: 'string' + description: "This is a simple file", + format: "binary", + type: "string" } as const; export const SimpleReferenceSchema = { - description: 'This is a simple reference', + description: "This is a simple reference", allOf: [ { - '$ref': '#/components/schemas/ModelWithString' + '$ref': "#/components/schemas/ModelWithString" } ] } as const; export const SimpleStringWithPatternSchema = { - description: 'This is a simple string', - type: 'string', + description: "This is a simple string", + type: "string", nullable: true, maxLength: 64, - pattern: '^[a-zA-Z0-9_]*$' + pattern: "^[a-zA-Z0-9_]*$" } as const; export const EnumWithStringsSchema = { - description: 'This is a simple enum with strings', - enum: ['Success', 'Warning', 'Error', "'Single Quote'", '"Double Quotes"', 'Non-ascii: øæåôöØÆÅÔÖ字符串'] + description: "This is a simple enum with strings", + enum: [ + "Success", + "Warning", + "Error", + "'Single Quote'", + "\"Double Quotes\"", + "Non-ascii: øæåôöØÆÅÔÖ字符串" + ] } as const; export const EnumWithReplacedCharactersSchema = { - enum: ["'Single Quote'", '"Double Quotes"', 'øæåôöØÆÅÔÖ字符串', 3.1, ''], - type: 'string' + enum: [ + "'Single Quote'", + "\"Double Quotes\"", + "øæåôöØÆÅÔÖ字符串", + 3.1, + "" + ], + type: "string" } as const; export const EnumWithNumbersSchema = { - description: 'This is a simple enum with numbers', - enum: [1, 2, 3, 1.1, 1.2, 1.3, 100, 200, 300, -100, -200, -300, -1.1, -1.2, -1.3], + description: "This is a simple enum with numbers", + enum: [ + 1, + 2, + 3, + 1.1, + 1.2, + 1.3, + 100, + 200, + 300, + -100, + -200, + -300, + -1.1, + -1.2, + -1.3 + ], default: 200 } as const; export const EnumFromDescriptionSchema = { - description: 'Success=1,Warning=2,Error=3', - type: 'number' + description: "Success=1,Warning=2,Error=3", + type: "number" } as const; export const EnumWithExtensionsSchema = { - description: 'This is a simple enum with numbers', - enum: [200, 400, 500], - 'x-enum-varnames': ['CUSTOM_SUCCESS', 'CUSTOM_WARNING', 'CUSTOM_ERROR'], - 'x-enum-descriptions': ['Used when the status of something is successful', 'Used when the status of something has a warning', 'Used when the status of something has an error'] + description: "This is a simple enum with numbers", + enum: [ + 200, + 400, + 500 + ], + 'x-enum-varnames': [ + "CUSTOM_SUCCESS", + "CUSTOM_WARNING", + "CUSTOM_ERROR" + ], + 'x-enum-descriptions': [ + "Used when the status of something is successful", + "Used when the status of something has a warning", + "Used when the status of something has an error" + ] } as const; export const EnumWithXEnumNamesSchema = { - enum: [0, 1, 2], - 'x-enumNames': ['zero', 'one', 'two'] + enum: [ + 0, + 1, + 2 + ], + 'x-enumNames': [ + "zero", + "one", + "two" + ] } as const; export const ArrayWithNumbersSchema = { - description: 'This is a simple array with numbers', - type: 'array', + description: "This is a simple array with numbers", + type: "array", items: { - type: 'integer' + type: "integer" } } as const; export const ArrayWithBooleansSchema = { - description: 'This is a simple array with booleans', - type: 'array', + description: "This is a simple array with booleans", + type: "array", items: { - type: 'boolean' + type: "boolean" } } as const; export const ArrayWithStringsSchema = { - description: 'This is a simple array with strings', - type: 'array', + description: "This is a simple array with strings", + type: "array", items: { - type: 'string' + type: "string" }, - default: ['test'] + default: [ + "test" + ] } as const; export const ArrayWithReferencesSchema = { - description: 'This is a simple array with references', - type: 'array', + description: "This is a simple array with references", + type: "array", items: { - '$ref': '#/components/schemas/ModelWithString' + '$ref': "#/components/schemas/ModelWithString" } } as const; export const ArrayWithArraySchema = { - description: 'This is a simple array containing an array', - type: 'array', + description: "This is a simple array containing an array", + type: "array", items: { - type: 'array', + type: "array", items: { - '$ref': '#/components/schemas/ModelWithString' + '$ref': "#/components/schemas/ModelWithString" } } } as const; export const ArrayWithPropertiesSchema = { - description: 'This is a simple array with properties', - type: 'array', + description: "This is a simple array with properties", + type: "array", items: { - type: 'object', + type: "object", properties: { '16x16': { - '$ref': '#/components/schemas/camelCaseCommentWithBreaks' + '$ref': "#/components/schemas/camelCaseCommentWithBreaks" }, bar: { - type: 'string' + type: "string" } } } } as const; export const ArrayWithAnyOfPropertiesSchema = { - description: 'This is a simple array with any of properties', - type: 'array', + description: "This is a simple array with any of properties", + type: "array", items: { anyOf: [ { - type: 'object', + type: "object", properties: { foo: { - type: 'string', - default: 'test' + type: "string", + default: "test" } } }, { - type: 'object', + type: "object", properties: { bar: { - type: 'string' + type: "string" } } } @@ -224,7 +269,7 @@ export const ArrayWithAnyOfPropertiesSchema = { } as const; export const AnyOfAnyAndNullSchema = { - type: 'object', + type: "object", properties: { data: { anyOf: [ @@ -238,336 +283,373 @@ export const AnyOfAnyAndNullSchema = { } as const; export const AnyOfArraysSchema = { - description: 'This is a simple array with any of properties', - type: 'object', + description: "This is a simple array with any of properties", + type: "object", properties: { results: { items: { anyOf: [ { - type: 'object', + type: "object", properties: { foo: { - type: 'string' + type: "string" } } }, { - type: 'object', + type: "object", properties: { bar: { - type: 'string' + type: "string" } } } ] }, - type: 'array' + type: "array" } } } as const; export const DictionaryWithStringSchema = { - description: 'This is a string dictionary', - type: 'object', + description: "This is a string dictionary", + type: "object", additionalProperties: { - type: 'string' + type: "string" } } as const; export const DictionaryWithPropertiesAndAdditionalPropertiesSchema = { - type: 'object', + type: "object", properties: { foo: { - type: 'number' + type: "number" }, bar: { - type: 'boolean' + type: "boolean" } }, additionalProperties: { - type: 'string' + type: "string" } } as const; export const DictionaryWithReferenceSchema = { - description: 'This is a string reference', - type: 'object', + description: "This is a string reference", + type: "object", additionalProperties: { - '$ref': '#/components/schemas/ModelWithString' + '$ref': "#/components/schemas/ModelWithString" } } as const; export const DictionaryWithArraySchema = { - description: 'This is a complex dictionary', - type: 'object', + description: "This is a complex dictionary", + type: "object", additionalProperties: { - type: 'array', + type: "array", items: { - '$ref': '#/components/schemas/ModelWithString' + '$ref': "#/components/schemas/ModelWithString" } } } as const; export const DictionaryWithDictionarySchema = { - description: 'This is a string dictionary', - type: 'object', + description: "This is a string dictionary", + type: "object", additionalProperties: { - type: 'object', + type: "object", additionalProperties: { - type: 'string' + type: "string" } } } as const; export const DictionaryWithPropertiesSchema = { - description: 'This is a complex dictionary', - type: 'object', + description: "This is a complex dictionary", + type: "object", additionalProperties: { - type: 'object', + type: "object", properties: { foo: { - type: 'string' + type: "string" }, bar: { - type: 'string' + type: "string" } } } } as const; export const ModelWithIntegerSchema = { - description: 'This is a model with one number property', - type: 'object', + description: "This is a model with one number property", + type: "object", properties: { prop: { - description: 'This is a simple number property', - type: 'integer' + description: "This is a simple number property", + type: "integer" } } } as const; export const ModelWithBooleanSchema = { - description: 'This is a model with one boolean property', - type: 'object', + description: "This is a model with one boolean property", + type: "object", properties: { prop: { - description: 'This is a simple boolean property', - type: 'boolean' + description: "This is a simple boolean property", + type: "boolean" } } } as const; export const ModelWithStringSchema = { - description: 'This is a model with one string property', - type: 'object', + description: "This is a model with one string property", + type: "object", properties: { prop: { - description: 'This is a simple string property', - type: 'string' + description: "This is a simple string property", + type: "string" } } } as const; export const ModelWithStringErrorSchema = { - description: 'This is a model with one string property', - type: 'object', + description: "This is a model with one string property", + type: "object", properties: { prop: { - description: 'This is a simple string property', - type: 'string' + description: "This is a simple string property", + type: "string" } } } as const; export const Model_From_ZendeskSchema = { - description: `\`Comment\` or \`VoiceComment\`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets)`, - type: 'string' + description: "`Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets)", + type: "string" } as const; export const ModelWithNullableStringSchema = { - description: 'This is a model with one string property', - type: 'object', - required: ['nullableRequiredProp1', 'nullableRequiredProp2'], + description: "This is a model with one string property", + type: "object", + required: [ + "nullableRequiredProp1", + "nullableRequiredProp2" + ], properties: { nullableProp1: { - description: 'This is a simple string property', - type: 'string', + description: "This is a simple string property", + type: "string", nullable: true }, nullableRequiredProp1: { - description: 'This is a simple string property', - type: 'string', + description: "This is a simple string property", + type: "string", nullable: true }, nullableProp2: { - description: 'This is a simple string property', + description: "This is a simple string property", nullable: true, - type: 'string' + type: "string" }, nullableRequiredProp2: { - description: 'This is a simple string property', + description: "This is a simple string property", nullable: true, - type: 'string' + type: "string" }, 'foo_bar-enum': { - description: 'This is a simple enum with strings', - enum: ['Success', 'Warning', 'Error', 'ØÆÅ字符串'] + description: "This is a simple enum with strings", + enum: [ + "Success", + "Warning", + "Error", + "ØÆÅ字符串" + ] } } } as const; export const ModelWithEnumSchema = { - description: 'This is a model with one enum', - type: 'object', + description: "This is a model with one enum", + type: "object", properties: { 'foo_bar-enum': { - description: 'This is a simple enum with strings', - enum: ['Success', 'Warning', 'Error', 'ØÆÅ字符串'] + description: "This is a simple enum with strings", + enum: [ + "Success", + "Warning", + "Error", + "ØÆÅ字符串" + ] }, statusCode: { - description: 'These are the HTTP error code enums', - enum: ['100', '200 FOO', '300 FOO_BAR', '400 foo-bar', '500 foo.bar', '600 foo&bar'] + description: "These are the HTTP error code enums", + enum: [ + "100", + "200 FOO", + "300 FOO_BAR", + "400 foo-bar", + "500 foo.bar", + "600 foo&bar" + ] }, bool: { - description: 'Simple boolean enum', - type: 'boolean', - enum: [true] + description: "Simple boolean enum", + type: "boolean", + enum: [ + true + ] } } } as const; export const ModelWithEnumWithHyphenSchema = { - description: 'This is a model with one enum with escaped name', - type: 'object', + description: "This is a model with one enum with escaped name", + type: "object", properties: { 'foo-bar-baz-qux': { - type: 'string', - enum: ['3.0'], - title: 'Foo-Bar-Baz-Qux', - default: '3.0' + type: "string", + enum: [ + "3.0" + ], + title: "Foo-Bar-Baz-Qux", + default: "3.0" } } } as const; export const ModelWithEnumFromDescriptionSchema = { - description: 'This is a model with one enum', - type: 'object', + description: "This is a model with one enum", + type: "object", properties: { test: { - type: 'integer', - description: 'Success=1,Warning=2,Error=3' + type: "integer", + description: "Success=1,Warning=2,Error=3" } } } as const; export const ModelWithNestedEnumsSchema = { - description: 'This is a model with nested enums', - type: 'object', + description: "This is a model with nested enums", + type: "object", properties: { dictionaryWithEnum: { - type: 'object', + type: "object", additionalProperties: { - enum: ['Success', 'Warning', 'Error'] + enum: [ + "Success", + "Warning", + "Error" + ] } }, dictionaryWithEnumFromDescription: { - type: 'object', + type: "object", additionalProperties: { - type: 'integer', - description: 'Success=1,Warning=2,Error=3' + type: "integer", + description: "Success=1,Warning=2,Error=3" } }, arrayWithEnum: { - type: 'array', + type: "array", items: { - enum: ['Success', 'Warning', 'Error'] + enum: [ + "Success", + "Warning", + "Error" + ] } }, arrayWithDescription: { - type: 'array', + type: "array", items: { - type: 'integer', - description: 'Success=1,Warning=2,Error=3' + type: "integer", + description: "Success=1,Warning=2,Error=3" } }, 'foo_bar-enum': { - description: 'This is a simple enum with strings', - enum: ['Success', 'Warning', 'Error', 'ØÆÅ字符串'] + description: "This is a simple enum with strings", + enum: [ + "Success", + "Warning", + "Error", + "ØÆÅ字符串" + ] } } } as const; export const ModelWithReferenceSchema = { - description: 'This is a model with one property containing a reference', - type: 'object', + description: "This is a model with one property containing a reference", + type: "object", properties: { prop: { - '$ref': '#/components/schemas/ModelWithProperties' + '$ref': "#/components/schemas/ModelWithProperties" } } } as const; export const ModelWithArrayReadOnlyAndWriteOnlySchema = { - description: 'This is a model with one property containing an array', - type: 'object', + description: "This is a model with one property containing an array", + type: "object", properties: { prop: { - type: 'array', + type: "array", items: { - '$ref': '#/components/schemas/ModelWithReadOnlyAndWriteOnly' + '$ref': "#/components/schemas/ModelWithReadOnlyAndWriteOnly" } }, propWithFile: { - type: 'array', + type: "array", items: { - format: 'binary', - type: 'string' + format: "binary", + type: "string" } }, propWithNumber: { - type: 'array', + type: "array", items: { - type: 'number' + type: "number" } } } } as const; export const ModelWithArraySchema = { - description: 'This is a model with one property containing an array', - type: 'object', + description: "This is a model with one property containing an array", + type: "object", properties: { prop: { - type: 'array', + type: "array", items: { - '$ref': '#/components/schemas/ModelWithString' + '$ref': "#/components/schemas/ModelWithString" } }, propWithFile: { - type: 'array', + type: "array", items: { - format: 'binary', - type: 'string' + format: "binary", + type: "string" } }, propWithNumber: { - type: 'array', + type: "array", items: { - type: 'number' + type: "number" } } } } as const; export const ModelWithDictionarySchema = { - description: 'This is a model with one property containing a dictionary', - type: 'object', + description: "This is a model with one property containing a dictionary", + type: "object", properties: { prop: { - type: 'object', + type: "object", additionalProperties: { - type: 'string' + type: "string" } } } @@ -575,45 +657,45 @@ export const ModelWithDictionarySchema = { export const DeprecatedModelSchema = { deprecated: true, - description: 'This is a deprecated model with a deprecated property', - type: 'object', + description: "This is a deprecated model with a deprecated property", + type: "object", properties: { prop: { deprecated: true, - description: 'This is a deprecated property', - type: 'string' + description: "This is a deprecated property", + type: "string" } } } as const; export const ModelWithCircularReferenceSchema = { - description: 'This is a model with one property containing a circular reference', - type: 'object', + description: "This is a model with one property containing a circular reference", + type: "object", properties: { prop: { - '$ref': '#/components/schemas/ModelWithCircularReference' + '$ref': "#/components/schemas/ModelWithCircularReference" } } } as const; export const CompositionWithOneOfSchema = { description: "This is a model with one property with a 'one of' relationship", - type: 'object', + type: "object", properties: { propA: { - type: 'object', + type: "object", oneOf: [ { - '$ref': '#/components/schemas/ModelWithString' + '$ref': "#/components/schemas/ModelWithString" }, { - '$ref': '#/components/schemas/ModelWithEnum' + '$ref': "#/components/schemas/ModelWithEnum" }, { - '$ref': '#/components/schemas/ModelWithArray' + '$ref': "#/components/schemas/ModelWithArray" }, { - '$ref': '#/components/schemas/ModelWithDictionary' + '$ref': "#/components/schemas/ModelWithDictionary" } ] } @@ -622,27 +704,27 @@ export const CompositionWithOneOfSchema = { export const CompositionWithOneOfAnonymousSchema = { description: "This is a model with one property with a 'one of' relationship where the options are not $ref", - type: 'object', + type: "object", properties: { propA: { - type: 'object', + type: "object", oneOf: [ { - description: 'Anonymous object type', - type: 'object', + description: "Anonymous object type", + type: "object", properties: { propA: { - type: 'string' + type: "string" } } }, { - description: 'Anonymous string type', - type: 'string' + description: "Anonymous string type", + type: "string" }, { - description: 'Anonymous integer type', - type: 'integer' + description: "Anonymous integer type", + type: "integer" } ] } @@ -650,71 +732,75 @@ export const CompositionWithOneOfAnonymousSchema = { } as const; export const ModelCircleSchema = { - description: 'Circle', - type: 'object', - required: ['kind'], + description: "Circle", + type: "object", + required: [ + "kind" + ], properties: { kind: { - type: 'string' + type: "string" }, radius: { - type: 'number' + type: "number" } } } as const; export const ModelSquareSchema = { - description: 'Square', - type: 'object', - required: ['kind'], + description: "Square", + type: "object", + required: [ + "kind" + ], properties: { kind: { - type: 'string' + type: "string" }, sideLength: { - type: 'number' + type: "number" } } } as const; export const CompositionWithOneOfDiscriminatorSchema = { description: "This is a model with one property with a 'one of' relationship where the options are not $ref", - type: 'object', + type: "object", oneOf: [ { - '$ref': '#/components/schemas/ModelCircle' + '$ref': "#/components/schemas/ModelCircle" }, { - '$ref': '#/components/schemas/ModelSquare' + '$ref': "#/components/schemas/ModelSquare" } ], discriminator: { - propertyName: 'kind', + propertyName: "kind", mapping: { - circle: '#/components/schemas/ModelCircle', - square: '#/components/schemas/ModelSquare' + circle: "#/components/schemas/ModelCircle", + square: "#/components/schemas/ModelSquare" } } } as const; export const CompositionWithAnyOfSchema = { description: "This is a model with one property with a 'any of' relationship", - type: 'object', + type: "object", properties: { propA: { - type: 'object', + type: "object", anyOf: [ { - '$ref': '#/components/schemas/ModelWithString' + '$ref': "#/components/schemas/ModelWithString" }, { - '$ref': '#/components/schemas/ModelWithEnum' + '$ref': "#/components/schemas/ModelWithEnum" }, { - '$ref': '#/components/schemas/ModelWithArray' + '$ref': "#/components/schemas/ModelWithArray" }, { - '$ref': '#/components/schemas/ModelWithDictionary' + '$ref': "#/components/schemas/ModelWithDictionary" } ] } @@ -723,27 +809,27 @@ export const CompositionWithAnyOfSchema = { export const CompositionWithAnyOfAnonymousSchema = { description: "This is a model with one property with a 'any of' relationship where the options are not $ref", - type: 'object', + type: "object", properties: { propA: { - type: 'object', + type: "object", anyOf: [ { - description: 'Anonymous object type', - type: 'object', + description: "Anonymous object type", + type: "object", properties: { propA: { - type: 'string' + type: "string" } } }, { - description: 'Anonymous string type', - type: 'string' + description: "Anonymous string type", + type: "string" }, { - description: 'Anonymous integer type', - type: 'integer' + description: "Anonymous integer type", + type: "integer" } ] } @@ -752,32 +838,32 @@ export const CompositionWithAnyOfAnonymousSchema = { export const CompositionWithNestedAnyAndTypeNullSchema = { description: "This is a model with nested 'any of' property with a type null", - type: 'object', + type: "object", properties: { propA: { - type: 'object', + type: "object", anyOf: [ { items: { nullable: true, allOf: [ { - '$ref': '#/components/schemas/ModelWithDictionary' + '$ref': "#/components/schemas/ModelWithDictionary" } ] }, - type: 'array' + type: "array" }, { items: { nullable: true, allOf: [ { - '$ref': '#/components/schemas/ModelWithArray' + '$ref': "#/components/schemas/ModelWithArray" } ] }, - type: 'array' + type: "array" } ] } @@ -785,18 +871,23 @@ export const CompositionWithNestedAnyAndTypeNullSchema = { } as const; export const _3e_num_1ПериодSchema = { - enum: ['Bird', 'Dog'], - type: 'string' + enum: [ + "Bird", + "Dog" + ], + type: "string" } as const; export const ConstValueSchema = { - enum: ['ConstValue'], - type: 'string' + enum: [ + "ConstValue" + ], + type: "string" } as const; export const CompositionWithNestedAnyOfAndNullSchema = { description: "This is a model with one property with a 'any of' relationship where the options are not $ref", - type: 'object', + type: "object", properties: { propA: { nullable: true, @@ -805,45 +896,45 @@ export const CompositionWithNestedAnyOfAndNullSchema = { items: { anyOf: [ { - '$ref': '#/components/schemas/3e-num_1Период' + '$ref': "#/components/schemas/3e-num_1Период" }, { - '$ref': '#/components/schemas/ConstValue' + '$ref': "#/components/schemas/ConstValue" } ] }, - type: 'array' + type: "array" } ], - title: 'Scopes' + title: "Scopes" } } } as const; export const CompositionWithOneOfAndNullableSchema = { description: "This is a model with one property with a 'one of' relationship", - type: 'object', + type: "object", properties: { propA: { nullable: true, - type: 'object', + type: "object", oneOf: [ { - type: 'object', + type: "object", properties: { boolean: { - type: 'boolean' + type: "boolean" } } }, { - '$ref': '#/components/schemas/ModelWithEnum' + '$ref': "#/components/schemas/ModelWithEnum" }, { - '$ref': '#/components/schemas/ModelWithArray' + '$ref': "#/components/schemas/ModelWithArray" }, { - '$ref': '#/components/schemas/ModelWithDictionary' + '$ref': "#/components/schemas/ModelWithDictionary" } ] } @@ -851,18 +942,18 @@ export const CompositionWithOneOfAndNullableSchema = { } as const; export const CompositionWithOneOfAndSimpleDictionarySchema = { - description: 'This is a model that contains a simple dictionary within composition', - type: 'object', + description: "This is a model that contains a simple dictionary within composition", + type: "object", properties: { propA: { oneOf: [ { - type: 'boolean' + type: "boolean" }, { - type: 'object', + type: "object", additionalProperties: { - type: 'number' + type: "number" } } ] @@ -871,20 +962,20 @@ export const CompositionWithOneOfAndSimpleDictionarySchema = { } as const; export const CompositionWithOneOfAndSimpleArrayDictionarySchema = { - description: 'This is a model that contains a dictionary of simple arrays within composition', - type: 'object', + description: "This is a model that contains a dictionary of simple arrays within composition", + type: "object", properties: { propA: { oneOf: [ { - type: 'boolean' + type: "boolean" }, { - type: 'object', + type: "object", additionalProperties: { - type: 'array', + type: "array", items: { - type: 'boolean' + type: "boolean" } } } @@ -894,25 +985,25 @@ export const CompositionWithOneOfAndSimpleArrayDictionarySchema = { } as const; export const CompositionWithOneOfAndComplexArrayDictionarySchema = { - description: 'This is a model that contains a dictionary of complex arrays (composited) within composition', - type: 'object', + description: "This is a model that contains a dictionary of complex arrays (composited) within composition", + type: "object", properties: { propA: { oneOf: [ { - type: 'boolean' + type: "boolean" }, { - type: 'object', + type: "object", additionalProperties: { - type: 'array', + type: "array", items: { oneOf: [ { - type: 'number' + type: "number" }, { - type: 'string' + type: "string" } ] } @@ -925,28 +1016,28 @@ export const CompositionWithOneOfAndComplexArrayDictionarySchema = { export const CompositionWithAllOfAndNullableSchema = { description: "This is a model with one property with a 'all of' relationship", - type: 'object', + type: "object", properties: { propA: { nullable: true, - type: 'object', + type: "object", allOf: [ { - type: 'object', + type: "object", properties: { boolean: { - type: 'boolean' + type: "boolean" } } }, { - '$ref': '#/components/schemas/ModelWithEnum' + '$ref': "#/components/schemas/ModelWithEnum" }, { - '$ref': '#/components/schemas/ModelWithArray' + '$ref': "#/components/schemas/ModelWithArray" }, { - '$ref': '#/components/schemas/ModelWithDictionary' + '$ref': "#/components/schemas/ModelWithDictionary" } ] } @@ -955,28 +1046,28 @@ export const CompositionWithAllOfAndNullableSchema = { export const CompositionWithAnyOfAndNullableSchema = { description: "This is a model with one property with a 'any of' relationship", - type: 'object', + type: "object", properties: { propA: { nullable: true, - type: 'object', + type: "object", anyOf: [ { - type: 'object', + type: "object", properties: { boolean: { - type: 'boolean' + type: "boolean" } } }, { - '$ref': '#/components/schemas/ModelWithEnum' + '$ref': "#/components/schemas/ModelWithEnum" }, { - '$ref': '#/components/schemas/ModelWithArray' + '$ref': "#/components/schemas/ModelWithArray" }, { - '$ref': '#/components/schemas/ModelWithDictionary' + '$ref': "#/components/schemas/ModelWithDictionary" } ] } @@ -984,101 +1075,115 @@ export const CompositionWithAnyOfAndNullableSchema = { } as const; export const CompositionBaseModelSchema = { - description: 'This is a base model with two simple optional properties', - type: 'object', + description: "This is a base model with two simple optional properties", + type: "object", properties: { firstName: { - type: 'string' + type: "string" }, lastname: { - type: 'string' + type: "string" } } } as const; export const CompositionExtendedModelSchema = { - description: 'This is a model that extends the base model', - type: 'object', + description: "This is a model that extends the base model", + type: "object", allOf: [ { - '$ref': '#/components/schemas/CompositionBaseModel' + '$ref': "#/components/schemas/CompositionBaseModel" } ], properties: { age: { - type: 'number' + type: "number" } }, - required: ['firstName', 'lastname', 'age'] + required: [ + "firstName", + "lastname", + "age" + ] } as const; export const ModelWithPropertiesSchema = { - description: 'This is a model with one nested property', - type: 'object', - required: ['required', 'requiredAndReadOnly', 'requiredAndNullable'], + description: "This is a model with one nested property", + type: "object", + required: [ + "required", + "requiredAndReadOnly", + "requiredAndNullable" + ], properties: { required: { - type: 'string' + type: "string" }, requiredAndReadOnly: { - type: 'string', + type: "string", readOnly: true }, requiredAndNullable: { - type: 'string', + type: "string", nullable: true }, string: { - type: 'string' + type: "string" }, number: { - type: 'number' + type: "number" }, boolean: { - type: 'boolean' + type: "boolean" }, reference: { - '$ref': '#/components/schemas/ModelWithString' + '$ref': "#/components/schemas/ModelWithString" }, 'property with space': { - type: 'string' + type: "string" }, default: { - type: 'string' + type: "string" }, try: { - type: 'string' + type: "string" }, '@namespace.string': { - type: 'string', + type: "string", readOnly: true }, '@namespace.integer': { - type: 'integer', + type: "integer", readOnly: true } } } as const; export const ModelWithNestedPropertiesSchema = { - description: 'This is a model with one nested property', - type: 'object', - required: ['first'], + description: "This is a model with one nested property", + type: "object", + required: [ + "first" + ], properties: { first: { - type: 'object', - required: ['second'], + type: "object", + required: [ + "second" + ], readOnly: true, nullable: true, properties: { second: { - type: 'object', - required: ['third'], + type: "object", + required: [ + "third" + ], readOnly: true, nullable: true, properties: { third: { - type: 'string', + type: "string", required: true, readOnly: true, nullable: true @@ -1091,62 +1196,62 @@ export const ModelWithNestedPropertiesSchema = { } as const; export const ModelWithDuplicatePropertiesSchema = { - description: 'This is a model with duplicated properties', - type: 'object', + description: "This is a model with duplicated properties", + type: "object", properties: { prop: { - '$ref': '#/components/schemas/ModelWithString' + '$ref': "#/components/schemas/ModelWithString" } } } as const; export const ModelWithOrderedPropertiesSchema = { - description: 'This is a model with ordered properties', - type: 'object', + description: "This is a model with ordered properties", + type: "object", properties: { zebra: { - type: 'string' + type: "string" }, apple: { - type: 'string' + type: "string" }, hawaii: { - type: 'string' + type: "string" } } } as const; export const ModelWithDuplicateImportsSchema = { - description: 'This is a model with duplicated imports', - type: 'object', + description: "This is a model with duplicated imports", + type: "object", properties: { propA: { - '$ref': '#/components/schemas/ModelWithString' + '$ref': "#/components/schemas/ModelWithString" }, propB: { - '$ref': '#/components/schemas/ModelWithString' + '$ref': "#/components/schemas/ModelWithString" }, propC: { - '$ref': '#/components/schemas/ModelWithString' + '$ref': "#/components/schemas/ModelWithString" } } } as const; export const ModelThatExtendsSchema = { - description: 'This is a model that extends another model', - type: 'object', + description: "This is a model that extends another model", + type: "object", allOf: [ { - '$ref': '#/components/schemas/ModelWithString' + '$ref': "#/components/schemas/ModelWithString" }, { - type: 'object', + type: "object", properties: { propExtendsA: { - type: 'string' + type: "string" }, propExtendsB: { - '$ref': '#/components/schemas/ModelWithString' + '$ref': "#/components/schemas/ModelWithString" } } } @@ -1154,23 +1259,23 @@ export const ModelThatExtendsSchema = { } as const; export const ModelThatExtendsExtendsSchema = { - description: 'This is a model that extends another model', - type: 'object', + description: "This is a model that extends another model", + type: "object", allOf: [ { - '$ref': '#/components/schemas/ModelWithString' + '$ref': "#/components/schemas/ModelWithString" }, { - '$ref': '#/components/schemas/ModelThatExtends' + '$ref': "#/components/schemas/ModelThatExtends" }, { - type: 'object', + type: "object", properties: { propExtendsC: { - type: 'string' + type: "string" }, propExtendsD: { - '$ref': '#/components/schemas/ModelWithString' + '$ref': "#/components/schemas/ModelWithString" } } } @@ -1178,165 +1283,176 @@ export const ModelThatExtendsExtendsSchema = { } as const; export const ModelWithPatternSchema = { - description: 'This is a model that contains a some patterns', - type: 'object', - required: ['key', 'name'], + description: "This is a model that contains a some patterns", + type: "object", + required: [ + "key", + "name" + ], properties: { key: { maxLength: 64, - pattern: '^[a-zA-Z0-9_]*$', - type: 'string' + pattern: "^[a-zA-Z0-9_]*$", + type: "string" }, name: { maxLength: 255, - type: 'string' + type: "string" }, enabled: { - type: 'boolean', + type: "boolean", readOnly: true }, modified: { - type: 'string', - format: 'date-time', + type: "string", + format: "date-time", readOnly: true }, id: { - type: 'string', - pattern: '^\\d{2}-\\d{3}-\\d{4}$' + type: "string", + pattern: "^\\d{2}-\\d{3}-\\d{4}$" }, text: { - type: 'string', - pattern: '^\\w+$' + type: "string", + pattern: "^\\w+$" }, patternWithSingleQuotes: { - type: 'string', + type: "string", pattern: "^[a-zA-Z0-9']*$" }, patternWithNewline: { - type: 'string', - pattern: 'aaa\\nbbb' + type: "string", + pattern: "aaa\\nbbb" }, patternWithBacktick: { - type: 'string', - pattern: 'aaa`bbb' + type: "string", + pattern: "aaa`bbb" } } } as const; export const FileSchema = { - required: ['mime'], - type: 'object', + required: [ + "mime" + ], + type: "object", properties: { id: { - title: 'Id', - type: 'string', + title: "Id", + type: "string", readOnly: true, minLength: 1 }, updated_at: { - title: 'Updated at', - type: 'string', - format: 'date-time', + title: "Updated at", + type: "string", + format: "date-time", readOnly: true }, created_at: { - title: 'Created at', - type: 'string', - format: 'date-time', + title: "Created at", + type: "string", + format: "date-time", readOnly: true }, mime: { - title: 'Mime', - type: 'string', + title: "Mime", + type: "string", maxLength: 24, minLength: 1 }, file: { - title: 'File', - type: 'string', + title: "File", + type: "string", readOnly: true, - format: 'uri' + format: "uri" } } } as const; export const defaultSchema = { - type: 'object', + type: "object", properties: { name: { - type: 'string' + type: "string" } } } as const; export const PageableSchema = { - type: 'object', + type: "object", properties: { page: { minimum: 0, - type: 'integer', - format: 'int32', + type: "integer", + format: "int32", default: 0 }, size: { minimum: 1, - type: 'integer', - format: 'int32' + type: "integer", + format: "int32" }, sort: { - type: 'array', + type: "array", items: { - type: 'string' + type: "string" } } } } as const; export const FreeFormObjectWithoutAdditionalPropertiesSchema = { - description: 'This is a free-form object without additionalProperties.', - type: 'object' + description: "This is a free-form object without additionalProperties.", + type: "object" } as const; export const FreeFormObjectWithAdditionalPropertiesEqTrueSchema = { - description: 'This is a free-form object with additionalProperties: true.', - type: 'object', + description: "This is a free-form object with additionalProperties: true.", + type: "object", additionalProperties: true } as const; export const FreeFormObjectWithAdditionalPropertiesEqEmptyObjectSchema = { - description: 'This is a free-form object with additionalProperties: {}.', - type: 'object', + description: "This is a free-form object with additionalProperties: {}.", + type: "object", additionalProperties: {} } as const; export const ModelWithConstSchema = { - type: 'object', + type: "object", properties: { String: { - enum: ['String'], - type: 'string' + enum: [ + "String" + ], + type: "string" }, number: { - enum: [0], - type: 'number' + enum: [ + 0 + ], + type: "number" }, null: { nullable: true }, withType: { - enum: ['Some string'], - type: 'string' + enum: [ + "Some string" + ], + type: "string" } } } as const; export const ModelWithAdditionalPropertiesEqTrueSchema = { - description: 'This is a model with one property and additionalProperties: true', - type: 'object', + description: "This is a model with one property and additionalProperties: true", + type: "object", properties: { prop: { - description: 'This is a simple string property', - type: 'string' + description: "This is a simple string property", + type: "string" } }, additionalProperties: true @@ -1351,83 +1467,90 @@ export const NestedAnyOfArraysNullableSchema = { items: { anyOf: [ { - type: 'string' + type: "string" }, { - type: 'boolean' + type: "boolean" } ] }, - type: 'array' + type: "array" } ] } }, - type: 'object' + type: "object" } as const; export const CompositionWithOneOfAndPropertiesSchema = { - type: 'object', + type: "object", oneOf: [ { - type: 'object', - required: ['foo'], + type: "object", + required: [ + "foo" + ], properties: { foo: { - '$ref': '#/components/parameters/SimpleParameter' + '$ref': "#/components/parameters/SimpleParameter" } }, additionalProperties: false }, { - type: 'object', - required: ['bar'], + type: "object", + required: [ + "bar" + ], properties: { bar: { - '$ref': '#/components/schemas/NonAsciiStringæøåÆØÅöôêÊ字符串' + '$ref': "#/components/schemas/NonAsciiStringæøåÆØÅöôêÊ字符串" } }, additionalProperties: false } ], - required: ['baz', 'qux'], + required: [ + "baz", + "qux" + ], properties: { baz: { - type: 'integer', - format: 'uint16', + type: "integer", + format: "uint16", minimum: 0, nullable: true }, qux: { - type: 'integer', - format: 'uint8', + type: "integer", + format: "uint8", minimum: 0 } } } as const; export const NullableObjectSchema = { - description: 'An object that can be null', + description: "An object that can be null", nullable: true, - type: 'object', + type: "object", properties: { foo: { - type: 'string' + type: "string" } }, default: null } as const; export const CharactersInDescriptionSchema = { - type: 'string', - description: 'Some % character' + type: "string", + description: "Some % character" } as const; export const ModelWithNullableObjectSchema = { - type: 'object', + type: "object", properties: { data: { - '$ref': '#/components/schemas/NullableObject' + '$ref': "#/components/schemas/NullableObject" } } } as const; @@ -1435,65 +1558,87 @@ export const ModelWithNullableObjectSchema = { export const ModelWithOneOfEnumSchema = { oneOf: [ { - type: 'object', - required: ['foo'], + type: "object", + required: [ + "foo" + ], properties: { foo: { - type: 'string', - enum: ['Bar'] + type: "string", + enum: [ + "Bar" + ] } } }, { - type: 'object', - required: ['foo'], + type: "object", + required: [ + "foo" + ], properties: { foo: { - type: 'string', - enum: ['Baz'] + type: "string", + enum: [ + "Baz" + ] } } }, { - type: 'object', - required: ['foo'], + type: "object", + required: [ + "foo" + ], properties: { foo: { - type: 'string', - enum: ['Qux'] + type: "string", + enum: [ + "Qux" + ] } } }, { - type: 'object', - required: ['content', 'foo'], + type: "object", + required: [ + "content", + "foo" + ], properties: { content: { - type: 'string', - format: 'date-time' + type: "string", + format: "date-time" }, foo: { - type: 'string', - enum: ['Quux'] + type: "string", + enum: [ + "Quux" + ] } } }, { - type: 'object', - required: ['content', 'foo'], + type: "object", + required: [ + "content", + "foo" + ], properties: { content: { - type: 'array', + type: "array", items: { - type: 'string', - format: 'date-time' + type: "string", + format: "date-time" }, maxItems: 2, minItems: 2 }, foo: { - type: 'string', - enum: ['Corge'] + type: "string", + enum: [ + "Corge" + ] } } } @@ -1501,46 +1646,52 @@ export const ModelWithOneOfEnumSchema = { } as const; export const ModelWithNestedArrayEnumsDataFooSchema = { - enum: ['foo', 'bar'], - type: 'string' + enum: [ + "foo", + "bar" + ], + type: "string" } as const; export const ModelWithNestedArrayEnumsDataBarSchema = { - enum: ['baz', 'qux'], - type: 'string' + enum: [ + "baz", + "qux" + ], + type: "string" } as const; export const ModelWithNestedArrayEnumsDataSchema = { - type: 'object', + type: "object", properties: { foo: { - type: 'array', + type: "array", items: { - '$ref': '#/components/schemas/ModelWithNestedArrayEnumsDataFoo' + '$ref': "#/components/schemas/ModelWithNestedArrayEnumsDataFoo" } }, bar: { - type: 'array', + type: "array", items: { - '$ref': '#/components/schemas/ModelWithNestedArrayEnumsDataBar' + '$ref': "#/components/schemas/ModelWithNestedArrayEnumsDataBar" } } } } as const; export const ModelWithNestedArrayEnumsSchema = { - type: 'object', + type: "object", properties: { array_strings: { - type: 'array', + type: "array", items: { - type: 'string' + type: "string" } }, data: { allOf: [ { - '$ref': '#/components/schemas/ModelWithNestedArrayEnumsData' + '$ref': "#/components/schemas/ModelWithNestedArrayEnumsData" } ] } @@ -1548,12 +1699,12 @@ export const ModelWithNestedArrayEnumsSchema = { } as const; export const ModelWithNestedCompositionEnumsSchema = { - type: 'object', + type: "object", properties: { foo: { allOf: [ { - '$ref': '#/components/schemas/ModelWithNestedArrayEnumsDataFoo' + '$ref': "#/components/schemas/ModelWithNestedArrayEnumsDataFoo" } ] } @@ -1561,37 +1712,40 @@ export const ModelWithNestedCompositionEnumsSchema = { } as const; export const ModelWithReadOnlyAndWriteOnlySchema = { - type: 'object', - required: ['foo', 'bar'], + type: "object", + required: [ + "foo", + "bar" + ], properties: { foo: { - type: 'string' + type: "string" }, bar: { readOnly: true, - type: 'string' + type: "string" } } } as const; export const ModelWithConstantSizeArraySchema = { - type: 'array', + type: "array", items: { - type: 'number' + type: "number" }, minItems: 2, maxItems: 2 } as const; export const ModelWithAnyOfConstantSizeArraySchema = { - type: 'array', + type: "array", items: { oneOf: [ { - type: 'number' + type: "number" }, { - type: 'string' + type: "string" } ] }, @@ -1600,32 +1754,32 @@ export const ModelWithAnyOfConstantSizeArraySchema = { } as const; export const ModelWithPrefixItemsConstantSizeArraySchema = { - type: 'array', + type: "array", items: { oneOf: [ { - '$ref': '#/components/schemas/ModelWithInteger' + '$ref': "#/components/schemas/ModelWithInteger" }, { - type: 'number' + type: "number" }, { - type: 'string' + type: "string" } ] } } as const; export const ModelWithAnyOfConstantSizeArrayNullableSchema = { - type: 'array', + type: "array", items: { oneOf: [ { - type: 'number', + type: "number", nullable: true }, { - type: 'string' + type: "string" } ] }, @@ -1634,14 +1788,14 @@ export const ModelWithAnyOfConstantSizeArrayNullableSchema = { } as const; export const ModelWithAnyOfConstantSizeArrayWithNSizeAndOptionsSchema = { - type: 'array', + type: "array", items: { oneOf: [ { - type: 'number' + type: "number" }, { - '$ref': '#/components/schemas/import' + '$ref': "#/components/schemas/import" } ] }, @@ -1650,14 +1804,14 @@ export const ModelWithAnyOfConstantSizeArrayWithNSizeAndOptionsSchema = { } as const; export const ModelWithAnyOfConstantSizeArrayAndIntersectSchema = { - type: 'array', + type: "array", items: { allOf: [ { - type: 'number' + type: "number" }, { - type: 'string' + type: "string" } ] }, @@ -1666,165 +1820,150 @@ export const ModelWithAnyOfConstantSizeArrayAndIntersectSchema = { } as const; export const ModelWithNumericEnumUnionSchema = { - type: 'object', + type: "object", properties: { value: { - type: 'number', - description: 'Период', - enum: [-10, -1, 0, 1, 3, 6, 12] + type: "number", + description: "Период", + enum: [ + -10, + -1, + 0, + 1, + 3, + 6, + 12 + ] } } } as const; export const ModelWithBackticksInDescriptionSchema = { - description: 'Some description with `back ticks`', - type: 'object', + description: "Some description with `back ticks`", + type: "object", properties: { template: { - type: 'string', - description: `The template \`that\` should be used for parsing and importing the contents of the CSV file. - -

There is one placeholder currently supported:

  • \${x} - refers to the n-th column in the CSV file, e.g. \${1}, \${2}, ...)

Example of a correct JSON template:

-
-[
-  {
-    "resourceType": "Asset",
-    "identifier": {
-      "name": "\${1}",
-      "domain": {
-        "name": "\${2}",
-        "community": {
-          "name": "Some Community"
-        }
-      }
-    },
-    "attributes" : {
-      "00000000-0000-0000-0000-000000003115" : [ {
-        "value" : "\${3}"
-      } ],
-      "00000000-0000-0000-0000-000000000222" : [ {
-        "value" : "\${4}"
-      } ]
-    }
-  }
-]
-
` + type: "string", + description: "The template `that` should be used for parsing and importing the contents of the CSV file.\n\n

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

\n
\n[\n  {\n    \"resourceType\": \"Asset\",\n    \"identifier\": {\n      \"name\": \"${1}\",\n      \"domain\": {\n        \"name\": \"${2}\",\n        \"community\": {\n          \"name\": \"Some Community\"\n        }\n      }\n    },\n    \"attributes\" : {\n      \"00000000-0000-0000-0000-000000003115\" : [ {\n        \"value\" : \"${3}\"\n      } ],\n      \"00000000-0000-0000-0000-000000000222\" : [ {\n        \"value\" : \"${4}\"\n      } ]\n    }\n  }\n]\n
" } } } as const; export const ModelWithOneOfAndPropertiesSchema = { - type: 'object', + type: "object", oneOf: [ { - '$ref': '#/components/parameters/SimpleParameter' + '$ref': "#/components/parameters/SimpleParameter" }, { - '$ref': '#/components/schemas/NonAsciiStringæøåÆØÅöôêÊ字符串' + '$ref': "#/components/schemas/NonAsciiStringæøåÆØÅöôêÊ字符串" } ], - required: ['baz', 'qux'], + required: [ + "baz", + "qux" + ], properties: { baz: { - type: 'integer', - format: 'uint16', + type: "integer", + format: "uint16", minimum: 0, nullable: true }, qux: { - type: 'integer', - format: 'uint8', + type: "integer", + format: "uint8", minimum: 0 } } } as const; export const ParameterSimpleParameterUnusedSchema = { - description: 'Model used to test deduplication strategy (unused)', - type: 'string' + description: "Model used to test deduplication strategy (unused)", + type: "string" } as const; export const PostServiceWithEmptyTagResponseSchema = { - description: 'Model used to test deduplication strategy', - type: 'string' + description: "Model used to test deduplication strategy", + type: "string" } as const; export const PostServiceWithEmptyTagResponse2Schema = { - description: 'Model used to test deduplication strategy', - type: 'string' + description: "Model used to test deduplication strategy", + type: "string" } as const; export const DeleteFooDataSchema = { - description: 'Model used to test deduplication strategy', - type: 'string' + description: "Model used to test deduplication strategy", + type: "string" } as const; export const DeleteFooData2Schema = { - description: 'Model used to test deduplication strategy', - type: 'string' + description: "Model used to test deduplication strategy", + type: "string" } as const; export const importSchema = { - description: 'Model with restricted keyword name', - type: 'string' + description: "Model with restricted keyword name", + type: "string" } as const; export const SchemaWithFormRestrictedKeysSchema = { properties: { description: { - type: 'string' + type: "string" }, 'x-enum-descriptions': { - type: 'string' + type: "string" }, 'x-enum-varnames': { - type: 'string' + type: "string" }, 'x-enumNames': { - type: 'string' + type: "string" }, title: { - type: 'string' + type: "string" }, object: { - type: 'object', + type: "object", properties: { description: { - type: 'string' + type: "string" }, 'x-enum-descriptions': { - type: 'string' + type: "string" }, 'x-enum-varnames': { - type: 'string' + type: "string" }, 'x-enumNames': { - type: 'string' + type: "string" }, title: { - type: 'string' + type: "string" } } }, array: { - type: 'array', + type: "array", items: { - type: 'object', + type: "object", properties: { description: { - type: 'string' + type: "string" }, 'x-enum-descriptions': { - type: 'string' + type: "string" }, 'x-enum-varnames': { - type: 'string' + type: "string" }, 'x-enumNames': { - type: 'string' + type: "string" }, title: { - type: 'string' + type: "string" } } } @@ -1833,77 +1972,79 @@ export const SchemaWithFormRestrictedKeysSchema = { } as const; export const io_k8s_apimachinery_pkg_apis_meta_v1_DeleteOptionsSchema = { - description: 'This schema was giving PascalCase transformations a hard time', + description: "This schema was giving PascalCase transformations a hard time", properties: { preconditions: { allOf: [ { - '$ref': '#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Preconditions' + '$ref': "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Preconditions" } ], - description: 'Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned.' + description: "Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned." } }, - type: 'object' + type: "object" } as const; export const io_k8s_apimachinery_pkg_apis_meta_v1_PreconditionsSchema = { - description: 'This schema was giving PascalCase transformations a hard time', + description: "This schema was giving PascalCase transformations a hard time", properties: { resourceVersion: { - description: 'Specifies the target ResourceVersion', - type: 'string' + description: "Specifies the target ResourceVersion", + type: "string" }, uid: { - description: 'Specifies the target UID.', - type: 'string' + description: "Specifies the target UID.", + type: "string" } }, - type: 'object' + type: "object" } as const; export const AdditionalPropertiesUnknownIssueSchema = { - type: 'object', + type: "object", additionalProperties: { anyOf: [ { - type: 'string' + type: "string" }, { - type: 'number' + type: "number" } ] } } as const; export const AdditionalPropertiesUnknownIssue2Schema = { - type: 'object', + type: "object", additionalProperties: { anyOf: [ { - type: 'string' + type: "string" }, { - type: 'number' + type: "number" } ] } } as const; export const AdditionalPropertiesUnknownIssue3Schema = { - type: 'object', + type: "object", allOf: [ { - type: 'string' + type: "string" }, { - type: 'object', - required: ['entries'], + type: "object", + required: [ + "entries" + ], properties: { entries: { - type: 'object', + type: "object", additionalProperties: { - '$ref': '#/components/schemas/AdditionalPropertiesUnknownIssue' + '$ref': "#/components/schemas/AdditionalPropertiesUnknownIssue" } } } @@ -1912,15 +2053,17 @@ export const AdditionalPropertiesUnknownIssue3Schema = { } as const; export const AdditionalPropertiesIntegerIssueSchema = { - type: 'object', - required: ['value'], + type: "object", + required: [ + "value" + ], properties: { value: { - type: 'integer' + type: "integer" } }, additionalProperties: { - type: 'integer' + type: "integer" } } as const; @@ -1931,40 +2074,40 @@ export const OneOfAllOfIssueSchema = { { oneOf: [ { - '$ref': '#/components/schemas/ConstValue' + '$ref': "#/components/schemas/ConstValue" }, { - '$ref': '#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.Boolean]' + '$ref': "#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.Boolean]" } ] }, { - '$ref': '#/components/schemas/3e-num_1Период' + '$ref': "#/components/schemas/3e-num_1Период" } ] }, { - '$ref': '#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.String]' + '$ref': "#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.String]" } ] } as const; export const Generic_Schema_Duplicate_Issue_1_System_Boolean_Schema = { - type: 'object', + type: "object", properties: { item: { - type: 'boolean' + type: "boolean" }, error: { - type: 'string', + type: "string", nullable: true }, hasError: { - type: 'boolean', + type: "boolean", readOnly: true }, data: { - type: 'object', + type: "object", additionalProperties: false } }, @@ -1972,18 +2115,18 @@ export const Generic_Schema_Duplicate_Issue_1_System_Boolean_Schema = { } as const; export const Generic_Schema_Duplicate_Issue_1_System_String_Schema = { - type: 'object', + type: "object", properties: { item: { - type: 'string', + type: "string", nullable: true }, error: { - type: 'string', + type: "string", nullable: true }, hasError: { - type: 'boolean', + type: "boolean", readOnly: true } }, @@ -1991,134 +2134,144 @@ export const Generic_Schema_Duplicate_Issue_1_System_String_Schema = { } as const; export const external_shared_ExternalSharedModelSchema = { - type: 'object', + type: "object", properties: { id: { - type: 'string' + type: "string" }, name: { - type: 'string' + type: "string" } }, - required: ['id'] + required: [ + "id" + ] } as const; export const ModelWithReferenceWritableSchema = { - description: 'This is a model with one property containing a reference', - type: 'object', + description: "This is a model with one property containing a reference", + type: "object", properties: { prop: { - '$ref': '#/components/schemas/ModelWithPropertiesWritable' + '$ref': "#/components/schemas/ModelWithPropertiesWritable" } } } as const; export const ModelWithArrayReadOnlyAndWriteOnlyWritableSchema = { - description: 'This is a model with one property containing an array', - type: 'object', + description: "This is a model with one property containing an array", + type: "object", properties: { prop: { - type: 'array', + type: "array", items: { - '$ref': '#/components/schemas/ModelWithReadOnlyAndWriteOnlyWritable' + '$ref': "#/components/schemas/ModelWithReadOnlyAndWriteOnlyWritable" } }, propWithFile: { - type: 'array', + type: "array", items: { - format: 'binary', - type: 'string' + format: "binary", + type: "string" } }, propWithNumber: { - type: 'array', + type: "array", items: { - type: 'number' + type: "number" } } } } as const; export const ModelWithPropertiesWritableSchema = { - description: 'This is a model with one nested property', - type: 'object', - required: ['required', 'requiredAndNullable'], + description: "This is a model with one nested property", + type: "object", + required: [ + "required", + "requiredAndNullable" + ], properties: { required: { - type: 'string' + type: "string" }, requiredAndNullable: { - type: 'string', + type: "string", nullable: true }, string: { - type: 'string' + type: "string" }, number: { - type: 'number' + type: "number" }, boolean: { - type: 'boolean' + type: "boolean" }, reference: { - '$ref': '#/components/schemas/ModelWithString' + '$ref': "#/components/schemas/ModelWithString" }, 'property with space': { - type: 'string' + type: "string" }, default: { - type: 'string' + type: "string" }, try: { - type: 'string' + type: "string" } } } as const; export const ModelWithPatternWritableSchema = { - description: 'This is a model that contains a some patterns', - type: 'object', - required: ['key', 'name'], + description: "This is a model that contains a some patterns", + type: "object", + required: [ + "key", + "name" + ], properties: { key: { maxLength: 64, - pattern: '^[a-zA-Z0-9_]*$', - type: 'string' + pattern: "^[a-zA-Z0-9_]*$", + type: "string" }, name: { maxLength: 255, - type: 'string' + type: "string" }, id: { - type: 'string', - pattern: '^\\d{2}-\\d{3}-\\d{4}$' + type: "string", + pattern: "^\\d{2}-\\d{3}-\\d{4}$" }, text: { - type: 'string', - pattern: '^\\w+$' + type: "string", + pattern: "^\\w+$" }, patternWithSingleQuotes: { - type: 'string', + type: "string", pattern: "^[a-zA-Z0-9']*$" }, patternWithNewline: { - type: 'string', - pattern: 'aaa\\nbbb' + type: "string", + pattern: "aaa\\nbbb" }, patternWithBacktick: { - type: 'string', - pattern: 'aaa`bbb' + type: "string", + pattern: "aaa`bbb" } } } as const; export const FileWritableSchema = { - required: ['mime'], - type: 'object', + required: [ + "mime" + ], + type: "object", properties: { mime: { - title: 'Mime', - type: 'string', + title: "Mime", + type: "string", maxLength: 24, minLength: 1 } @@ -2126,28 +2279,31 @@ export const FileWritableSchema = { } as const; export const ModelWithReadOnlyAndWriteOnlyWritableSchema = { - type: 'object', - required: ['foo', 'baz'], + type: "object", + required: [ + "foo", + "baz" + ], properties: { foo: { - type: 'string' + type: "string" }, baz: { - type: 'string', + type: "string", writeOnly: true } } } as const; export const ModelWithAnyOfConstantSizeArrayWithNSizeAndOptionsWritableSchema = { - type: 'array', + type: "array", items: { oneOf: [ { - type: 'number' + type: "number" }, { - '$ref': '#/components/schemas/import' + '$ref': "#/components/schemas/import" } ] }, @@ -2156,14 +2312,14 @@ export const ModelWithAnyOfConstantSizeArrayWithNSizeAndOptionsWritableSchema = } as const; export const AdditionalPropertiesUnknownIssueWritableSchema = { - type: 'object', + type: "object", additionalProperties: { anyOf: [ { - type: 'string' + type: "string" }, { - type: 'number' + type: "number" } ] } @@ -2176,36 +2332,36 @@ export const OneOfAllOfIssueWritableSchema = { { oneOf: [ { - '$ref': '#/components/schemas/ConstValue' + '$ref': "#/components/schemas/ConstValue" }, { - '$ref': '#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.Boolean]' + '$ref': "#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.Boolean]" } ] }, { - '$ref': '#/components/schemas/3e-num_1Период' + '$ref': "#/components/schemas/3e-num_1Период" } ] }, { - '$ref': '#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.String]' + '$ref': "#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.String]" } ] } as const; export const Generic_Schema_Duplicate_Issue_1_System_Boolean_WritableSchema = { - type: 'object', + type: "object", properties: { item: { - type: 'boolean' + type: "boolean" }, error: { - type: 'string', + type: "string", nullable: true }, data: { - type: 'object', + type: "object", additionalProperties: false } }, @@ -2213,14 +2369,14 @@ export const Generic_Schema_Duplicate_Issue_1_System_Boolean_WritableSchema = { } as const; export const Generic_Schema_Duplicate_Issue_1_System_String_WritableSchema = { - type: 'object', + type: "object", properties: { item: { - type: 'string', + type: "string", nullable: true }, error: { - type: 'string', + type: "string", nullable: true } }, diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/sdk/default/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/sdk/default/client.gen.ts index 6b55ac80f9..bf942100b1 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/sdk/default/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/sdk/default/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/sdk/throwOnError/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/sdk/throwOnError/client.gen.ts index 778e50856f..a789b61b80 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/sdk/throwOnError/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/sdk/throwOnError/client.gen.ts @@ -13,7 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base', - throwOnError: true -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base", throwOnError: true })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@pinia/colada/fetch/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@pinia/colada/fetch/client.gen.ts index 6b55ac80f9..bf942100b1 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@pinia/colada/fetch/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@pinia/colada/fetch/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/angular-query-experimental/axios/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/angular-query-experimental/axios/client.gen.ts index 27214c60f4..0bce44d4c2 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/angular-query-experimental/axios/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/angular-query-experimental/axios/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseURL: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseURL: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/angular-query-experimental/fetch/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/angular-query-experimental/fetch/client.gen.ts index 6b55ac80f9..bf942100b1 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/angular-query-experimental/fetch/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/angular-query-experimental/fetch/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/react-query/axios/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/react-query/axios/client.gen.ts index 27214c60f4..0bce44d4c2 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/react-query/axios/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/react-query/axios/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseURL: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseURL: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/react-query/fetch/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/react-query/fetch/client.gen.ts index 6b55ac80f9..bf942100b1 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/react-query/fetch/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/react-query/fetch/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/solid-query/axios/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/solid-query/axios/client.gen.ts index 27214c60f4..0bce44d4c2 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/solid-query/axios/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/solid-query/axios/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseURL: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseURL: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/solid-query/fetch/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/solid-query/fetch/client.gen.ts index 6b55ac80f9..bf942100b1 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/solid-query/fetch/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/solid-query/fetch/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/svelte-query/axios/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/svelte-query/axios/client.gen.ts index 27214c60f4..0bce44d4c2 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/svelte-query/axios/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/svelte-query/axios/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseURL: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseURL: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/svelte-query/fetch/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/svelte-query/fetch/client.gen.ts index 6b55ac80f9..bf942100b1 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/svelte-query/fetch/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/svelte-query/fetch/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/vue-query/axios/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/vue-query/axios/client.gen.ts index 27214c60f4..0bce44d4c2 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/vue-query/axios/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/vue-query/axios/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseURL: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseURL: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/vue-query/fetch/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/vue-query/fetch/client.gen.ts index 6b55ac80f9..bf942100b1 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/vue-query/fetch/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/vue-query/fetch/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/servers/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/servers/client.gen.ts index fd7b9d4cce..6b69288b55 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/servers/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/servers/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'https://foo.com/v1' -})); +export const client = createClient(createConfig({ baseUrl: "https://foo.com/v1" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/transformers-all-of/transformers.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/transformers-all-of/transformers.gen.ts index ecea8d570d..1aa399baf4 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/transformers-all-of/transformers.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/transformers-all-of/transformers.gen.ts @@ -3,16 +3,12 @@ import type { GetFooResponse } from './types.gen'; const fooSchemaResponseTransformer = (data: any) => { - data.foo = data.foo.map((item: any) => { - return barSchemaResponseTransformer(item); - }); + data.foo = data.foo.map((item: any) => barSchemaResponseTransformer(item)); return data; }; const barSchemaResponseTransformer = (data: any) => { - data.foo = data.foo.map((item: any) => { - return bazSchemaResponseTransformer(item); - }); + data.foo = data.foo.map((item: any) => bazSchemaResponseTransformer(item)); return data; }; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/transformers-any-of-null/transformers.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/transformers-any-of-null/transformers.gen.ts index 62f0dd462c..68360f01ae 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/transformers-any-of-null/transformers.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/transformers-any-of-null/transformers.gen.ts @@ -16,8 +16,6 @@ const fooSchemaResponseTransformer = (data: any) => { }; export const getFooResponseTransformer = async (data: any): Promise => { - data = data.map((item: any) => { - return fooSchemaResponseTransformer(item); - }); + data = data.map((item: any) => fooSchemaResponseTransformer(item)); return data; }; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/transformers-recursive/transformers.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/transformers-recursive/transformers.gen.ts index 5dcc632516..397ecdc84b 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/transformers-recursive/transformers.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/transformers-recursive/transformers.gen.ts @@ -7,16 +7,12 @@ const treeNodeSchemaResponseTransformer = (data: any) => { data.createdAt = new Date(data.createdAt); } if (data.children) { - data.children = data.children.map((item: any) => { - return treeNodeSchemaResponseTransformer(item); - }); + data.children = data.children.map((item: any) => treeNodeSchemaResponseTransformer(item)); } return data; }; export const getTreeResponseTransformer = async (data: any): Promise => { - data = data.map((item: any) => { - return treeNodeSchemaResponseTransformer(item); - }); + data = data.map((item: any) => treeNodeSchemaResponseTransformer(item)); return data; }; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/base-url-number/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/base-url-number/client.gen.ts index 6b55ac80f9..bf942100b1 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/base-url-number/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/base-url-number/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/base-url-strict/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/base-url-strict/client.gen.ts index 6b55ac80f9..bf942100b1 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/base-url-strict/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/base-url-strict/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/base-url-string/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/base-url-string/client.gen.ts index cf95338106..4b1a3bc294 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/base-url-string/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/base-url-string/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'https://foo.com' -})); +export const client = createClient(createConfig({ baseUrl: "https://foo.com" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/clean-false/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/clean-false/client.gen.ts index 6b55ac80f9..bf942100b1 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/clean-false/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/clean-false/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/default/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/default/client.gen.ts index 6b55ac80f9..bf942100b1 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/default/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/default/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/import-file-extension-ts/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/import-file-extension-ts/client.gen.ts index d1d0daa3d0..813724b22e 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/import-file-extension-ts/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/import-file-extension-ts/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen.ts'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/sdk-client-optional/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/sdk-client-optional/client.gen.ts index 6b55ac80f9..bf942100b1 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/sdk-client-optional/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/sdk-client-optional/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/sdk-client-required/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/sdk-client-required/client.gen.ts index 6b55ac80f9..bf942100b1 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/sdk-client-required/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/sdk-client-required/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/tsconfig-nodenext-sdk/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/tsconfig-nodenext-sdk/client.gen.ts index b470364540..63886516e0 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/tsconfig-nodenext-sdk/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/tsconfig-nodenext-sdk/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen.js'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/base-url-number/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/base-url-number/client.gen.ts index 27214c60f4..0bce44d4c2 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/base-url-number/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/base-url-number/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseURL: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseURL: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/base-url-strict/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/base-url-strict/client.gen.ts index 27214c60f4..0bce44d4c2 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/base-url-strict/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/base-url-strict/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseURL: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseURL: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/base-url-string/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/base-url-string/client.gen.ts index 37c40c5f18..6798d917f1 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/base-url-string/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/base-url-string/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseURL: 'https://foo.com' -})); +export const client = createClient(createConfig({ baseURL: "https://foo.com" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/clean-false/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/clean-false/client.gen.ts index 27214c60f4..0bce44d4c2 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/clean-false/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/clean-false/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseURL: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseURL: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/default/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/default/client.gen.ts index 27214c60f4..0bce44d4c2 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/default/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/default/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseURL: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseURL: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/import-file-extension-ts/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/import-file-extension-ts/client.gen.ts index 091544e752..df728c2a40 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/import-file-extension-ts/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/import-file-extension-ts/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen.ts'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseURL: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseURL: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/sdk-client-optional/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/sdk-client-optional/client.gen.ts index 27214c60f4..0bce44d4c2 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/sdk-client-optional/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/sdk-client-optional/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseURL: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseURL: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/sdk-client-required/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/sdk-client-required/client.gen.ts index 27214c60f4..0bce44d4c2 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/sdk-client-required/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/sdk-client-required/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseURL: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseURL: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/tsconfig-nodenext-sdk/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/tsconfig-nodenext-sdk/client.gen.ts index c7a2005ffd..2f7ac6e9fe 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/tsconfig-nodenext-sdk/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/tsconfig-nodenext-sdk/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen.js'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseURL: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseURL: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/base-url-number/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/base-url-number/client.gen.ts index 6b55ac80f9..bf942100b1 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/base-url-number/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/base-url-number/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/base-url-strict/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/base-url-strict/client.gen.ts index 6b55ac80f9..bf942100b1 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/base-url-strict/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/base-url-strict/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/base-url-string/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/base-url-string/client.gen.ts index cf95338106..4b1a3bc294 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/base-url-string/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/base-url-string/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'https://foo.com' -})); +export const client = createClient(createConfig({ baseUrl: "https://foo.com" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/clean-false/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/clean-false/client.gen.ts index 6b55ac80f9..bf942100b1 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/clean-false/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/clean-false/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/default/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/default/client.gen.ts index 6b55ac80f9..bf942100b1 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/default/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/default/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/import-file-extension-ts/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/import-file-extension-ts/client.gen.ts index d1d0daa3d0..813724b22e 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/import-file-extension-ts/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/import-file-extension-ts/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen.ts'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/sdk-client-optional/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/sdk-client-optional/client.gen.ts index 6b55ac80f9..bf942100b1 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/sdk-client-optional/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/sdk-client-optional/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/sdk-client-required/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/sdk-client-required/client.gen.ts index 6b55ac80f9..bf942100b1 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/sdk-client-required/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/sdk-client-required/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/tsconfig-nodenext-sdk/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/tsconfig-nodenext-sdk/client.gen.ts index b470364540..63886516e0 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/tsconfig-nodenext-sdk/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/tsconfig-nodenext-sdk/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen.js'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/base-url-number/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/base-url-number/client.gen.ts index 6b55ac80f9..bf942100b1 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/base-url-number/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/base-url-number/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/base-url-strict/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/base-url-strict/client.gen.ts index 6b55ac80f9..bf942100b1 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/base-url-strict/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/base-url-strict/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/base-url-string/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/base-url-string/client.gen.ts index cf95338106..4b1a3bc294 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/base-url-string/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/base-url-string/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'https://foo.com' -})); +export const client = createClient(createConfig({ baseUrl: "https://foo.com" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/clean-false/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/clean-false/client.gen.ts index 6b55ac80f9..bf942100b1 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/clean-false/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/clean-false/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/default/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/default/client.gen.ts index 6b55ac80f9..bf942100b1 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/default/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/default/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/import-file-extension-ts/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/import-file-extension-ts/client.gen.ts index d1d0daa3d0..813724b22e 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/import-file-extension-ts/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/import-file-extension-ts/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen.ts'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/sdk-client-optional/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/sdk-client-optional/client.gen.ts index 6b55ac80f9..bf942100b1 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/sdk-client-optional/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/sdk-client-optional/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/sdk-client-required/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/sdk-client-required/client.gen.ts index 6b55ac80f9..bf942100b1 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/sdk-client-required/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/sdk-client-required/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/tsconfig-nodenext-sdk/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/tsconfig-nodenext-sdk/client.gen.ts index b470364540..63886516e0 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/tsconfig-nodenext-sdk/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/tsconfig-nodenext-sdk/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen.js'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/base-url-number/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/base-url-number/client.gen.ts index 6b55ac80f9..bf942100b1 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/base-url-number/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/base-url-number/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/base-url-strict/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/base-url-strict/client.gen.ts index 6b55ac80f9..bf942100b1 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/base-url-strict/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/base-url-strict/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/base-url-string/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/base-url-string/client.gen.ts index cf95338106..4b1a3bc294 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/base-url-string/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/base-url-string/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'https://foo.com' -})); +export const client = createClient(createConfig({ baseUrl: "https://foo.com" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/clean-false/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/clean-false/client.gen.ts index 6b55ac80f9..bf942100b1 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/clean-false/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/clean-false/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/default/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/default/client.gen.ts index 6b55ac80f9..bf942100b1 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/default/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/default/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/import-file-extension-ts/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/import-file-extension-ts/client.gen.ts index d1d0daa3d0..813724b22e 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/import-file-extension-ts/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/import-file-extension-ts/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen.ts'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/sdk-client-optional/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/sdk-client-optional/client.gen.ts index 6b55ac80f9..bf942100b1 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/sdk-client-optional/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/sdk-client-optional/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/sdk-client-required/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/sdk-client-required/client.gen.ts index 6b55ac80f9..bf942100b1 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/sdk-client-required/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/sdk-client-required/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/tsconfig-nodenext-sdk/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/tsconfig-nodenext-sdk/client.gen.ts index b470364540..63886516e0 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/tsconfig-nodenext-sdk/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/tsconfig-nodenext-sdk/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen.js'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/base-url-number/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/base-url-number/client.gen.ts index 27214c60f4..0bce44d4c2 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/base-url-number/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/base-url-number/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseURL: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseURL: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/base-url-strict/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/base-url-strict/client.gen.ts index 27214c60f4..0bce44d4c2 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/base-url-strict/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/base-url-strict/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseURL: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseURL: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/base-url-string/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/base-url-string/client.gen.ts index 37c40c5f18..6798d917f1 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/base-url-string/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/base-url-string/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseURL: 'https://foo.com' -})); +export const client = createClient(createConfig({ baseURL: "https://foo.com" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/clean-false/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/clean-false/client.gen.ts index 27214c60f4..0bce44d4c2 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/clean-false/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/clean-false/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseURL: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseURL: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/default/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/default/client.gen.ts index 27214c60f4..0bce44d4c2 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/default/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/default/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseURL: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseURL: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/import-file-extension-ts/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/import-file-extension-ts/client.gen.ts index 091544e752..df728c2a40 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/import-file-extension-ts/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/import-file-extension-ts/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen.ts'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseURL: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseURL: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/sdk-client-optional/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/sdk-client-optional/client.gen.ts index 27214c60f4..0bce44d4c2 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/sdk-client-optional/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/sdk-client-optional/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseURL: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseURL: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/sdk-client-required/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/sdk-client-required/client.gen.ts index 27214c60f4..0bce44d4c2 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/sdk-client-required/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/sdk-client-required/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseURL: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseURL: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/tsconfig-nodenext-sdk/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/tsconfig-nodenext-sdk/client.gen.ts index c7a2005ffd..2f7ac6e9fe 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/tsconfig-nodenext-sdk/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/tsconfig-nodenext-sdk/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen.js'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseURL: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseURL: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/base-url-number/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/base-url-number/client.gen.ts index 6b55ac80f9..bf942100b1 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/base-url-number/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/base-url-number/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/base-url-strict/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/base-url-strict/client.gen.ts index 6b55ac80f9..bf942100b1 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/base-url-strict/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/base-url-strict/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/base-url-string/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/base-url-string/client.gen.ts index cf95338106..4b1a3bc294 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/base-url-string/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/base-url-string/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'https://foo.com' -})); +export const client = createClient(createConfig({ baseUrl: "https://foo.com" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/clean-false/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/clean-false/client.gen.ts index 6b55ac80f9..bf942100b1 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/clean-false/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/clean-false/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/default/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/default/client.gen.ts index 6b55ac80f9..bf942100b1 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/default/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/default/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/import-file-extension-ts/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/import-file-extension-ts/client.gen.ts index d1d0daa3d0..813724b22e 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/import-file-extension-ts/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/import-file-extension-ts/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen.ts'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/sdk-client-optional/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/sdk-client-optional/client.gen.ts index 6b55ac80f9..bf942100b1 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/sdk-client-optional/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/sdk-client-optional/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/sdk-client-required/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/sdk-client-required/client.gen.ts index 6b55ac80f9..bf942100b1 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/sdk-client-required/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/sdk-client-required/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/tsconfig-nodenext-sdk/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/tsconfig-nodenext-sdk/client.gen.ts index b470364540..63886516e0 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/tsconfig-nodenext-sdk/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/tsconfig-nodenext-sdk/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen.js'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/client-custom/base-url-number/custom-client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/client-custom/base-url-number/custom-client.gen.ts index 54e7e77e45..28297eb2fa 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/client-custom/base-url-number/custom-client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/client-custom/base-url-number/custom-client.gen.ts @@ -14,6 +14,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/client-custom/base-url-strict/custom-client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/client-custom/base-url-strict/custom-client.gen.ts index 54e7e77e45..28297eb2fa 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/client-custom/base-url-strict/custom-client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/client-custom/base-url-strict/custom-client.gen.ts @@ -14,6 +14,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/client-custom/base-url-string/custom-client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/client-custom/base-url-string/custom-client.gen.ts index e41b638d28..f6d8462e04 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/client-custom/base-url-string/custom-client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/client-custom/base-url-string/custom-client.gen.ts @@ -14,6 +14,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'https://foo.com' -})); +export const client = createClient(createConfig({ baseUrl: "https://foo.com" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/client-custom/bundle/custom-client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/client-custom/bundle/custom-client.gen.ts index 6b55ac80f9..bf942100b1 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/client-custom/bundle/custom-client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/client-custom/bundle/custom-client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/client-custom/default/custom-client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/client-custom/default/custom-client.gen.ts index 54e7e77e45..28297eb2fa 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/client-custom/default/custom-client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/client-custom/default/custom-client.gen.ts @@ -14,6 +14,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/client-custom/sdk-client-optional/custom-client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/client-custom/sdk-client-optional/custom-client.gen.ts index 54e7e77e45..28297eb2fa 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/client-custom/sdk-client-optional/custom-client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/client-custom/sdk-client-optional/custom-client.gen.ts @@ -14,6 +14,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/client-custom/sdk-client-required/custom-client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/client-custom/sdk-client-required/custom-client.gen.ts index 54e7e77e45..28297eb2fa 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/client-custom/sdk-client-required/custom-client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/client-custom/sdk-client-required/custom-client.gen.ts @@ -14,6 +14,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/my-client/base-url-number/custom.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/my-client/base-url-number/custom.gen.ts index 6b55ac80f9..bf942100b1 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/my-client/base-url-number/custom.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/my-client/base-url-number/custom.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/my-client/base-url-strict/custom.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/my-client/base-url-strict/custom.gen.ts index 6b55ac80f9..bf942100b1 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/my-client/base-url-strict/custom.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/my-client/base-url-strict/custom.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/my-client/base-url-string/custom.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/my-client/base-url-string/custom.gen.ts index cf95338106..4b1a3bc294 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/my-client/base-url-string/custom.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/my-client/base-url-string/custom.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'https://foo.com' -})); +export const client = createClient(createConfig({ baseUrl: "https://foo.com" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/my-client/bundle/custom.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/my-client/bundle/custom.gen.ts index 6b55ac80f9..bf942100b1 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/my-client/bundle/custom.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/my-client/bundle/custom.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/my-client/default/custom.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/my-client/default/custom.gen.ts index 6b55ac80f9..bf942100b1 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/my-client/default/custom.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/my-client/default/custom.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/my-client/sdk-client-optional/custom.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/my-client/sdk-client-optional/custom.gen.ts index 6b55ac80f9..bf942100b1 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/my-client/sdk-client-optional/custom.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/my-client/sdk-client-optional/custom.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/my-client/sdk-client-required/custom.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/my-client/sdk-client-required/custom.gen.ts index 6b55ac80f9..bf942100b1 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/my-client/sdk-client-required/custom.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/my-client/sdk-client-required/custom.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@angular/common/default-class/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@angular/common/default-class/client.gen.ts index 6b55ac80f9..bf942100b1 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@angular/common/default-class/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@angular/common/default-class/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@angular/common/default/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@angular/common/default/client.gen.ts index 6b55ac80f9..bf942100b1 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@angular/common/default/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@angular/common/default/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@hey-api/schemas/default/schemas.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@hey-api/schemas/default/schemas.gen.ts index a9d81eb745..a696a7ec2a 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@hey-api/schemas/default/schemas.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@hey-api/schemas/default/schemas.gen.ts @@ -1,216 +1,264 @@ // This file is auto-generated by @hey-api/openapi-ts export const _400Schema = { - description: 'Model with number-only name', - type: 'string' + description: "Model with number-only name", + type: "string" } as const; export const ExternalRefASchema = { - description: 'External ref to shared model (A)', - '$ref': '#/components/schemas/external-shared_ExternalSharedModel' + description: "External ref to shared model (A)", + '$ref': "#/components/schemas/external-shared_ExternalSharedModel" } as const; export const ExternalRefBSchema = { - description: 'External ref to shared model (B)', - '$ref': '#/components/schemas/external-shared_ExternalSharedModel' + description: "External ref to shared model (B)", + '$ref': "#/components/schemas/external-shared_ExternalSharedModel" } as const; export const camelCaseCommentWithBreaksSchema = { - description: `Testing multiline comments in string: First line -Second line - -Fourth line`, - type: 'integer' + description: "Testing multiline comments in string: First line\nSecond line\n\nFourth line", + type: "integer" } as const; export const CommentWithBreaksSchema = { - description: `Testing multiline comments in string: First line -Second line - -Fourth line`, - type: 'integer' + description: "Testing multiline comments in string: First line\nSecond line\n\nFourth line", + type: "integer" } as const; export const CommentWithBackticksSchema = { - description: 'Testing backticks in string: `backticks` and ```multiple backticks``` should work', - type: 'integer' + description: "Testing backticks in string: `backticks` and ```multiple backticks``` should work", + type: "integer" } as const; export const CommentWithBackticksAndQuotesSchema = { - description: `Testing backticks and quotes in string: \`backticks\`, 'quotes', "double quotes" and \`\`\`multiple backticks\`\`\` should work`, - type: 'integer' + description: "Testing backticks and quotes in string: `backticks`, 'quotes', \"double quotes\" and ```multiple backticks``` should work", + type: "integer" } as const; export const CommentWithSlashesSchema = { - description: 'Testing slashes in string: \\backwards\\\\\\ and /forwards/// should work', - type: 'integer' + description: "Testing slashes in string: \\backwards\\\\\\ and /forwards/// should work", + type: "integer" } as const; export const CommentWithExpressionPlaceholdersSchema = { - description: 'Testing expression placeholders in string: ${expression} should work', - type: 'integer' + description: "Testing expression placeholders in string: ${expression} should work", + type: "integer" } as const; export const CommentWithQuotesSchema = { - description: `Testing quotes in string: 'single quote''' and "double quotes""" should work`, - type: 'integer' + description: "Testing quotes in string: 'single quote''' and \"double quotes\"\"\" should work", + type: "integer" } as const; export const CommentWithReservedCharactersSchema = { - description: 'Testing reserved characters in string: /* inline */ and /** inline **/ should work', - type: 'integer' + description: "Testing reserved characters in string: /* inline */ and /** inline **/ should work", + type: "integer" } as const; export const SimpleIntegerSchema = { - description: 'This is a simple number', - type: 'integer' + description: "This is a simple number", + type: "integer" } as const; export const SimpleBooleanSchema = { - description: 'This is a simple boolean', - type: 'boolean' + description: "This is a simple boolean", + type: "boolean" } as const; export const SimpleStringSchema = { - description: 'This is a simple string', - type: 'string' + description: "This is a simple string", + type: "string" } as const; export const NonAsciiStringæøåÆØÅöôêÊ字符串Schema = { - description: 'A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串)', - type: 'string' + description: "A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串)", + type: "string" } as const; export const SimpleFileSchema = { - description: 'This is a simple file', - format: 'binary', - type: 'string' + description: "This is a simple file", + format: "binary", + type: "string" } as const; export const SimpleReferenceSchema = { - description: 'This is a simple reference', - '$ref': '#/components/schemas/ModelWithString' + description: "This is a simple reference", + '$ref': "#/components/schemas/ModelWithString" } as const; export const SimpleStringWithPatternSchema = { - description: 'This is a simple string', + description: "This is a simple string", maxLength: 64, - pattern: '^[a-zA-Z0-9_]*$', - type: ['string', 'null'] + pattern: "^[a-zA-Z0-9_]*$", + type: [ + "string", + "null" + ] } as const; export const EnumWithStringsSchema = { - description: 'This is a simple enum with strings', - enum: ['Success', 'Warning', 'Error', "'Single Quote'", '"Double Quotes"', 'Non-ascii: øæåôöØÆÅÔÖ字符串'] + description: "This is a simple enum with strings", + enum: [ + "Success", + "Warning", + "Error", + "'Single Quote'", + "\"Double Quotes\"", + "Non-ascii: øæåôöØÆÅÔÖ字符串" + ] } as const; export const EnumWithReplacedCharactersSchema = { - enum: ["'Single Quote'", '"Double Quotes"', 'øæåôöØÆÅÔÖ字符串', 3.1, ''], - type: 'string' + enum: [ + "'Single Quote'", + "\"Double Quotes\"", + "øæåôöØÆÅÔÖ字符串", + 3.1, + "" + ], + type: "string" } as const; export const EnumWithNumbersSchema = { - description: 'This is a simple enum with numbers', - enum: [1, 2, 3, 1.1, 1.2, 1.3, 100, 200, 300, -100, -200, -300, -1.1, -1.2, -1.3], + description: "This is a simple enum with numbers", + enum: [ + 1, + 2, + 3, + 1.1, + 1.2, + 1.3, + 100, + 200, + 300, + -100, + -200, + -300, + -1.1, + -1.2, + -1.3 + ], default: 200 } as const; export const EnumFromDescriptionSchema = { - description: 'Success=1,Warning=2,Error=3', - type: 'number' + description: "Success=1,Warning=2,Error=3", + type: "number" } as const; export const EnumWithExtensionsSchema = { - description: 'This is a simple enum with numbers', - enum: [200, 400, 500], - 'x-enum-varnames': ['CUSTOM_SUCCESS', 'CUSTOM_WARNING', 'CUSTOM_ERROR'], - 'x-enum-descriptions': ['Used when the status of something is successful', 'Used when the status of something has a warning', 'Used when the status of something has an error'] + description: "This is a simple enum with numbers", + enum: [ + 200, + 400, + 500 + ], + 'x-enum-varnames': [ + "CUSTOM_SUCCESS", + "CUSTOM_WARNING", + "CUSTOM_ERROR" + ], + 'x-enum-descriptions': [ + "Used when the status of something is successful", + "Used when the status of something has a warning", + "Used when the status of something has an error" + ] } as const; export const EnumWithXEnumNamesSchema = { - enum: [0, 1, 2], - 'x-enumNames': ['zero', 'one', 'two'] + enum: [ + 0, + 1, + 2 + ], + 'x-enumNames': [ + "zero", + "one", + "two" + ] } as const; export const ArrayWithNumbersSchema = { - description: 'This is a simple array with numbers', - type: 'array', + description: "This is a simple array with numbers", + type: "array", items: { - type: 'integer' + type: "integer" } } as const; export const ArrayWithBooleansSchema = { - description: 'This is a simple array with booleans', - type: 'array', + description: "This is a simple array with booleans", + type: "array", items: { - type: 'boolean' + type: "boolean" } } as const; export const ArrayWithStringsSchema = { - description: 'This is a simple array with strings', - type: 'array', + description: "This is a simple array with strings", + type: "array", items: { - type: 'string' + type: "string" }, - default: ['test'] + default: [ + "test" + ] } as const; export const ArrayWithReferencesSchema = { - description: 'This is a simple array with references', - type: 'array', + description: "This is a simple array with references", + type: "array", items: { - '$ref': '#/components/schemas/ModelWithString' + '$ref': "#/components/schemas/ModelWithString" } } as const; export const ArrayWithArraySchema = { - description: 'This is a simple array containing an array', - type: 'array', + description: "This is a simple array containing an array", + type: "array", items: { - type: 'array', + type: "array", items: { - '$ref': '#/components/schemas/ModelWithString' + '$ref': "#/components/schemas/ModelWithString" } } } as const; export const ArrayWithPropertiesSchema = { - description: 'This is a simple array with properties', - type: 'array', + description: "This is a simple array with properties", + type: "array", items: { - type: 'object', + type: "object", properties: { '16x16': { - '$ref': '#/components/schemas/camelCaseCommentWithBreaks' + '$ref': "#/components/schemas/camelCaseCommentWithBreaks" }, bar: { - type: 'string' + type: "string" } } } } as const; export const ArrayWithAnyOfPropertiesSchema = { - description: 'This is a simple array with any of properties', - type: 'array', + description: "This is a simple array with any of properties", + type: "array", items: { anyOf: [ { - type: 'object', + type: "object", properties: { foo: { - type: 'string', - default: 'test' + type: "string", + default: "test" } } }, { - type: 'object', + type: "object", properties: { bar: { - type: 'string' + type: "string" } } } @@ -219,13 +267,13 @@ export const ArrayWithAnyOfPropertiesSchema = { } as const; export const AnyOfAnyAndNullSchema = { - type: 'object', + type: "object", properties: { data: { anyOf: [ {}, { - type: 'null' + type: "null" } ] } @@ -233,332 +281,381 @@ export const AnyOfAnyAndNullSchema = { } as const; export const AnyOfArraysSchema = { - description: 'This is a simple array with any of properties', - type: 'object', + description: "This is a simple array with any of properties", + type: "object", properties: { results: { items: { anyOf: [ { - type: 'object', + type: "object", properties: { foo: { - type: 'string' + type: "string" } } }, { - type: 'object', + type: "object", properties: { bar: { - type: 'string' + type: "string" } } } ] }, - type: 'array' + type: "array" } } } as const; export const DictionaryWithStringSchema = { - description: 'This is a string dictionary', - type: 'object', + description: "This is a string dictionary", + type: "object", additionalProperties: { - type: 'string' + type: "string" } } as const; export const DictionaryWithPropertiesAndAdditionalPropertiesSchema = { - type: 'object', + type: "object", properties: { foo: { - type: 'number' + type: "number" }, bar: { - type: 'boolean' + type: "boolean" } }, additionalProperties: { - type: 'string' + type: "string" } } as const; export const DictionaryWithReferenceSchema = { - description: 'This is a string reference', - type: 'object', + description: "This is a string reference", + type: "object", additionalProperties: { - '$ref': '#/components/schemas/ModelWithString' + '$ref': "#/components/schemas/ModelWithString" } } as const; export const DictionaryWithArraySchema = { - description: 'This is a complex dictionary', - type: 'object', + description: "This is a complex dictionary", + type: "object", additionalProperties: { - type: 'array', + type: "array", items: { - '$ref': '#/components/schemas/ModelWithString' + '$ref': "#/components/schemas/ModelWithString" } } } as const; export const DictionaryWithDictionarySchema = { - description: 'This is a string dictionary', - type: 'object', + description: "This is a string dictionary", + type: "object", additionalProperties: { - type: 'object', + type: "object", additionalProperties: { - type: 'string' + type: "string" } } } as const; export const DictionaryWithPropertiesSchema = { - description: 'This is a complex dictionary', - type: 'object', + description: "This is a complex dictionary", + type: "object", additionalProperties: { - type: 'object', + type: "object", properties: { foo: { - type: 'string' + type: "string" }, bar: { - type: 'string' + type: "string" } } } } as const; export const ModelWithIntegerSchema = { - description: 'This is a model with one number property', - type: 'object', + description: "This is a model with one number property", + type: "object", properties: { prop: { - description: 'This is a simple number property', - type: 'integer' + description: "This is a simple number property", + type: "integer" } } } as const; export const ModelWithBooleanSchema = { - description: 'This is a model with one boolean property', - type: 'object', + description: "This is a model with one boolean property", + type: "object", properties: { prop: { - description: 'This is a simple boolean property', - type: 'boolean' + description: "This is a simple boolean property", + type: "boolean" } } } as const; export const ModelWithStringSchema = { - description: 'This is a model with one string property', - type: 'object', + description: "This is a model with one string property", + type: "object", properties: { prop: { - description: 'This is a simple string property', - type: 'string' + description: "This is a simple string property", + type: "string" } } } as const; export const ModelWithStringErrorSchema = { - description: 'This is a model with one string property', - type: 'object', + description: "This is a model with one string property", + type: "object", properties: { prop: { - description: 'This is a simple string property', - type: 'string' + description: "This is a simple string property", + type: "string" } } } as const; export const Model_From_ZendeskSchema = { - description: `\`Comment\` or \`VoiceComment\`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets)`, - type: 'string' + description: "`Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets)", + type: "string" } as const; export const ModelWithNullableStringSchema = { - description: 'This is a model with one string property', - type: 'object', - required: ['nullableRequiredProp1', 'nullableRequiredProp2'], + description: "This is a model with one string property", + type: "object", + required: [ + "nullableRequiredProp1", + "nullableRequiredProp2" + ], properties: { nullableProp1: { - description: 'This is a simple string property', - type: ['string', 'null'] + description: "This is a simple string property", + type: [ + "string", + "null" + ] }, nullableRequiredProp1: { - description: 'This is a simple string property', - type: ['string', 'null'] + description: "This is a simple string property", + type: [ + "string", + "null" + ] }, nullableProp2: { - description: 'This is a simple string property', - type: ['string', 'null'] + description: "This is a simple string property", + type: [ + "string", + "null" + ] }, nullableRequiredProp2: { - description: 'This is a simple string property', - type: ['string', 'null'] + description: "This is a simple string property", + type: [ + "string", + "null" + ] }, 'foo_bar-enum': { - description: 'This is a simple enum with strings', - enum: ['Success', 'Warning', 'Error', 'ØÆÅ字符串'] + description: "This is a simple enum with strings", + enum: [ + "Success", + "Warning", + "Error", + "ØÆÅ字符串" + ] } } } as const; export const ModelWithEnumSchema = { - description: 'This is a model with one enum', - type: 'object', + description: "This is a model with one enum", + type: "object", properties: { 'foo_bar-enum': { - description: 'This is a simple enum with strings', - enum: ['Success', 'Warning', 'Error', 'ØÆÅ字符串'] + description: "This is a simple enum with strings", + enum: [ + "Success", + "Warning", + "Error", + "ØÆÅ字符串" + ] }, statusCode: { - description: 'These are the HTTP error code enums', - enum: ['100', '200 FOO', '300 FOO_BAR', '400 foo-bar', '500 foo.bar', '600 foo&bar'] + description: "These are the HTTP error code enums", + enum: [ + "100", + "200 FOO", + "300 FOO_BAR", + "400 foo-bar", + "500 foo.bar", + "600 foo&bar" + ] }, bool: { - description: 'Simple boolean enum', - type: 'boolean', - enum: [true] + description: "Simple boolean enum", + type: "boolean", + enum: [ + true + ] } } } as const; export const ModelWithEnumWithHyphenSchema = { - description: 'This is a model with one enum with escaped name', - type: 'object', + description: "This is a model with one enum with escaped name", + type: "object", properties: { 'foo-bar-baz-qux': { - type: 'string', - enum: ['3.0'], - title: 'Foo-Bar-Baz-Qux', - default: '3.0' + type: "string", + enum: [ + "3.0" + ], + title: "Foo-Bar-Baz-Qux", + default: "3.0" } } } as const; export const ModelWithEnumFromDescriptionSchema = { - description: 'This is a model with one enum', - type: 'object', + description: "This is a model with one enum", + type: "object", properties: { test: { - type: 'integer', - description: 'Success=1,Warning=2,Error=3' + type: "integer", + description: "Success=1,Warning=2,Error=3" } } } as const; export const ModelWithNestedEnumsSchema = { - description: 'This is a model with nested enums', - type: 'object', + description: "This is a model with nested enums", + type: "object", properties: { dictionaryWithEnum: { - type: 'object', + type: "object", additionalProperties: { - enum: ['Success', 'Warning', 'Error'] + enum: [ + "Success", + "Warning", + "Error" + ] } }, dictionaryWithEnumFromDescription: { - type: 'object', + type: "object", additionalProperties: { - type: 'integer', - description: 'Success=1,Warning=2,Error=3' + type: "integer", + description: "Success=1,Warning=2,Error=3" } }, arrayWithEnum: { - type: 'array', + type: "array", items: { - enum: ['Success', 'Warning', 'Error'] + enum: [ + "Success", + "Warning", + "Error" + ] } }, arrayWithDescription: { - type: 'array', + type: "array", items: { - type: 'integer', - description: 'Success=1,Warning=2,Error=3' + type: "integer", + description: "Success=1,Warning=2,Error=3" } }, 'foo_bar-enum': { - description: 'This is a simple enum with strings', - enum: ['Success', 'Warning', 'Error', 'ØÆÅ字符串'] + description: "This is a simple enum with strings", + enum: [ + "Success", + "Warning", + "Error", + "ØÆÅ字符串" + ] } } } as const; export const ModelWithReferenceSchema = { - description: 'This is a model with one property containing a reference', - type: 'object', + description: "This is a model with one property containing a reference", + type: "object", properties: { prop: { - '$ref': '#/components/schemas/ModelWithProperties' + '$ref': "#/components/schemas/ModelWithProperties" } } } as const; export const ModelWithArrayReadOnlyAndWriteOnlySchema = { - description: 'This is a model with one property containing an array', - type: 'object', + description: "This is a model with one property containing an array", + type: "object", properties: { prop: { - type: 'array', + type: "array", items: { - '$ref': '#/components/schemas/ModelWithReadOnlyAndWriteOnly' + '$ref': "#/components/schemas/ModelWithReadOnlyAndWriteOnly" } }, propWithFile: { - type: 'array', + type: "array", items: { - format: 'binary', - type: 'string' + format: "binary", + type: "string" } }, propWithNumber: { - type: 'array', + type: "array", items: { - type: 'number' + type: "number" } } } } as const; export const ModelWithArraySchema = { - description: 'This is a model with one property containing an array', - type: 'object', + description: "This is a model with one property containing an array", + type: "object", properties: { prop: { - type: 'array', + type: "array", items: { - '$ref': '#/components/schemas/ModelWithString' + '$ref': "#/components/schemas/ModelWithString" } }, propWithFile: { - type: 'array', + type: "array", items: { - format: 'binary', - type: 'string' + format: "binary", + type: "string" } }, propWithNumber: { - type: 'array', + type: "array", items: { - type: 'number' + type: "number" } } } } as const; export const ModelWithDictionarySchema = { - description: 'This is a model with one property containing a dictionary', - type: 'object', + description: "This is a model with one property containing a dictionary", + type: "object", properties: { prop: { - type: 'object', + type: "object", additionalProperties: { - type: 'string' + type: "string" } } } @@ -566,45 +663,45 @@ export const ModelWithDictionarySchema = { export const DeprecatedModelSchema = { deprecated: true, - description: 'This is a deprecated model with a deprecated property', - type: 'object', + description: "This is a deprecated model with a deprecated property", + type: "object", properties: { prop: { deprecated: true, - description: 'This is a deprecated property', - type: 'string' + description: "This is a deprecated property", + type: "string" } } } as const; export const ModelWithCircularReferenceSchema = { - description: 'This is a model with one property containing a circular reference', - type: 'object', + description: "This is a model with one property containing a circular reference", + type: "object", properties: { prop: { - '$ref': '#/components/schemas/ModelWithCircularReference' + '$ref': "#/components/schemas/ModelWithCircularReference" } } } as const; export const CompositionWithOneOfSchema = { description: "This is a model with one property with a 'one of' relationship", - type: 'object', + type: "object", properties: { propA: { - type: 'object', + type: "object", oneOf: [ { - '$ref': '#/components/schemas/ModelWithString' + '$ref': "#/components/schemas/ModelWithString" }, { - '$ref': '#/components/schemas/ModelWithEnum' + '$ref': "#/components/schemas/ModelWithEnum" }, { - '$ref': '#/components/schemas/ModelWithArray' + '$ref': "#/components/schemas/ModelWithArray" }, { - '$ref': '#/components/schemas/ModelWithDictionary' + '$ref': "#/components/schemas/ModelWithDictionary" } ] } @@ -613,27 +710,27 @@ export const CompositionWithOneOfSchema = { export const CompositionWithOneOfAnonymousSchema = { description: "This is a model with one property with a 'one of' relationship where the options are not $ref", - type: 'object', + type: "object", properties: { propA: { - type: 'object', + type: "object", oneOf: [ { - description: 'Anonymous object type', - type: 'object', + description: "Anonymous object type", + type: "object", properties: { propA: { - type: 'string' + type: "string" } } }, { - description: 'Anonymous string type', - type: 'string' + description: "Anonymous string type", + type: "string" }, { - description: 'Anonymous integer type', - type: 'integer' + description: "Anonymous integer type", + type: "integer" } ] } @@ -641,71 +738,75 @@ export const CompositionWithOneOfAnonymousSchema = { } as const; export const ModelCircleSchema = { - description: 'Circle', - type: 'object', - required: ['kind'], + description: "Circle", + type: "object", + required: [ + "kind" + ], properties: { kind: { - type: 'string' + type: "string" }, radius: { - type: 'number' + type: "number" } } } as const; export const ModelSquareSchema = { - description: 'Square', - type: 'object', - required: ['kind'], + description: "Square", + type: "object", + required: [ + "kind" + ], properties: { kind: { - type: 'string' + type: "string" }, sideLength: { - type: 'number' + type: "number" } } } as const; export const CompositionWithOneOfDiscriminatorSchema = { description: "This is a model with one property with a 'one of' relationship where the options are not $ref", - type: 'object', + type: "object", oneOf: [ { - '$ref': '#/components/schemas/ModelCircle' + '$ref': "#/components/schemas/ModelCircle" }, { - '$ref': '#/components/schemas/ModelSquare' + '$ref': "#/components/schemas/ModelSquare" } ], discriminator: { - propertyName: 'kind', + propertyName: "kind", mapping: { - circle: '#/components/schemas/ModelCircle', - square: '#/components/schemas/ModelSquare' + circle: "#/components/schemas/ModelCircle", + square: "#/components/schemas/ModelSquare" } } } as const; export const CompositionWithAnyOfSchema = { description: "This is a model with one property with a 'any of' relationship", - type: 'object', + type: "object", properties: { propA: { - type: 'object', + type: "object", anyOf: [ { - '$ref': '#/components/schemas/ModelWithString' + '$ref': "#/components/schemas/ModelWithString" }, { - '$ref': '#/components/schemas/ModelWithEnum' + '$ref': "#/components/schemas/ModelWithEnum" }, { - '$ref': '#/components/schemas/ModelWithArray' + '$ref': "#/components/schemas/ModelWithArray" }, { - '$ref': '#/components/schemas/ModelWithDictionary' + '$ref': "#/components/schemas/ModelWithDictionary" } ] } @@ -714,27 +815,27 @@ export const CompositionWithAnyOfSchema = { export const CompositionWithAnyOfAnonymousSchema = { description: "This is a model with one property with a 'any of' relationship where the options are not $ref", - type: 'object', + type: "object", properties: { propA: { - type: 'object', + type: "object", anyOf: [ { - description: 'Anonymous object type', - type: 'object', + description: "Anonymous object type", + type: "object", properties: { propA: { - type: 'string' + type: "string" } } }, { - description: 'Anonymous string type', - type: 'string' + description: "Anonymous string type", + type: "string" }, { - description: 'Anonymous integer type', - type: 'integer' + description: "Anonymous integer type", + type: "integer" } ] } @@ -743,36 +844,36 @@ export const CompositionWithAnyOfAnonymousSchema = { export const CompositionWithNestedAnyAndTypeNullSchema = { description: "This is a model with nested 'any of' property with a type null", - type: 'object', + type: "object", properties: { propA: { - type: 'object', + type: "object", anyOf: [ { items: { anyOf: [ { - '$ref': '#/components/schemas/ModelWithDictionary' + '$ref': "#/components/schemas/ModelWithDictionary" }, { - type: 'null' + type: "null" } ] }, - type: 'array' + type: "array" }, { items: { anyOf: [ { - '$ref': '#/components/schemas/ModelWithArray' + '$ref': "#/components/schemas/ModelWithArray" }, { - type: 'null' + type: "null" } ] }, - type: 'array' + type: "array" } ] } @@ -780,18 +881,21 @@ export const CompositionWithNestedAnyAndTypeNullSchema = { } as const; export const _3e_num_1ПериодSchema = { - enum: ['Bird', 'Dog'], - type: 'string' + enum: [ + "Bird", + "Dog" + ], + type: "string" } as const; export const ConstValueSchema = { - type: 'string', - const: 'ConstValue' + type: "string", + const: "ConstValue" } as const; export const CompositionWithNestedAnyOfAndNullSchema = { description: "This is a model with one property with a 'any of' relationship where the options are not $ref", - type: 'object', + type: "object", properties: { propA: { anyOf: [ @@ -799,47 +903,50 @@ export const CompositionWithNestedAnyOfAndNullSchema = { items: { anyOf: [ { - '$ref': '#/components/schemas/3e-num_1Период' + '$ref': "#/components/schemas/3e-num_1Период" }, { - '$ref': '#/components/schemas/ConstValue' + '$ref': "#/components/schemas/ConstValue" } ] }, - type: 'array' + type: "array" }, { - type: 'null' + type: "null" } ], - title: 'Scopes' + title: "Scopes" } } } as const; export const CompositionWithOneOfAndNullableSchema = { description: "This is a model with one property with a 'one of' relationship", - type: 'object', + type: "object", properties: { propA: { - type: ['object', 'null'], + type: [ + "object", + "null" + ], oneOf: [ { - type: 'object', + type: "object", properties: { boolean: { - type: 'boolean' + type: "boolean" } } }, { - '$ref': '#/components/schemas/ModelWithEnum' + '$ref': "#/components/schemas/ModelWithEnum" }, { - '$ref': '#/components/schemas/ModelWithArray' + '$ref': "#/components/schemas/ModelWithArray" }, { - '$ref': '#/components/schemas/ModelWithDictionary' + '$ref': "#/components/schemas/ModelWithDictionary" } ] } @@ -847,18 +954,18 @@ export const CompositionWithOneOfAndNullableSchema = { } as const; export const CompositionWithOneOfAndSimpleDictionarySchema = { - description: 'This is a model that contains a simple dictionary within composition', - type: 'object', + description: "This is a model that contains a simple dictionary within composition", + type: "object", properties: { propA: { oneOf: [ { - type: 'boolean' + type: "boolean" }, { - type: 'object', + type: "object", additionalProperties: { - type: 'number' + type: "number" } } ] @@ -867,20 +974,20 @@ export const CompositionWithOneOfAndSimpleDictionarySchema = { } as const; export const CompositionWithOneOfAndSimpleArrayDictionarySchema = { - description: 'This is a model that contains a dictionary of simple arrays within composition', - type: 'object', + description: "This is a model that contains a dictionary of simple arrays within composition", + type: "object", properties: { propA: { oneOf: [ { - type: 'boolean' + type: "boolean" }, { - type: 'object', + type: "object", additionalProperties: { - type: 'array', + type: "array", items: { - type: 'boolean' + type: "boolean" } } } @@ -890,25 +997,25 @@ export const CompositionWithOneOfAndSimpleArrayDictionarySchema = { } as const; export const CompositionWithOneOfAndComplexArrayDictionarySchema = { - description: 'This is a model that contains a dictionary of complex arrays (composited) within composition', - type: 'object', + description: "This is a model that contains a dictionary of complex arrays (composited) within composition", + type: "object", properties: { propA: { oneOf: [ { - type: 'boolean' + type: "boolean" }, { - type: 'object', + type: "object", additionalProperties: { - type: 'array', + type: "array", items: { oneOf: [ { - type: 'number' + type: "number" }, { - type: 'string' + type: "string" } ] } @@ -921,27 +1028,30 @@ export const CompositionWithOneOfAndComplexArrayDictionarySchema = { export const CompositionWithAllOfAndNullableSchema = { description: "This is a model with one property with a 'all of' relationship", - type: 'object', + type: "object", properties: { propA: { - type: ['object', 'null'], + type: [ + "object", + "null" + ], allOf: [ { - type: 'object', + type: "object", properties: { boolean: { - type: 'boolean' + type: "boolean" } } }, { - '$ref': '#/components/schemas/ModelWithEnum' + '$ref': "#/components/schemas/ModelWithEnum" }, { - '$ref': '#/components/schemas/ModelWithArray' + '$ref': "#/components/schemas/ModelWithArray" }, { - '$ref': '#/components/schemas/ModelWithDictionary' + '$ref': "#/components/schemas/ModelWithDictionary" } ] } @@ -950,27 +1060,30 @@ export const CompositionWithAllOfAndNullableSchema = { export const CompositionWithAnyOfAndNullableSchema = { description: "This is a model with one property with a 'any of' relationship", - type: 'object', + type: "object", properties: { propA: { - type: ['object', 'null'], + type: [ + "object", + "null" + ], anyOf: [ { - type: 'object', + type: "object", properties: { boolean: { - type: 'boolean' + type: "boolean" } } }, { - '$ref': '#/components/schemas/ModelWithEnum' + '$ref': "#/components/schemas/ModelWithEnum" }, { - '$ref': '#/components/schemas/ModelWithArray' + '$ref': "#/components/schemas/ModelWithArray" }, { - '$ref': '#/components/schemas/ModelWithDictionary' + '$ref': "#/components/schemas/ModelWithDictionary" } ] } @@ -978,98 +1091,124 @@ export const CompositionWithAnyOfAndNullableSchema = { } as const; export const CompositionBaseModelSchema = { - description: 'This is a base model with two simple optional properties', - type: 'object', + description: "This is a base model with two simple optional properties", + type: "object", properties: { firstName: { - type: 'string' + type: "string" }, lastname: { - type: 'string' + type: "string" } } } as const; export const CompositionExtendedModelSchema = { - description: 'This is a model that extends the base model', - type: 'object', + description: "This is a model that extends the base model", + type: "object", allOf: [ { - '$ref': '#/components/schemas/CompositionBaseModel' + '$ref': "#/components/schemas/CompositionBaseModel" } ], properties: { age: { - type: 'number' + type: "number" } }, - required: ['firstName', 'lastname', 'age'] + required: [ + "firstName", + "lastname", + "age" + ] } as const; export const ModelWithPropertiesSchema = { - description: 'This is a model with one nested property', - type: 'object', - required: ['required', 'requiredAndReadOnly', 'requiredAndNullable'], + description: "This is a model with one nested property", + type: "object", + required: [ + "required", + "requiredAndReadOnly", + "requiredAndNullable" + ], properties: { required: { - type: 'string' + type: "string" }, requiredAndReadOnly: { - type: 'string', + type: "string", readOnly: true }, requiredAndNullable: { - type: ['string', 'null'] + type: [ + "string", + "null" + ] }, string: { - type: 'string' + type: "string" }, number: { - type: 'number' + type: "number" }, boolean: { - type: 'boolean' + type: "boolean" }, reference: { - '$ref': '#/components/schemas/ModelWithString' + '$ref': "#/components/schemas/ModelWithString" }, 'property with space': { - type: 'string' + type: "string" }, default: { - type: 'string' + type: "string" }, try: { - type: 'string' + type: "string" }, '@namespace.string': { - type: 'string', + type: "string", readOnly: true }, '@namespace.integer': { - type: 'integer', + type: "integer", readOnly: true } } } as const; export const ModelWithNestedPropertiesSchema = { - description: 'This is a model with one nested property', - type: 'object', - required: ['first'], + description: "This is a model with one nested property", + type: "object", + required: [ + "first" + ], properties: { first: { - type: ['object', 'null'], - required: ['second'], + type: [ + "object", + "null" + ], + required: [ + "second" + ], readOnly: true, properties: { second: { - type: ['object', 'null'], - required: ['third'], + type: [ + "object", + "null" + ], + required: [ + "third" + ], readOnly: true, properties: { third: { - type: ['string', 'null'], + type: [ + "string", + "null" + ], required: true, readOnly: true } @@ -1081,62 +1220,62 @@ export const ModelWithNestedPropertiesSchema = { } as const; export const ModelWithDuplicatePropertiesSchema = { - description: 'This is a model with duplicated properties', - type: 'object', + description: "This is a model with duplicated properties", + type: "object", properties: { prop: { - '$ref': '#/components/schemas/ModelWithString' + '$ref': "#/components/schemas/ModelWithString" } } } as const; export const ModelWithOrderedPropertiesSchema = { - description: 'This is a model with ordered properties', - type: 'object', + description: "This is a model with ordered properties", + type: "object", properties: { zebra: { - type: 'string' + type: "string" }, apple: { - type: 'string' + type: "string" }, hawaii: { - type: 'string' + type: "string" } } } as const; export const ModelWithDuplicateImportsSchema = { - description: 'This is a model with duplicated imports', - type: 'object', + description: "This is a model with duplicated imports", + type: "object", properties: { propA: { - '$ref': '#/components/schemas/ModelWithString' + '$ref': "#/components/schemas/ModelWithString" }, propB: { - '$ref': '#/components/schemas/ModelWithString' + '$ref': "#/components/schemas/ModelWithString" }, propC: { - '$ref': '#/components/schemas/ModelWithString' + '$ref': "#/components/schemas/ModelWithString" } } } as const; export const ModelThatExtendsSchema = { - description: 'This is a model that extends another model', - type: 'object', + description: "This is a model that extends another model", + type: "object", allOf: [ { - '$ref': '#/components/schemas/ModelWithString' + '$ref': "#/components/schemas/ModelWithString" }, { - type: 'object', + type: "object", properties: { propExtendsA: { - type: 'string' + type: "string" }, propExtendsB: { - '$ref': '#/components/schemas/ModelWithString' + '$ref': "#/components/schemas/ModelWithString" } } } @@ -1144,23 +1283,23 @@ export const ModelThatExtendsSchema = { } as const; export const ModelThatExtendsExtendsSchema = { - description: 'This is a model that extends another model', - type: 'object', + description: "This is a model that extends another model", + type: "object", allOf: [ { - '$ref': '#/components/schemas/ModelWithString' + '$ref': "#/components/schemas/ModelWithString" }, { - '$ref': '#/components/schemas/ModelThatExtends' + '$ref': "#/components/schemas/ModelThatExtends" }, { - type: 'object', + type: "object", properties: { propExtendsC: { - type: 'string' + type: "string" }, propExtendsD: { - '$ref': '#/components/schemas/ModelWithString' + '$ref': "#/components/schemas/ModelWithString" } } } @@ -1168,142 +1307,147 @@ export const ModelThatExtendsExtendsSchema = { } as const; export const ModelWithPatternSchema = { - description: 'This is a model that contains a some patterns', - type: 'object', - required: ['key', 'name'], + description: "This is a model that contains a some patterns", + type: "object", + required: [ + "key", + "name" + ], properties: { key: { maxLength: 64, - pattern: '^[a-zA-Z0-9_]*$', - type: 'string' + pattern: "^[a-zA-Z0-9_]*$", + type: "string" }, name: { maxLength: 255, - type: 'string' + type: "string" }, enabled: { - type: 'boolean', + type: "boolean", readOnly: true }, modified: { - type: 'string', - format: 'date-time', + type: "string", + format: "date-time", readOnly: true }, id: { - type: 'string', - pattern: '^\\d{2}-\\d{3}-\\d{4}$' + type: "string", + pattern: "^\\d{2}-\\d{3}-\\d{4}$" }, text: { - type: 'string', - pattern: '^\\w+$' + type: "string", + pattern: "^\\w+$" }, patternWithSingleQuotes: { - type: 'string', + type: "string", pattern: "^[a-zA-Z0-9']*$" }, patternWithNewline: { - type: 'string', - pattern: 'aaa\\nbbb' + type: "string", + pattern: "aaa\\nbbb" }, patternWithBacktick: { - type: 'string', - pattern: 'aaa`bbb' + type: "string", + pattern: "aaa`bbb" } } } as const; export const FileSchema = { - required: ['mime'], - type: 'object', + required: [ + "mime" + ], + type: "object", properties: { id: { - title: 'Id', - type: 'string', + title: "Id", + type: "string", readOnly: true, minLength: 1 }, updated_at: { - title: 'Updated at', - type: 'string', - format: 'date-time', + title: "Updated at", + type: "string", + format: "date-time", readOnly: true }, created_at: { - title: 'Created at', - type: 'string', - format: 'date-time', + title: "Created at", + type: "string", + format: "date-time", readOnly: true }, mime: { - title: 'Mime', - type: 'string', + title: "Mime", + type: "string", maxLength: 24, minLength: 1 }, file: { - title: 'File', - type: 'string', + title: "File", + type: "string", readOnly: true, - format: 'uri' + format: "uri" } } } as const; export const defaultSchema = { - type: 'object', + type: "object", properties: { name: { - type: 'string' + type: "string" } } } as const; export const PageableSchema = { - type: 'object', + type: "object", properties: { page: { minimum: 0, - type: 'integer', - format: 'int32', + type: "integer", + format: "int32", default: 0 }, size: { minimum: 1, - type: 'integer', - format: 'int32' + type: "integer", + format: "int32" }, sort: { - type: 'array', + type: "array", items: { - type: 'string' + type: "string" } } } } as const; export const FreeFormObjectWithoutAdditionalPropertiesSchema = { - description: 'This is a free-form object without additionalProperties.', - type: 'object' + description: "This is a free-form object without additionalProperties.", + type: "object" } as const; export const FreeFormObjectWithAdditionalPropertiesEqTrueSchema = { - description: 'This is a free-form object with additionalProperties: true.', - type: 'object', + description: "This is a free-form object with additionalProperties: true.", + type: "object", additionalProperties: true } as const; export const FreeFormObjectWithAdditionalPropertiesEqEmptyObjectSchema = { - description: 'This is a free-form object with additionalProperties: {}.', - type: 'object', + description: "This is a free-form object with additionalProperties: {}.", + type: "object", additionalProperties: {} } as const; export const ModelWithConstSchema = { - type: 'object', + type: "object", properties: { String: { - const: 'String' + const: "String" }, number: { const: 0 @@ -1312,19 +1456,19 @@ export const ModelWithConstSchema = { const: null }, withType: { - type: 'string', - const: 'Some string' + type: "string", + const: "Some string" } } } as const; export const ModelWithAdditionalPropertiesEqTrueSchema = { - description: 'This is a model with one property and additionalProperties: true', - type: 'object', + description: "This is a model with one property and additionalProperties: true", + type: "object", properties: { prop: { - description: 'This is a simple string property', - type: 'string' + description: "This is a simple string property", + type: "string" } }, additionalProperties: true @@ -1338,84 +1482,97 @@ export const NestedAnyOfArraysNullableSchema = { items: { anyOf: [ { - type: 'string' + type: "string" }, { - type: 'boolean' + type: "boolean" } ] }, - type: 'array' + type: "array" }, { - type: 'null' + type: "null" } ] } }, - type: 'object' + type: "object" } as const; export const CompositionWithOneOfAndPropertiesSchema = { - type: 'object', + type: "object", oneOf: [ { - type: 'object', - required: ['foo'], + type: "object", + required: [ + "foo" + ], properties: { foo: { - '$ref': '#/components/parameters/SimpleParameter' + '$ref': "#/components/parameters/SimpleParameter" } }, additionalProperties: false }, { - type: 'object', - required: ['bar'], + type: "object", + required: [ + "bar" + ], properties: { bar: { - '$ref': '#/components/schemas/NonAsciiStringæøåÆØÅöôêÊ字符串' + '$ref': "#/components/schemas/NonAsciiStringæøåÆØÅöôêÊ字符串" } }, additionalProperties: false } ], - required: ['baz', 'qux'], + required: [ + "baz", + "qux" + ], properties: { baz: { - type: ['integer', 'null'], - format: 'uint16', + type: [ + "integer", + "null" + ], + format: "uint16", minimum: 0 }, qux: { - type: 'integer', - format: 'uint8', + type: "integer", + format: "uint8", minimum: 0 } } } as const; export const NullableObjectSchema = { - type: ['object', 'null'], - description: 'An object that can be null', + type: [ + "object", + "null" + ], + description: "An object that can be null", properties: { foo: { - type: 'string' + type: "string" } }, default: null } as const; export const CharactersInDescriptionSchema = { - type: 'string', - description: 'Some % character' + type: "string", + description: "Some % character" } as const; export const ModelWithNullableObjectSchema = { - type: 'object', + type: "object", properties: { data: { - '$ref': '#/components/schemas/NullableObject' + '$ref': "#/components/schemas/NullableObject" } } } as const; @@ -1423,70 +1580,92 @@ export const ModelWithNullableObjectSchema = { export const ModelWithOneOfEnumSchema = { oneOf: [ { - type: 'object', - required: ['foo'], + type: "object", + required: [ + "foo" + ], properties: { foo: { - type: 'string', - enum: ['Bar'] + type: "string", + enum: [ + "Bar" + ] } } }, { - type: 'object', - required: ['foo'], + type: "object", + required: [ + "foo" + ], properties: { foo: { - type: 'string', - enum: ['Baz'] + type: "string", + enum: [ + "Baz" + ] } } }, { - type: 'object', - required: ['foo'], + type: "object", + required: [ + "foo" + ], properties: { foo: { - type: 'string', - enum: ['Qux'] + type: "string", + enum: [ + "Qux" + ] } } }, { - type: 'object', - required: ['content', 'foo'], + type: "object", + required: [ + "content", + "foo" + ], properties: { content: { - type: 'string', - format: 'date-time' + type: "string", + format: "date-time" }, foo: { - type: 'string', - enum: ['Quux'] + type: "string", + enum: [ + "Quux" + ] } } }, { - type: 'object', - required: ['content', 'foo'], + type: "object", + required: [ + "content", + "foo" + ], properties: { content: { - type: 'array', + type: "array", prefixItems: [ { - type: 'string', - format: 'date-time' + type: "string", + format: "date-time" }, { - type: 'string' + type: "string" } ], maxItems: 2, minItems: 2 }, foo: { - type: 'string', - enum: ['Corge'] + type: "string", + enum: [ + "Corge" + ] } } } @@ -1494,46 +1673,52 @@ export const ModelWithOneOfEnumSchema = { } as const; export const ModelWithNestedArrayEnumsDataFooSchema = { - enum: ['foo', 'bar'], - type: 'string' + enum: [ + "foo", + "bar" + ], + type: "string" } as const; export const ModelWithNestedArrayEnumsDataBarSchema = { - enum: ['baz', 'qux'], - type: 'string' + enum: [ + "baz", + "qux" + ], + type: "string" } as const; export const ModelWithNestedArrayEnumsDataSchema = { - type: 'object', + type: "object", properties: { foo: { - type: 'array', + type: "array", items: { - '$ref': '#/components/schemas/ModelWithNestedArrayEnumsDataFoo' + '$ref': "#/components/schemas/ModelWithNestedArrayEnumsDataFoo" } }, bar: { - type: 'array', + type: "array", items: { - '$ref': '#/components/schemas/ModelWithNestedArrayEnumsDataBar' + '$ref': "#/components/schemas/ModelWithNestedArrayEnumsDataBar" } } } } as const; export const ModelWithNestedArrayEnumsSchema = { - type: 'object', + type: "object", properties: { array_strings: { - type: 'array', + type: "array", items: { - type: 'string' + type: "string" } }, data: { allOf: [ { - '$ref': '#/components/schemas/ModelWithNestedArrayEnumsData' + '$ref': "#/components/schemas/ModelWithNestedArrayEnumsData" } ] } @@ -1541,12 +1726,12 @@ export const ModelWithNestedArrayEnumsSchema = { } as const; export const ModelWithNestedCompositionEnumsSchema = { - type: 'object', + type: "object", properties: { foo: { allOf: [ { - '$ref': '#/components/schemas/ModelWithNestedArrayEnumsDataFoo' + '$ref': "#/components/schemas/ModelWithNestedArrayEnumsDataFoo" } ] } @@ -1554,37 +1739,40 @@ export const ModelWithNestedCompositionEnumsSchema = { } as const; export const ModelWithReadOnlyAndWriteOnlySchema = { - type: 'object', - required: ['foo', 'bar'], + type: "object", + required: [ + "foo", + "bar" + ], properties: { foo: { - type: 'string' + type: "string" }, bar: { readOnly: true, - type: 'string' + type: "string" } } } as const; export const ModelWithConstantSizeArraySchema = { - type: 'array', + type: "array", items: { - type: 'number' + type: "number" }, minItems: 2, maxItems: 2 } as const; export const ModelWithAnyOfConstantSizeArraySchema = { - type: 'array', + type: "array", items: { oneOf: [ { - type: 'number' + type: "number" }, { - type: 'string' + type: "string" } ] }, @@ -1593,36 +1781,41 @@ export const ModelWithAnyOfConstantSizeArraySchema = { } as const; export const ModelWithPrefixItemsConstantSizeArraySchema = { - type: 'array', + type: "array", prefixItems: [ { - '$ref': '#/components/schemas/ModelWithInteger' + '$ref': "#/components/schemas/ModelWithInteger" }, { oneOf: [ { - type: 'number' + type: "number" }, { - type: 'string' + type: "string" } ] }, { - type: 'string' + type: "string" } ] } as const; export const ModelWithAnyOfConstantSizeArrayNullableSchema = { - type: ['array'], + type: [ + "array" + ], items: { oneOf: [ { - type: ['number', 'null'] + type: [ + "number", + "null" + ] }, { - type: 'string' + type: "string" } ] }, @@ -1631,14 +1824,14 @@ export const ModelWithAnyOfConstantSizeArrayNullableSchema = { } as const; export const ModelWithAnyOfConstantSizeArrayWithNSizeAndOptionsSchema = { - type: 'array', + type: "array", items: { oneOf: [ { - type: 'number' + type: "number" }, { - '$ref': '#/components/schemas/import' + '$ref': "#/components/schemas/import" } ] }, @@ -1647,14 +1840,14 @@ export const ModelWithAnyOfConstantSizeArrayWithNSizeAndOptionsSchema = { } as const; export const ModelWithAnyOfConstantSizeArrayAndIntersectSchema = { - type: 'array', + type: "array", items: { allOf: [ { - type: 'number' + type: "number" }, { - type: 'string' + type: "string" } ] }, @@ -1663,165 +1856,153 @@ export const ModelWithAnyOfConstantSizeArrayAndIntersectSchema = { } as const; export const ModelWithNumericEnumUnionSchema = { - type: 'object', + type: "object", properties: { value: { - type: 'number', - description: 'Период', - enum: [-10, -1, 0, 1, 3, 6, 12] + type: "number", + description: "Период", + enum: [ + -10, + -1, + 0, + 1, + 3, + 6, + 12 + ] } } } as const; export const ModelWithBackticksInDescriptionSchema = { - description: 'Some description with `back ticks`', - type: 'object', + description: "Some description with `back ticks`", + type: "object", properties: { template: { - type: 'string', - description: `The template \`that\` should be used for parsing and importing the contents of the CSV file. - -

There is one placeholder currently supported:

  • \${x} - refers to the n-th column in the CSV file, e.g. \${1}, \${2}, ...)

Example of a correct JSON template:

-
-[
-  {
-    "resourceType": "Asset",
-    "identifier": {
-      "name": "\${1}",
-      "domain": {
-        "name": "\${2}",
-        "community": {
-          "name": "Some Community"
-        }
-      }
-    },
-    "attributes" : {
-      "00000000-0000-0000-0000-000000003115" : [ {
-        "value" : "\${3}"
-      } ],
-      "00000000-0000-0000-0000-000000000222" : [ {
-        "value" : "\${4}"
-      } ]
-    }
-  }
-]
-
` + type: "string", + description: "The template `that` should be used for parsing and importing the contents of the CSV file.\n\n

There is one placeholder currently supported:

  • ${x} - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)

Example of a correct JSON template:

\n
\n[\n  {\n    \"resourceType\": \"Asset\",\n    \"identifier\": {\n      \"name\": \"${1}\",\n      \"domain\": {\n        \"name\": \"${2}\",\n        \"community\": {\n          \"name\": \"Some Community\"\n        }\n      }\n    },\n    \"attributes\" : {\n      \"00000000-0000-0000-0000-000000003115\" : [ {\n        \"value\" : \"${3}\"\n      } ],\n      \"00000000-0000-0000-0000-000000000222\" : [ {\n        \"value\" : \"${4}\"\n      } ]\n    }\n  }\n]\n
" } } } as const; export const ModelWithOneOfAndPropertiesSchema = { - type: 'object', + type: "object", oneOf: [ { - '$ref': '#/components/parameters/SimpleParameter' + '$ref': "#/components/parameters/SimpleParameter" }, { - '$ref': '#/components/schemas/NonAsciiStringæøåÆØÅöôêÊ字符串' + '$ref': "#/components/schemas/NonAsciiStringæøåÆØÅöôêÊ字符串" } ], - required: ['baz', 'qux'], + required: [ + "baz", + "qux" + ], properties: { baz: { - type: ['integer', 'null'], - format: 'uint16', + type: [ + "integer", + "null" + ], + format: "uint16", minimum: 0 }, qux: { - type: 'integer', - format: 'uint8', + type: "integer", + format: "uint8", minimum: 0 } } } as const; export const ParameterSimpleParameterUnusedSchema = { - description: 'Model used to test deduplication strategy (unused)', - type: 'string' + description: "Model used to test deduplication strategy (unused)", + type: "string" } as const; export const PostServiceWithEmptyTagResponseSchema = { - description: 'Model used to test deduplication strategy', - type: 'string' + description: "Model used to test deduplication strategy", + type: "string" } as const; export const PostServiceWithEmptyTagResponse2Schema = { - description: 'Model used to test deduplication strategy', - type: 'string' + description: "Model used to test deduplication strategy", + type: "string" } as const; export const DeleteFooDataSchema = { - description: 'Model used to test deduplication strategy', - type: 'string' + description: "Model used to test deduplication strategy", + type: "string" } as const; export const DeleteFooData2Schema = { - description: 'Model used to test deduplication strategy', - type: 'string' + description: "Model used to test deduplication strategy", + type: "string" } as const; export const importSchema = { - description: 'Model with restricted keyword name', - type: 'string' + description: "Model with restricted keyword name", + type: "string" } as const; export const SchemaWithFormRestrictedKeysSchema = { - type: 'object', + type: "object", properties: { description: { - type: 'string' + type: "string" }, 'x-enum-descriptions': { - type: 'string' + type: "string" }, 'x-enum-varnames': { - type: 'string' + type: "string" }, 'x-enumNames': { - type: 'string' + type: "string" }, title: { - type: 'string' + type: "string" }, object: { - type: 'object', + type: "object", properties: { description: { - type: 'string' + type: "string" }, 'x-enum-descriptions': { - type: 'string' + type: "string" }, 'x-enum-varnames': { - type: 'string' + type: "string" }, 'x-enumNames': { - type: 'string' + type: "string" }, title: { - type: 'string' + type: "string" } } }, array: { - type: 'array', + type: "array", items: { - type: 'object', + type: "object", properties: { description: { - type: 'string' + type: "string" }, 'x-enum-descriptions': { - type: 'string' + type: "string" }, 'x-enum-varnames': { - type: 'string' + type: "string" }, 'x-enumNames': { - type: 'string' + type: "string" }, title: { - type: 'string' + type: "string" } } } @@ -1830,77 +2011,79 @@ export const SchemaWithFormRestrictedKeysSchema = { } as const; export const io_k8s_apimachinery_pkg_apis_meta_v1_DeleteOptionsSchema = { - description: 'This schema was giving PascalCase transformations a hard time', + description: "This schema was giving PascalCase transformations a hard time", properties: { preconditions: { allOf: [ { - '$ref': '#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Preconditions' + '$ref': "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Preconditions" } ], - description: 'Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned.' + description: "Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned." } }, - type: 'object' + type: "object" } as const; export const io_k8s_apimachinery_pkg_apis_meta_v1_PreconditionsSchema = { - description: 'This schema was giving PascalCase transformations a hard time', + description: "This schema was giving PascalCase transformations a hard time", properties: { resourceVersion: { - description: 'Specifies the target ResourceVersion', - type: 'string' + description: "Specifies the target ResourceVersion", + type: "string" }, uid: { - description: 'Specifies the target UID.', - type: 'string' + description: "Specifies the target UID.", + type: "string" } }, - type: 'object' + type: "object" } as const; export const AdditionalPropertiesUnknownIssueSchema = { - type: 'object', + type: "object", additionalProperties: { anyOf: [ { - type: 'string' + type: "string" }, { - type: 'number' + type: "number" } ] } } as const; export const AdditionalPropertiesUnknownIssue2Schema = { - type: 'object', + type: "object", additionalProperties: { anyOf: [ { - type: 'string' + type: "string" }, { - type: 'number' + type: "number" } ] } } as const; export const AdditionalPropertiesUnknownIssue3Schema = { - type: 'object', + type: "object", allOf: [ { - type: 'string' + type: "string" }, { - type: 'object', - required: ['entries'], + type: "object", + required: [ + "entries" + ], properties: { entries: { - type: 'object', + type: "object", additionalProperties: { - '$ref': '#/components/schemas/AdditionalPropertiesUnknownIssue' + '$ref': "#/components/schemas/AdditionalPropertiesUnknownIssue" } } } @@ -1909,15 +2092,17 @@ export const AdditionalPropertiesUnknownIssue3Schema = { } as const; export const AdditionalPropertiesIntegerIssueSchema = { - type: 'object', - required: ['value'], + type: "object", + required: [ + "value" + ], properties: { value: { - type: 'integer' + type: "integer" } }, additionalProperties: { - type: 'integer' + type: "integer" } } as const; @@ -1928,39 +2113,42 @@ export const OneOfAllOfIssueSchema = { { oneOf: [ { - '$ref': '#/components/schemas/ConstValue' + '$ref': "#/components/schemas/ConstValue" }, { - '$ref': '#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.Boolean]' + '$ref': "#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.Boolean]" } ] }, { - '$ref': '#/components/schemas/3e-num_1Период' + '$ref': "#/components/schemas/3e-num_1Период" } ] }, { - '$ref': '#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.String]' + '$ref': "#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.String]" } ] } as const; export const Generic_Schema_Duplicate_Issue_1_System_Boolean_Schema = { - type: 'object', + type: "object", properties: { item: { - type: 'boolean' + type: "boolean" }, error: { - type: ['string', 'null'] + type: [ + "string", + "null" + ] }, hasError: { - type: 'boolean', + type: "boolean", readOnly: true }, data: { - type: 'object', + type: "object", additionalProperties: false } }, @@ -1968,16 +2156,22 @@ export const Generic_Schema_Duplicate_Issue_1_System_Boolean_Schema = { } as const; export const Generic_Schema_Duplicate_Issue_1_System_String_Schema = { - type: 'object', + type: "object", properties: { item: { - type: ['string', 'null'] + type: [ + "string", + "null" + ] }, error: { - type: ['string', 'null'] + type: [ + "string", + "null" + ] }, hasError: { - type: 'boolean', + type: "boolean", readOnly: true } }, @@ -1985,133 +2179,146 @@ export const Generic_Schema_Duplicate_Issue_1_System_String_Schema = { } as const; export const external_shared_ExternalSharedModelSchema = { - type: 'object', + type: "object", properties: { id: { - type: 'string' + type: "string" }, name: { - type: 'string' + type: "string" } }, - required: ['id'] + required: [ + "id" + ] } as const; export const ModelWithReferenceWritableSchema = { - description: 'This is a model with one property containing a reference', - type: 'object', + description: "This is a model with one property containing a reference", + type: "object", properties: { prop: { - '$ref': '#/components/schemas/ModelWithPropertiesWritable' + '$ref': "#/components/schemas/ModelWithPropertiesWritable" } } } as const; export const ModelWithArrayReadOnlyAndWriteOnlyWritableSchema = { - description: 'This is a model with one property containing an array', - type: 'object', + description: "This is a model with one property containing an array", + type: "object", properties: { prop: { - type: 'array', + type: "array", items: { - '$ref': '#/components/schemas/ModelWithReadOnlyAndWriteOnlyWritable' + '$ref': "#/components/schemas/ModelWithReadOnlyAndWriteOnlyWritable" } }, propWithFile: { - type: 'array', + type: "array", items: { - format: 'binary', - type: 'string' + format: "binary", + type: "string" } }, propWithNumber: { - type: 'array', + type: "array", items: { - type: 'number' + type: "number" } } } } as const; export const ModelWithPropertiesWritableSchema = { - description: 'This is a model with one nested property', - type: 'object', - required: ['required', 'requiredAndNullable'], + description: "This is a model with one nested property", + type: "object", + required: [ + "required", + "requiredAndNullable" + ], properties: { required: { - type: 'string' + type: "string" }, requiredAndNullable: { - type: ['string', 'null'] + type: [ + "string", + "null" + ] }, string: { - type: 'string' + type: "string" }, number: { - type: 'number' + type: "number" }, boolean: { - type: 'boolean' + type: "boolean" }, reference: { - '$ref': '#/components/schemas/ModelWithString' + '$ref': "#/components/schemas/ModelWithString" }, 'property with space': { - type: 'string' + type: "string" }, default: { - type: 'string' + type: "string" }, try: { - type: 'string' + type: "string" } } } as const; export const ModelWithPatternWritableSchema = { - description: 'This is a model that contains a some patterns', - type: 'object', - required: ['key', 'name'], + description: "This is a model that contains a some patterns", + type: "object", + required: [ + "key", + "name" + ], properties: { key: { maxLength: 64, - pattern: '^[a-zA-Z0-9_]*$', - type: 'string' + pattern: "^[a-zA-Z0-9_]*$", + type: "string" }, name: { maxLength: 255, - type: 'string' + type: "string" }, id: { - type: 'string', - pattern: '^\\d{2}-\\d{3}-\\d{4}$' + type: "string", + pattern: "^\\d{2}-\\d{3}-\\d{4}$" }, text: { - type: 'string', - pattern: '^\\w+$' + type: "string", + pattern: "^\\w+$" }, patternWithSingleQuotes: { - type: 'string', + type: "string", pattern: "^[a-zA-Z0-9']*$" }, patternWithNewline: { - type: 'string', - pattern: 'aaa\\nbbb' + type: "string", + pattern: "aaa\\nbbb" }, patternWithBacktick: { - type: 'string', - pattern: 'aaa`bbb' + type: "string", + pattern: "aaa`bbb" } } } as const; export const FileWritableSchema = { - required: ['mime'], - type: 'object', + required: [ + "mime" + ], + type: "object", properties: { mime: { - title: 'Mime', - type: 'string', + title: "Mime", + type: "string", maxLength: 24, minLength: 1 } @@ -2119,28 +2326,31 @@ export const FileWritableSchema = { } as const; export const ModelWithReadOnlyAndWriteOnlyWritableSchema = { - type: 'object', - required: ['foo', 'baz'], + type: "object", + required: [ + "foo", + "baz" + ], properties: { foo: { - type: 'string' + type: "string" }, baz: { - type: 'string', + type: "string", writeOnly: true } } } as const; export const ModelWithAnyOfConstantSizeArrayWithNSizeAndOptionsWritableSchema = { - type: 'array', + type: "array", items: { oneOf: [ { - type: 'number' + type: "number" }, { - '$ref': '#/components/schemas/import' + '$ref': "#/components/schemas/import" } ] }, @@ -2149,14 +2359,14 @@ export const ModelWithAnyOfConstantSizeArrayWithNSizeAndOptionsWritableSchema = } as const; export const AdditionalPropertiesUnknownIssueWritableSchema = { - type: 'object', + type: "object", additionalProperties: { anyOf: [ { - type: 'string' + type: "string" }, { - type: 'number' + type: "number" } ] } @@ -2169,35 +2379,38 @@ export const OneOfAllOfIssueWritableSchema = { { oneOf: [ { - '$ref': '#/components/schemas/ConstValue' + '$ref': "#/components/schemas/ConstValue" }, { - '$ref': '#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.Boolean]' + '$ref': "#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.Boolean]" } ] }, { - '$ref': '#/components/schemas/3e-num_1Период' + '$ref': "#/components/schemas/3e-num_1Период" } ] }, { - '$ref': '#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.String]' + '$ref': "#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.String]" } ] } as const; export const Generic_Schema_Duplicate_Issue_1_System_Boolean_WritableSchema = { - type: 'object', + type: "object", properties: { item: { - type: 'boolean' + type: "boolean" }, error: { - type: ['string', 'null'] + type: [ + "string", + "null" + ] }, data: { - type: 'object', + type: "object", additionalProperties: false } }, @@ -2205,13 +2418,19 @@ export const Generic_Schema_Duplicate_Issue_1_System_Boolean_WritableSchema = { } as const; export const Generic_Schema_Duplicate_Issue_1_System_String_WritableSchema = { - type: 'object', + type: "object", properties: { item: { - type: ['string', 'null'] + type: [ + "string", + "null" + ] }, error: { - type: ['string', 'null'] + type: [ + "string", + "null" + ] } }, additionalProperties: false diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@hey-api/sdk/default/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@hey-api/sdk/default/client.gen.ts index 6b55ac80f9..bf942100b1 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@hey-api/sdk/default/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@hey-api/sdk/default/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@hey-api/sdk/throwOnError/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@hey-api/sdk/throwOnError/client.gen.ts index 778e50856f..a789b61b80 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@hey-api/sdk/throwOnError/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@hey-api/sdk/throwOnError/client.gen.ts @@ -13,7 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base', - throwOnError: true -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base", throwOnError: true })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@pinia/colada/fetch/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@pinia/colada/fetch/client.gen.ts index 6b55ac80f9..bf942100b1 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@pinia/colada/fetch/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@pinia/colada/fetch/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/angular-query-experimental/axios/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/angular-query-experimental/axios/client.gen.ts index 27214c60f4..0bce44d4c2 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/angular-query-experimental/axios/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/angular-query-experimental/axios/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseURL: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseURL: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/angular-query-experimental/fetch/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/angular-query-experimental/fetch/client.gen.ts index 6b55ac80f9..bf942100b1 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/angular-query-experimental/fetch/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/angular-query-experimental/fetch/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/react-query/axios/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/react-query/axios/client.gen.ts index 27214c60f4..0bce44d4c2 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/react-query/axios/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/react-query/axios/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseURL: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseURL: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/react-query/fetch/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/react-query/fetch/client.gen.ts index 6b55ac80f9..bf942100b1 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/react-query/fetch/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/react-query/fetch/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/solid-query/axios/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/solid-query/axios/client.gen.ts index 27214c60f4..0bce44d4c2 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/solid-query/axios/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/solid-query/axios/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseURL: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseURL: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/solid-query/fetch/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/solid-query/fetch/client.gen.ts index 6b55ac80f9..bf942100b1 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/solid-query/fetch/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/solid-query/fetch/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/svelte-query/axios/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/svelte-query/axios/client.gen.ts index 27214c60f4..0bce44d4c2 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/svelte-query/axios/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/svelte-query/axios/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseURL: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseURL: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/svelte-query/fetch/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/svelte-query/fetch/client.gen.ts index 6b55ac80f9..bf942100b1 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/svelte-query/fetch/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/svelte-query/fetch/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/vue-query/axios/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/vue-query/axios/client.gen.ts index 27214c60f4..0bce44d4c2 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/vue-query/axios/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/vue-query/axios/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseURL: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseURL: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/vue-query/fetch/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/vue-query/fetch/client.gen.ts index 6b55ac80f9..bf942100b1 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/vue-query/fetch/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/vue-query/fetch/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:3000/base' -})); +export const client = createClient(createConfig({ baseUrl: "http://localhost:3000/base" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/servers/client.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/servers/client.gen.ts index fd7b9d4cce..6b69288b55 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/servers/client.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/servers/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'https://foo.com/v1' -})); +export const client = createClient(createConfig({ baseUrl: "https://foo.com/v1" })); diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/transformers-all-of/transformers.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/transformers-all-of/transformers.gen.ts index ecea8d570d..1aa399baf4 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/transformers-all-of/transformers.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/transformers-all-of/transformers.gen.ts @@ -3,16 +3,12 @@ import type { GetFooResponse } from './types.gen'; const fooSchemaResponseTransformer = (data: any) => { - data.foo = data.foo.map((item: any) => { - return barSchemaResponseTransformer(item); - }); + data.foo = data.foo.map((item: any) => barSchemaResponseTransformer(item)); return data; }; const barSchemaResponseTransformer = (data: any) => { - data.foo = data.foo.map((item: any) => { - return bazSchemaResponseTransformer(item); - }); + data.foo = data.foo.map((item: any) => bazSchemaResponseTransformer(item)); return data; }; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/transformers-any-of-null/transformers.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/transformers-any-of-null/transformers.gen.ts index c3a28994ce..3d9ad63868 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/transformers-any-of-null/transformers.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/transformers-any-of-null/transformers.gen.ts @@ -19,9 +19,7 @@ const fooSchemaResponseTransformer = (data: any) => { }; export const getFooResponseTransformer = async (data: any): Promise => { - data = data.map((item: any) => { - return fooSchemaResponseTransformer(item); - }); + data = data.map((item: any) => fooSchemaResponseTransformer(item)); return data; }; diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/transformers-recursive/transformers.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/transformers-recursive/transformers.gen.ts index 5dcc632516..397ecdc84b 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/transformers-recursive/transformers.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/transformers-recursive/transformers.gen.ts @@ -7,16 +7,12 @@ const treeNodeSchemaResponseTransformer = (data: any) => { data.createdAt = new Date(data.createdAt); } if (data.children) { - data.children = data.children.map((item: any) => { - return treeNodeSchemaResponseTransformer(item); - }); + data.children = data.children.map((item: any) => treeNodeSchemaResponseTransformer(item)); } return data; }; export const getTreeResponseTransformer = async (data: any): Promise => { - data = data.map((item: any) => { - return treeNodeSchemaResponseTransformer(item); - }); + data = data.map((item: any) => treeNodeSchemaResponseTransformer(item)); return data; }; diff --git a/packages/openapi-ts/src/plugins/@hey-api/client-core/client.ts b/packages/openapi-ts/src/plugins/@hey-api/client-core/client.ts index 2e15033b62..70a5710a93 100644 --- a/packages/openapi-ts/src/plugins/@hey-api/client-core/client.ts +++ b/packages/openapi-ts/src/plugins/@hey-api/client-core/client.ts @@ -1,5 +1,5 @@ import { clientFolderAbsolutePath } from '~/generate/client'; -import { tsc } from '~/tsc'; +import { $ } from '~/ts-dsl'; import { parseUrl } from '~/utils/url'; import type { PluginHandler } from './types'; @@ -51,7 +51,7 @@ export const createClient: PluginHandler = ({ plugin }) => { }) : undefined; - const defaultValues: Array = []; + const defaultVals = $.object(); const resolvedBaseUrl = resolveBaseUrlString({ plugin: plugin as any, @@ -59,60 +59,46 @@ export const createClient: PluginHandler = ({ plugin }) => { if (resolvedBaseUrl) { const url = parseUrl(resolvedBaseUrl); if (url.protocol && url.host && !resolvedBaseUrl.includes('{')) { - defaultValues.push({ - key: getClientBaseUrlKey(plugin.context.config), - value: resolvedBaseUrl, - }); + defaultVals.prop( + getClientBaseUrlKey(plugin.context.config), + $.literal(resolvedBaseUrl), + ); } else if (resolvedBaseUrl !== '/' && resolvedBaseUrl.startsWith('/')) { const baseUrl = resolvedBaseUrl.endsWith('/') ? resolvedBaseUrl.slice(0, -1) : resolvedBaseUrl; - defaultValues.push({ - key: getClientBaseUrlKey(plugin.context.config), - value: baseUrl, - }); + defaultVals.prop( + getClientBaseUrlKey(plugin.context.config), + $.literal(baseUrl), + ); } } if ('throwOnError' in plugin.config && plugin.config.throwOnError) { - defaultValues.push({ - key: 'throwOnError', - value: true, - }); + defaultVals.prop('throwOnError', $.literal(true)); } const createConfigParameters = [ - tsc.callExpression({ - functionName: symbolCreateConfig.placeholder, - parameters: defaultValues.length - ? [tsc.objectExpression({ obj: defaultValues })] - : undefined, - types: [ - tsc.typeReferenceNode({ typeName: symbolClientOptions.placeholder }), - ], - }), + $(symbolCreateConfig.placeholder) + .call(defaultVals.hasProps() ? defaultVals : undefined) + .generic(symbolClientOptions.placeholder), ]; const symbolClient = plugin.registerSymbol({ + exported: true, meta: { category: 'client', }, name: 'client', }); - const statement = tsc.constVariable({ - exportConst: true, - expression: tsc.callExpression({ - functionName: symbolCreateClient.placeholder, - parameters: symbolCreateClientConfig - ? [ - tsc.callExpression({ - functionName: symbolCreateClientConfig.placeholder, - parameters: createConfigParameters, - }), - ] - : createConfigParameters, - }), - name: symbolClient.placeholder, - }); + const statement = $.const(symbolClient.placeholder) + .export(symbolClient.exported) + .assign( + $(symbolCreateClient.placeholder).$if( + symbolCreateClientConfig, + (c, s) => c.call($(s.placeholder).call(...createConfigParameters)), + (c) => c.call(...createConfigParameters), + ), + ); plugin.setSymbolValue(symbolClient, statement); }; diff --git a/packages/openapi-ts/src/plugins/@hey-api/client-core/createClientConfig.ts b/packages/openapi-ts/src/plugins/@hey-api/client-core/createClientConfig.ts index 9b88109939..6e75295542 100644 --- a/packages/openapi-ts/src/plugins/@hey-api/client-core/createClientConfig.ts +++ b/packages/openapi-ts/src/plugins/@hey-api/client-core/createClientConfig.ts @@ -1,5 +1,5 @@ import { clientFolderAbsolutePath } from '~/generate/client'; -import { tsc } from '~/tsc'; +import { $ } from '~/ts-dsl'; import type { PluginHandler } from './types'; @@ -28,60 +28,44 @@ export const createClientConfigType = ({ name: 'CreateClientConfig', }); - const defaultClientOptionsType = tsc.typeReferenceNode({ - typeName: symbolDefaultClientOptions.placeholder, - }); - const tType = tsc.typeReferenceNode({ typeName: 'T' }); - const typeCreateClientConfig = tsc.typeAliasDeclaration({ - comment: [ + const typeCreateClientConfig = $.type + .alias(symbolCreateClientConfig.placeholder) + .export(symbolCreateClientConfig.exported) + .doc([ 'The `createClientConfig()` function will be called on client initialization', "and the returned object will become the client's initial configuration.", '', 'You may want to initialize your client this way instead of calling', "`setConfig()`. This is useful for example if you're using Next.js", 'to ensure your client always has the correct values.', - ], - exportType: symbolCreateClientConfig.exported, - name: symbolCreateClientConfig.placeholder, - type: tsc.functionTypeNode({ - parameters: [ - tsc.parameterDeclaration({ - name: 'override', - required: false, - type: tsc.typeReferenceNode({ - typeArguments: [ - tsc.typeIntersectionNode({ - types: [defaultClientOptionsType, tType], - }), - ], - typeName: symbolConfig.placeholder, - }), - }), - ], - returnType: tsc.typeReferenceNode({ - typeArguments: [ - tsc.typeIntersectionNode({ - types: [ - tsc.typeReferenceNode({ - typeArguments: [defaultClientOptionsType], - typeName: 'Required', - }), - tType, - ], - }), - ], - typeName: symbolConfig.placeholder, - }), - }), - typeParameters: [ - { - default: tsc.typeReferenceNode({ - typeName: symbolClientOptions.placeholder, - }), - extends: defaultClientOptionsType, - name: 'T', - }, - ], - }); + ]) + .generic('T', (g) => + g + .extends(symbolDefaultClientOptions.placeholder) + .default(symbolClientOptions.placeholder), + ) + .type( + $.type + .func() + .param('override', (p) => + p + .optional() + .type( + $.type(symbolConfig.placeholder).generic( + $.type.and(symbolDefaultClientOptions.placeholder, 'T'), + ), + ), + ) + .returns( + $.type(symbolConfig.placeholder).generic( + $.type.and( + $.type('Required').generic( + symbolDefaultClientOptions.placeholder, + ), + 'T', + ), + ), + ), + ); plugin.setSymbolValue(symbolCreateClientConfig, typeCreateClientConfig); }; diff --git a/packages/openapi-ts/src/plugins/@hey-api/schemas/plugin.ts b/packages/openapi-ts/src/plugins/@hey-api/schemas/plugin.ts index 52760f31ed..9acad877d2 100644 --- a/packages/openapi-ts/src/plugins/@hey-api/schemas/plugin.ts +++ b/packages/openapi-ts/src/plugins/@hey-api/schemas/plugin.ts @@ -5,7 +5,7 @@ import type { OpenApiV3_0_XTypes } from '~/openApi/3.0.x'; import type { OpenApiV3_1_XTypes } from '~/openApi/3.1.x'; import { ensureValidIdentifier } from '~/openApi/shared/utils/identifier'; import type { OpenApi } from '~/openApi/types'; -import { tsc } from '~/tsc'; +import { $ } from '~/ts-dsl'; import type { HeyApiSchemasPlugin } from './types'; @@ -383,12 +383,15 @@ const schemasV2_0_X = ({ plugin, schema, }); - const statement = tsc.constVariable({ - assertion: 'const', - exportConst: symbol.exported, - expression: tsc.objectExpression({ obj }), - name: symbol.placeholder, - }); + const statement = $.const(symbol.placeholder) + .export(symbol.exported) + .assign( + $( + $.toExpr(obj, { + layout: 'pretty', + })!, + ).as('const'), + ); plugin.setSymbolValue(symbol, statement); } }; @@ -421,12 +424,15 @@ const schemasV3_0_X = ({ plugin, schema, }); - const statement = tsc.constVariable({ - assertion: 'const', - exportConst: symbol.exported, - expression: tsc.objectExpression({ obj }), - name: symbol.placeholder, - }); + const statement = $.const(symbol.placeholder) + .export(symbol.exported) + .assign( + $( + $.toExpr(obj, { + layout: 'pretty', + })!, + ).as('const'), + ); plugin.setSymbolValue(symbol, statement); } }; @@ -459,12 +465,15 @@ const schemasV3_1_X = ({ plugin, schema, }); - const statement = tsc.constVariable({ - assertion: 'const', - exportConst: symbol.exported, - expression: tsc.objectExpression({ obj }), - name: symbol.placeholder, - }); + const statement = $.const(symbol.placeholder) + .export(symbol.exported) + .assign( + $( + $.toExpr(obj, { + layout: 'pretty', + })!, + ).as('const'), + ); plugin.setSymbolValue(symbol, statement); } }; diff --git a/packages/openapi-ts/src/plugins/@hey-api/transformers/expressions.ts b/packages/openapi-ts/src/plugins/@hey-api/transformers/expressions.ts index 070bd06a9c..ea6701d187 100644 --- a/packages/openapi-ts/src/plugins/@hey-api/transformers/expressions.ts +++ b/packages/openapi-ts/src/plugins/@hey-api/transformers/expressions.ts @@ -1,7 +1,7 @@ import type ts from 'typescript'; import type { IR } from '~/ir/types'; -import { tsc } from '~/tsc'; +import { $ } from '~/ts-dsl'; import type { UserConfig } from './types'; @@ -11,9 +11,12 @@ export type ExpressionTransformer = ({ schema, }: { config: Omit; - dataExpression?: ts.Expression | string; + dataExpression?: + | ts.Expression + | ReturnType + | string; schema: IR.SchemaObject; -}) => Array | undefined; +}) => Array>> | undefined; export const bigIntExpressions: ExpressionTransformer = ({ dataExpression, @@ -25,17 +28,7 @@ export const bigIntExpressions: ExpressionTransformer = ({ const bigIntCallExpression = dataExpression !== undefined - ? tsc.callExpression({ - functionName: 'BigInt', - parameters: [ - tsc.callExpression({ - functionName: tsc.propertyAccessExpression({ - expression: dataExpression, - name: 'toString', - }), - }), - ], - }) + ? $('BigInt').call($.expr(dataExpression).attr('toString').call()) : undefined; if (bigIntCallExpression) { @@ -44,12 +37,7 @@ export const bigIntExpressions: ExpressionTransformer = ({ } if (dataExpression) { - return [ - tsc.assignment({ - left: dataExpression, - right: bigIntCallExpression, - }), - ]; + return [$.expr(dataExpression).assign(bigIntCallExpression)]; } } @@ -67,27 +55,12 @@ export const dateExpressions: ExpressionTransformer = ({ return; } - const identifierDate = tsc.identifier({ text: 'Date' }); - if (typeof dataExpression === 'string') { - return [ - tsc.newExpression({ - argumentsArray: [tsc.identifier({ text: dataExpression })], - expression: identifierDate, - }), - ]; + return [$.new('Date').arg(dataExpression)]; } if (dataExpression) { - return [ - tsc.assignment({ - left: dataExpression, - right: tsc.newExpression({ - argumentsArray: [dataExpression], - expression: identifierDate, - }), - }), - ]; + return [$.expr(dataExpression).assign($.new('Date').arg(dataExpression))]; } return; diff --git a/packages/openapi-ts/src/plugins/@hey-api/transformers/plugin.ts b/packages/openapi-ts/src/plugins/@hey-api/transformers/plugin.ts index dae5451295..9d68986c9a 100644 --- a/packages/openapi-ts/src/plugins/@hey-api/transformers/plugin.ts +++ b/packages/openapi-ts/src/plugins/@hey-api/transformers/plugin.ts @@ -4,7 +4,8 @@ import ts from 'typescript'; import { createOperationKey, operationResponsesMap } from '~/ir/operation'; import type { IR } from '~/ir/types'; import { buildName } from '~/openApi/shared/utils/name'; -import { tsc } from '~/tsc'; +import { $ } from '~/ts-dsl'; +import { TsDsl } from '~/ts-dsl'; import { refToName } from '~/utils/ref'; import type { HeyApiTransformersPlugin } from './types'; @@ -15,20 +16,30 @@ const dataVariableName = 'data'; // can emit calls to transformers that will be implemented later. const buildingSymbols = new Set(); +type Expr = NonNullable< + ReturnType +>; + const ensureStatements = ( - nodes: Array, -): Array => - nodes.map((node) => - ts.isStatement(node) - ? node - : tsc.expressionToStatement({ expression: node }), - ); + nodes: Array, +): Array> => + nodes.map((node) => { + if (node instanceof TsDsl) { + node = node.$render(); + } + return $.toStmt(node); + }); const isNodeReturnStatement = ({ node, }: { - node: ts.Expression | ts.Statement; -}) => node.kind === ts.SyntaxKind.ReturnStatement; + node: ts.Expression | ts.Statement | Expr; +}) => { + if (node instanceof TsDsl) { + node = node.$render(); + } + return node.kind === ts.SyntaxKind.ReturnStatement; +}; const schemaResponseTransformerNodes = ({ plugin, @@ -36,19 +47,18 @@ const schemaResponseTransformerNodes = ({ }: { plugin: HeyApiTransformersPlugin['Instance']; schema: IR.SchemaObject; -}): Array => { - const identifierData = tsc.identifier({ text: dataVariableName }); +}): Array => { const nodes = processSchemaType({ - dataExpression: identifierData, + dataExpression: $(dataVariableName), plugin, schema, }); // append return statement if one does not already exist - if ( - nodes.length && - !isNodeReturnStatement({ node: nodes[nodes.length - 1]! }) - ) { - nodes.push(tsc.returnStatement({ expression: identifierData })); + if (nodes.length) { + const last = nodes[nodes.length - 1]!; + if (!isNodeReturnStatement({ node: last })) { + nodes.push($.return(dataVariableName)); + } } return nodes; }; @@ -58,10 +68,13 @@ const processSchemaType = ({ plugin, schema, }: { - dataExpression?: ts.Expression | string; + dataExpression?: + | ts.Expression + | string + | ReturnType; plugin: HeyApiTransformersPlugin['Instance']; schema: IR.SchemaObject; -}): Array => { +}): Array => { if (schema.$ref) { const query: SymbolMeta = { category: 'transform', @@ -106,21 +119,12 @@ const processSchemaType = ({ }); if (nodes.length) { - const node = tsc.constVariable({ - expression: tsc.arrowFunction({ - async: false, - multiLine: true, - parameters: [ - { - name: dataVariableName, - // TODO: parser - add types, generate types without transforms - type: tsc.keywordTypeNode({ keyword: 'any' }), - }, - ], - statements: ensureStatements(nodes), - }), - name: symbol.placeholder, - }); + const node = $.const(symbol.placeholder).assign( + // TODO: parser - add types, generate types without transforms + $.func() + .param(dataVariableName, (p) => p.type('any')) + .do(...ensureStatements(nodes)), + ); plugin.setSymbolValue(symbol, node); } } finally { @@ -134,28 +138,18 @@ const processSchemaType = ({ const currentValue = plugin.gen.symbols.getValue(symbol.id); if (currentValue || buildingSymbols.has(symbol.id)) { const ref = plugin.referenceSymbol(query); - const callExpression = tsc.callExpression({ - functionName: ref.placeholder, - parameters: [dataExpression], - }); + const callExpression = $(ref.placeholder).call(dataExpression); if (dataExpression) { // In a map callback, the item needs to be returned, not just the transformation result if (typeof dataExpression === 'string' && dataExpression === 'item') { - return [ - tsc.returnStatement({ - expression: callExpression, - }), - ]; + return [$.return(callExpression)]; } return [ typeof dataExpression === 'string' ? callExpression - : tsc.assignment({ - left: dataExpression, - right: callExpression, - }), + : $(dataExpression).assign(callExpression), ]; } } @@ -193,48 +187,31 @@ const processSchemaType = ({ ); if (!hasReturnStatement) { - mapCallbackStatements.push( - tsc.returnStatement({ - expression: tsc.identifier({ text: 'item' }), - }), - ); + mapCallbackStatements.push($.return('item')); } return [ - tsc.assignment({ - left: dataExpression, - right: tsc.callExpression({ - functionName: tsc.propertyAccessExpression({ - expression: dataExpression, - name: 'map', - }), - parameters: [ - tsc.arrowFunction({ - multiLine: true, - parameters: [ - { - name: 'item', - type: 'any', - }, - ], - statements: mapCallbackStatements, - }), - ], - }), - }), + $(dataExpression).assign( + $(dataExpression) + .attr('map') + .call( + $.func() + .param('item', (p) => p.type('any')) + .do(...mapCallbackStatements), + ), + ), ]; } if (schema.type === 'object') { - let nodes: Array = []; + let nodes: Array = []; const required = schema.required ?? []; for (const name in schema.properties) { const property = schema.properties[name]!; - const propertyAccessExpression = tsc.propertyAccessExpression({ - expression: dataExpression || dataVariableName, - name, - }); + const propertyAccessExpression = $( + dataExpression || dataVariableName, + ).attr(name); const propertyNodes = processSchemaType({ dataExpression: propertyAccessExpression, plugin, @@ -256,12 +233,7 @@ const processSchemaType = ({ // todo: Probably, it would make more sense to go with if(x !== undefined && x !== null) instead of if(x) // this place influences all underlying transformers, while it's not exactly transformer itself // Keep in mind that !!0 === false, so it already makes output for Bigint undesirable - tsc.ifStatement({ - expression: propertyAccessExpression, - thenStatement: tsc.block({ - statements: ensureStatements(propertyNodes), - }), - }), + $.if(propertyAccessExpression).do(...ensureStatements(propertyNodes)), ); } } @@ -278,7 +250,7 @@ const processSchemaType = ({ }); } - let arrayNodes: Array = []; + let arrayNodes: Array = []; // process 2 items if one of them is null if ( schema.logicalOperator === 'and' || @@ -297,16 +269,10 @@ const processSchemaType = ({ if (dataExpression) { arrayNodes = arrayNodes.concat(nodes); } else { - const identifierItem = tsc.identifier({ text: 'item' }); // processed means the item was transformed arrayNodes.push( - tsc.ifStatement({ - expression: identifierItem, - thenStatement: tsc.block({ - statements: ensureStatements(nodes), - }), - }), - tsc.returnStatement({ expression: identifierItem }), + $.if('item').do(...ensureStatements(nodes)), + $.return('item'), ); } } @@ -393,28 +359,16 @@ export const handler: HeyApiTransformersPlugin['Handler'] = ({ plugin }) => { name: operation.id, }), }); - const value = tsc.constVariable({ - exportConst: symbol.exported, - expression: tsc.arrowFunction({ - async: true, - multiLine: true, - parameters: [ - { - name: dataVariableName, - // TODO: parser - add types, generate types without transforms - type: tsc.keywordTypeNode({ keyword: 'any' }), - }, - ], - returnType: tsc.typeReferenceNode({ - typeArguments: [ - tsc.typeReferenceNode({ typeName: symbolResponse.placeholder }), - ], - typeName: 'Promise', - }), - statements: ensureStatements(nodes), - }), - name: symbol.placeholder, - }); + const value = $.const(symbol.placeholder) + .export(symbol.exported) + .assign( + // TODO: parser - add types, generate types without transforms + $.func() + .async() + .param(dataVariableName, (p) => p.type('any')) + .returns($.type('Promise').generic(symbolResponse.placeholder)) + .do(...ensureStatements(nodes)), + ); plugin.setSymbolValue(symbol, value); }, { diff --git a/packages/openapi-ts/src/ts-dsl/array.ts b/packages/openapi-ts/src/ts-dsl/array.ts index 86e6603ec3..526c83666c 100644 --- a/packages/openapi-ts/src/ts-dsl/array.ts +++ b/packages/openapi-ts/src/ts-dsl/array.ts @@ -1,10 +1,11 @@ -/* eslint-disable @typescript-eslint/no-empty-object-type, @typescript-eslint/no-unsafe-declaration-merging */ +/* eslint-disable @typescript-eslint/no-unsafe-declaration-merging */ import ts from 'typescript'; import type { MaybeTsDsl } from './base'; import { TsDsl } from './base'; import { LiteralTsDsl } from './literal'; import { mixin } from './mixins/apply'; +import { AsMixin } from './mixins/as'; import { LayoutMixin } from './mixins/layout'; export class ArrayTsDsl extends TsDsl { @@ -63,5 +64,5 @@ export class ArrayTsDsl extends TsDsl { } } -export interface ArrayTsDsl extends LayoutMixin {} -mixin(ArrayTsDsl, LayoutMixin); +export interface ArrayTsDsl extends AsMixin, LayoutMixin {} +mixin(ArrayTsDsl, AsMixin, LayoutMixin); diff --git a/packages/openapi-ts/src/ts-dsl/as.ts b/packages/openapi-ts/src/ts-dsl/as.ts index 735110ee0b..6006c455fc 100644 --- a/packages/openapi-ts/src/ts-dsl/as.ts +++ b/packages/openapi-ts/src/ts-dsl/as.ts @@ -1,10 +1,11 @@ -/* eslint-disable @typescript-eslint/no-empty-object-type, @typescript-eslint/no-unsafe-declaration-merging */ +/* eslint-disable @typescript-eslint/no-unsafe-declaration-merging */ import ts from 'typescript'; import type { MaybeTsDsl, TypeTsDsl } from './base'; import { TsDsl } from './base'; import { mixin } from './mixins/apply'; -import { ExprMixin, registerLazyAccessAsFactory } from './mixins/expr'; +import { AsMixin, registerLazyAccessAsFactory } from './mixins/as'; +import { ExprMixin } from './mixins/expr'; export class AsTsDsl extends TsDsl { private expr: string | MaybeTsDsl; @@ -27,7 +28,7 @@ export class AsTsDsl extends TsDsl { } } -export interface AsTsDsl extends ExprMixin {} -mixin(AsTsDsl, ExprMixin); +export interface AsTsDsl extends AsMixin, ExprMixin {} +mixin(AsTsDsl, AsMixin, ExprMixin); registerLazyAccessAsFactory((...args) => new AsTsDsl(...args)); diff --git a/packages/openapi-ts/src/ts-dsl/attr.ts b/packages/openapi-ts/src/ts-dsl/attr.ts index e2cc6749d7..4490b64b84 100644 --- a/packages/openapi-ts/src/ts-dsl/attr.ts +++ b/packages/openapi-ts/src/ts-dsl/attr.ts @@ -1,9 +1,13 @@ /* eslint-disable @typescript-eslint/no-unsafe-declaration-merging */ import ts from 'typescript'; +import { validTypescriptIdentifierRegExp } from '~/utils/regexp'; + import type { MaybeTsDsl } from './base'; import { TsDsl } from './base'; +import { LiteralTsDsl } from './literal'; import { mixin } from './mixins/apply'; +import { AsMixin } from './mixins/as'; import { AssignmentMixin } from './mixins/assignment'; import { ExprMixin, registerLazyAccessAttrFactory } from './mixins/expr'; import { OperatorMixin } from './mixins/operator'; @@ -26,23 +30,31 @@ export class AttrTsDsl extends TsDsl< $render(): ts.PropertyAccessExpression | ts.ElementAccessExpression { const leftNode = this.$node(this.left); - if (typeof this.right === 'number') { - if (this.isOptional) { + validTypescriptIdentifierRegExp.lastIndex = 0; + const questionToken = this.isOptional + ? ts.factory.createToken(ts.SyntaxKind.QuestionDotToken) + : undefined; + if ( + typeof this.right === 'number' || + (typeof this.right === 'string' && + !validTypescriptIdentifierRegExp.test(this.right)) + ) { + if (questionToken) { return ts.factory.createElementAccessChain( leftNode, - ts.factory.createToken(ts.SyntaxKind.QuestionDotToken), - ts.factory.createNumericLiteral(this.right), + questionToken, + this.$node(new LiteralTsDsl(this.right)), ); } return ts.factory.createElementAccessExpression( leftNode, - ts.factory.createNumericLiteral(this.right), + this.$node(new LiteralTsDsl(this.right)), ); } - if (this.isOptional) { + if (questionToken) { return ts.factory.createPropertyAccessChain( leftNode, - ts.factory.createToken(ts.SyntaxKind.QuestionDotToken), + questionToken, this.$maybeId(this.right), ); } @@ -54,10 +66,18 @@ export class AttrTsDsl extends TsDsl< } export interface AttrTsDsl - extends AssignmentMixin, + extends AsMixin, + AssignmentMixin, ExprMixin, OperatorMixin, OptionalMixin {} -mixin(AttrTsDsl, AssignmentMixin, ExprMixin, OperatorMixin, OptionalMixin); +mixin( + AttrTsDsl, + AsMixin, + AssignmentMixin, + ExprMixin, + OperatorMixin, + OptionalMixin, +); registerLazyAccessAttrFactory((...args) => new AttrTsDsl(...args)); diff --git a/packages/openapi-ts/src/ts-dsl/base.ts b/packages/openapi-ts/src/ts-dsl/base.ts index e7b3cc38fc..44af28a2df 100644 --- a/packages/openapi-ts/src/ts-dsl/base.ts +++ b/packages/openapi-ts/src/ts-dsl/base.ts @@ -1,5 +1,7 @@ import ts from 'typescript'; +import { toStmt } from './toStmt'; + export type MaybeArray = T | ReadonlyArray; export interface ITsDsl { @@ -116,9 +118,7 @@ export abstract class TsDsl implements ITsDsl { return arr.map((item) => { const node = typeof item === 'string' ? this.$id(item) : this._render(item); - return ts.isExpression(node) - ? ts.factory.createExpressionStatement(node) - : node; + return toStmt(node); }); } diff --git a/packages/openapi-ts/src/ts-dsl/binary.ts b/packages/openapi-ts/src/ts-dsl/binary.ts index 6645cac04a..23e0a17811 100644 --- a/packages/openapi-ts/src/ts-dsl/binary.ts +++ b/packages/openapi-ts/src/ts-dsl/binary.ts @@ -1,9 +1,10 @@ -/* eslint-disable @typescript-eslint/no-empty-object-type, @typescript-eslint/no-unsafe-declaration-merging */ +/* eslint-disable @typescript-eslint/no-unsafe-declaration-merging */ import ts from 'typescript'; import type { MaybeTsDsl } from './base'; import { TsDsl } from './base'; import { mixin } from './mixins/apply'; +import { AsMixin } from './mixins/as'; import { ExprMixin } from './mixins/expr'; type Operator = @@ -83,5 +84,5 @@ export class BinaryTsDsl extends TsDsl { } } -export interface BinaryTsDsl extends ExprMixin {} -mixin(BinaryTsDsl, ExprMixin); +export interface BinaryTsDsl extends AsMixin, ExprMixin {} +mixin(BinaryTsDsl, AsMixin, ExprMixin); diff --git a/packages/openapi-ts/src/ts-dsl/call.ts b/packages/openapi-ts/src/ts-dsl/call.ts index 694c293b4d..f1af56daea 100644 --- a/packages/openapi-ts/src/ts-dsl/call.ts +++ b/packages/openapi-ts/src/ts-dsl/call.ts @@ -5,6 +5,7 @@ import type { MaybeTsDsl } from './base'; import { TsDsl } from './base'; import { mixin } from './mixins/apply'; import { ArgsMixin } from './mixins/args'; +import { AsMixin } from './mixins/as'; import { ExprMixin, registerLazyAccessCallFactory } from './mixins/expr'; import { TypeArgsMixin } from './mixins/type-args'; @@ -31,7 +32,11 @@ export class CallTsDsl extends TsDsl { } } -export interface CallTsDsl extends ArgsMixin, ExprMixin, TypeArgsMixin {} -mixin(CallTsDsl, ArgsMixin, ExprMixin, TypeArgsMixin); +export interface CallTsDsl + extends ArgsMixin, + AsMixin, + ExprMixin, + TypeArgsMixin {} +mixin(CallTsDsl, ArgsMixin, AsMixin, ExprMixin, TypeArgsMixin); registerLazyAccessCallFactory((expr, args) => new CallTsDsl(expr, ...args)); diff --git a/packages/openapi-ts/src/ts-dsl/class.ts b/packages/openapi-ts/src/ts-dsl/class.ts index 26405e7b7e..68bd668c7d 100644 --- a/packages/openapi-ts/src/ts-dsl/class.ts +++ b/packages/openapi-ts/src/ts-dsl/class.ts @@ -102,7 +102,7 @@ mixin( AbstractMixin, DecoratorMixin, DefaultMixin, - [DocMixin, { overrideRender: true }], + DocMixin, ExportMixin, TypeParamsMixin, ); diff --git a/packages/openapi-ts/src/ts-dsl/expr.ts b/packages/openapi-ts/src/ts-dsl/expr.ts index e384d8e4e4..98cd5d4e7a 100644 --- a/packages/openapi-ts/src/ts-dsl/expr.ts +++ b/packages/openapi-ts/src/ts-dsl/expr.ts @@ -4,6 +4,8 @@ import type ts from 'typescript'; import type { MaybeTsDsl } from './base'; import { TsDsl } from './base'; import { mixin } from './mixins/apply'; +import { AsMixin } from './mixins/as'; +import { AssignmentMixin } from './mixins/assignment'; import { ExprMixin } from './mixins/expr'; import { OperatorMixin } from './mixins/operator'; import { TypeExprMixin } from './mixins/type-expr'; @@ -21,5 +23,17 @@ export class ExprTsDsl extends TsDsl { } } -export interface ExprTsDsl extends ExprMixin, OperatorMixin, TypeExprMixin {} -mixin(ExprTsDsl, ExprMixin, OperatorMixin, TypeExprMixin); +export interface ExprTsDsl + extends AsMixin, + AssignmentMixin, + ExprMixin, + OperatorMixin, + TypeExprMixin {} +mixin( + ExprTsDsl, + AsMixin, + AssignmentMixin, + ExprMixin, + OperatorMixin, + TypeExprMixin, +); diff --git a/packages/openapi-ts/src/ts-dsl/field.ts b/packages/openapi-ts/src/ts-dsl/field.ts index 34988d7815..daf3c24995 100644 --- a/packages/openapi-ts/src/ts-dsl/field.ts +++ b/packages/openapi-ts/src/ts-dsl/field.ts @@ -57,7 +57,7 @@ export interface FieldTsDsl mixin( FieldTsDsl, DecoratorMixin, - [DocMixin, { overrideRender: true }], + DocMixin, PrivateMixin, ProtectedMixin, PublicMixin, diff --git a/packages/openapi-ts/src/ts-dsl/func.ts b/packages/openapi-ts/src/ts-dsl/func.ts index 8afa5cc398..bafc38d2f2 100644 --- a/packages/openapi-ts/src/ts-dsl/func.ts +++ b/packages/openapi-ts/src/ts-dsl/func.ts @@ -3,6 +3,7 @@ import ts from 'typescript'; import { TsDsl, TypeTsDsl } from './base'; import { mixin } from './mixins/apply'; +import { AsMixin } from './mixins/as'; import { DecoratorMixin } from './mixins/decorator'; import { DoMixin } from './mixins/do'; import { DocMixin } from './mixins/doc'; @@ -126,6 +127,7 @@ class ImplFuncTsDsl extends TsDsl< interface ImplFuncTsDsl extends AbstractMixin, + AsMixin, AsyncMixin, DecoratorMixin, DoMixin, @@ -140,10 +142,11 @@ interface ImplFuncTsDsl mixin( ImplFuncTsDsl, AbstractMixin, + AsMixin, AsyncMixin, DecoratorMixin, DoMixin, - [DocMixin, { overrideRender: true }], + DocMixin, OptionalMixin, ParamMixin, PrivateMixin, diff --git a/packages/openapi-ts/src/ts-dsl/getter.ts b/packages/openapi-ts/src/ts-dsl/getter.ts index 684746e7c3..c8f9c94431 100644 --- a/packages/openapi-ts/src/ts-dsl/getter.ts +++ b/packages/openapi-ts/src/ts-dsl/getter.ts @@ -54,7 +54,7 @@ mixin( AbstractMixin, DecoratorMixin, DoMixin, - [DocMixin, { overrideRender: true }], + DocMixin, ParamMixin, PrivateMixin, ProtectedMixin, diff --git a/packages/openapi-ts/src/ts-dsl/index.ts b/packages/openapi-ts/src/ts-dsl/index.ts index 9158f0787b..f088ecf15e 100644 --- a/packages/openapi-ts/src/ts-dsl/index.ts +++ b/packages/openapi-ts/src/ts-dsl/index.ts @@ -29,10 +29,13 @@ import { SetterTsDsl } from './setter'; import { TemplateTsDsl } from './template'; import { TernaryTsDsl } from './ternary'; import { ThrowTsDsl } from './throw'; +import { toExpr } from './toExpr'; +import { toStmt } from './toStmt'; import { TypeAliasTsDsl } from './type/alias'; import { TypeAndTsDsl } from './type/and'; import { TypeAttrTsDsl } from './type/attr'; import { TypeExprTsDsl } from './type/expr'; +import { TypeFuncTsDsl } from './type/func'; import { TypeIdxTsDsl } from './type/idx'; import { TypeLiteralTsDsl } from './type/literal'; import { TypeObjectTsDsl } from './type/object'; @@ -41,7 +44,6 @@ import { TypeParamTsDsl } from './type/param'; import { TypeQueryTsDsl } from './type/query'; import { TypeTupleTsDsl } from './type/tuple'; import { TypeOfExprTsDsl } from './typeof'; -import { toExpr } from './utils'; import { VarTsDsl } from './var'; const base = { @@ -199,6 +201,9 @@ const base = { /** Converts a runtime value into a corresponding expression node. */ toExpr: (...args: Parameters) => toExpr(...args), + /** Converts a runtime value into a corresponding statement node. */ + toStmt: (...args: Parameters) => toStmt(...args), + /** Creates a basic type reference or type expression (e.g. Foo or Foo). */ type: Object.assign( (...args: ConstructorParameters) => @@ -220,6 +225,10 @@ const base = { expr: (...args: ConstructorParameters) => new TypeExprTsDsl(...args), + /** Creates a function type node (e.g. `(a: string) => number`). */ + func: (...args: ConstructorParameters) => + new TypeFuncTsDsl(...args), + /** Creates an indexed-access type (e.g. `Foo[K]`). */ idx: (...args: ConstructorParameters) => new TypeIdxTsDsl(...args), diff --git a/packages/openapi-ts/src/ts-dsl/init.ts b/packages/openapi-ts/src/ts-dsl/init.ts index 02d0d73d13..caed25380f 100644 --- a/packages/openapi-ts/src/ts-dsl/init.ts +++ b/packages/openapi-ts/src/ts-dsl/init.ts @@ -44,7 +44,7 @@ mixin( InitTsDsl, DecoratorMixin, DoMixin, - [DocMixin, { overrideRender: true }], + DocMixin, ParamMixin, PrivateMixin, ProtectedMixin, diff --git a/packages/openapi-ts/src/ts-dsl/literal.ts b/packages/openapi-ts/src/ts-dsl/literal.ts index cb04ae6838..cdb4cf6cf7 100644 --- a/packages/openapi-ts/src/ts-dsl/literal.ts +++ b/packages/openapi-ts/src/ts-dsl/literal.ts @@ -1,6 +1,9 @@ +/* eslint-disable @typescript-eslint/no-unsafe-declaration-merging, @typescript-eslint/no-empty-object-type */ import ts from 'typescript'; import { TsDsl } from './base'; +import { mixin } from './mixins/apply'; +import { AsMixin } from './mixins/as'; import { PrefixTsDsl } from './prefix'; export class LiteralTsDsl extends TsDsl { @@ -28,3 +31,6 @@ export class LiteralTsDsl extends TsDsl { throw new Error(`Unsupported literal: ${String(this.value)}`); } } + +export interface LiteralTsDsl extends AsMixin {} +mixin(LiteralTsDsl, AsMixin); diff --git a/packages/openapi-ts/src/ts-dsl/method.ts b/packages/openapi-ts/src/ts-dsl/method.ts index dbe1323468..dae07baf5d 100644 --- a/packages/openapi-ts/src/ts-dsl/method.ts +++ b/packages/openapi-ts/src/ts-dsl/method.ts @@ -71,7 +71,7 @@ mixin( AsyncMixin, DecoratorMixin, DoMixin, - [DocMixin, { overrideRender: true }], + DocMixin, OptionalMixin, ParamMixin, PrivateMixin, diff --git a/packages/openapi-ts/src/ts-dsl/mixins/apply.ts b/packages/openapi-ts/src/ts-dsl/mixins/apply.ts index f974cb38ab..442c720bb2 100644 --- a/packages/openapi-ts/src/ts-dsl/mixins/apply.ts +++ b/packages/openapi-ts/src/ts-dsl/mixins/apply.ts @@ -1,15 +1,11 @@ /* eslint-disable @typescript-eslint/no-unsafe-function-type */ -export function mixin( - target: Function, - ...sources: ReadonlyArray -) { +export function mixin(target: Function, ...sources: ReadonlyArray) { const targetProto = target.prototype; for (const src of sources) { - const [source, options] = src instanceof Array ? src : [src]; - let resolvedSource = source; - if (typeof source === 'function') { + let resolvedSource = src; + if (typeof src === 'function') { try { - const candidate = source(target); + const candidate = src(target); if (candidate?.prototype) { resolvedSource = candidate; } @@ -23,7 +19,7 @@ export function mixin( Object.getOwnPropertyDescriptors(sourceProto), )) { if (key === 'constructor') continue; - if (key === '$render' && !options?.overrideRender) continue; + if (key === '$render' && !descriptor.value.mixin) continue; Object.defineProperty(targetProto, key, descriptor); } } diff --git a/packages/openapi-ts/src/ts-dsl/mixins/as.ts b/packages/openapi-ts/src/ts-dsl/mixins/as.ts new file mode 100644 index 0000000000..829fe24195 --- /dev/null +++ b/packages/openapi-ts/src/ts-dsl/mixins/as.ts @@ -0,0 +1,24 @@ +import type ts from 'typescript'; + +import type { AsTsDsl } from '../as'; +import type { MaybeTsDsl, TypeTsDsl } from '../base'; + +type AsFactory = ( + expr: string | MaybeTsDsl, + type: string | TypeTsDsl, +) => AsTsDsl; +let asFactory: AsFactory | undefined; +/** Registers the As DSL factory after its module has finished evaluating. */ +export function registerLazyAccessAsFactory(factory: AsFactory): void { + asFactory = factory; +} + +export class AsMixin { + /** Creates an `as` type assertion expression (e.g. `value as Type`). */ + as( + this: string | MaybeTsDsl, + type: string | TypeTsDsl, + ): AsTsDsl { + return asFactory!(this, type); + } +} diff --git a/packages/openapi-ts/src/ts-dsl/mixins/doc.ts b/packages/openapi-ts/src/ts-dsl/mixins/doc.ts index 5968175a88..a7788797a8 100644 --- a/packages/openapi-ts/src/ts-dsl/mixins/doc.ts +++ b/packages/openapi-ts/src/ts-dsl/mixins/doc.ts @@ -4,21 +4,24 @@ import { DocTsDsl } from '../doc'; export function DocMixin< TBase extends new (...args: ReadonlyArray) => ITsDsl, >(Base: TBase) { - const Mixin = class extends Base { + const $renderBase = Base.prototype.$render; + + class Mixin extends Base { _doc?: DocTsDsl; doc(lines?: MaybeArray, fn?: (d: DocTsDsl) => void): this { this._doc = new DocTsDsl(lines, fn); return this; } - }; - const originalFn = Base.prototype.$render; + override $render(...args: Parameters) { + const node = $renderBase.apply(this, args); + return this._doc ? this._doc.apply(node) : node; + } + } - Mixin.prototype.$render = function (...args: Parameters) { - const node = originalFn.apply(this, args); - return this._doc ? this._doc.apply(node) : node; - }; + // @ts-expect-error + Mixin.prototype.$render.mixin = true; return Mixin; } diff --git a/packages/openapi-ts/src/ts-dsl/mixins/expr.ts b/packages/openapi-ts/src/ts-dsl/mixins/expr.ts index c08c9412cb..ad45f08bfa 100644 --- a/packages/openapi-ts/src/ts-dsl/mixins/expr.ts +++ b/packages/openapi-ts/src/ts-dsl/mixins/expr.ts @@ -1,27 +1,11 @@ import type ts from 'typescript'; -import type { AsTsDsl } from '../as'; import type { AttrTsDsl } from '../attr'; import type { AwaitTsDsl } from '../await'; -import type { MaybeTsDsl, TypeTsDsl } from '../base'; +import type { MaybeTsDsl } from '../base'; import type { CallTsDsl } from '../call'; import type { ReturnTsDsl } from '../return'; -/** - * Lazily register factory callbacks to avoid circular imports and - * ensure predictable mixin application order. - */ - -type AsFactory = ( - expr: string | MaybeTsDsl, - type: string | TypeTsDsl, -) => AsTsDsl; -let asFactory: AsFactory | undefined; -/** Registers the As DSL factory after its module has finished evaluating. */ -export function registerLazyAccessAsFactory(factory: AsFactory): void { - asFactory = factory; -} - type AttrFactory = ( expr: string | MaybeTsDsl, name: string | ts.MemberName | number, @@ -57,14 +41,6 @@ export function registerLazyAccessReturnFactory(factory: ReturnFactory): void { } export class ExprMixin { - /** Creates an `as` type assertion expression (e.g. `value as Type`). */ - as( - this: string | MaybeTsDsl, - type: string | TypeTsDsl, - ): AsTsDsl { - return asFactory!(this, type); - } - /** Accesses a property on the current expression (e.g. `this.foo`). */ attr( this: string | MaybeTsDsl, diff --git a/packages/openapi-ts/src/ts-dsl/mixins/hint.ts b/packages/openapi-ts/src/ts-dsl/mixins/hint.ts index 5fb3aa9aa3..ae6a01f7c2 100644 --- a/packages/openapi-ts/src/ts-dsl/mixins/hint.ts +++ b/packages/openapi-ts/src/ts-dsl/mixins/hint.ts @@ -4,21 +4,24 @@ import { HintTsDsl } from '../hint'; export function HintMixin< TBase extends new (...args: ReadonlyArray) => ITsDsl, >(Base: TBase) { - const Mixin = class extends Base { + const $renderBase = Base.prototype.$render; + + class Mixin extends Base { _hint?: HintTsDsl; hint(lines?: MaybeArray, fn?: (h: HintTsDsl) => void): this { this._hint = new HintTsDsl(lines, fn); return this; } - }; - const originalFn = Base.prototype.$render; + override $render(...args: Parameters) { + const node = $renderBase.apply(this, args); + return this._hint ? this._hint.apply(node) : node; + } + } - Mixin.prototype.$render = function (...args: Parameters) { - const node = originalFn.apply(this, args); - return this._hint ? this._hint.apply(node) : node; - }; + // @ts-expect-error + Mixin.prototype.$render.mixin = true; return Mixin; } diff --git a/packages/openapi-ts/src/ts-dsl/mixins/note.ts b/packages/openapi-ts/src/ts-dsl/mixins/note.ts index f74e5f52b1..e429986959 100644 --- a/packages/openapi-ts/src/ts-dsl/mixins/note.ts +++ b/packages/openapi-ts/src/ts-dsl/mixins/note.ts @@ -4,21 +4,24 @@ import { NoteTsDsl } from '../note'; export function NoteMixin< TBase extends new (...args: ReadonlyArray) => ITsDsl, >(Base: TBase) { - const Mixin = class extends Base { + const $renderBase = Base.prototype.$render; + + class Mixin extends Base { _note?: NoteTsDsl; note(lines?: MaybeArray, fn?: (h: NoteTsDsl) => void): this { this._note = new NoteTsDsl(lines, fn); return this; } - }; - const originalFn = Base.prototype.$render; + override $render(...args: Parameters) { + const node = $renderBase.apply(this, args); + return this._note ? this._note.apply(node) : node; + } + } - Mixin.prototype.$render = function (...args: Parameters) { - const node = originalFn.apply(this, args); - return this._note ? this._note.apply(node) : node; - }; + // @ts-expect-error + Mixin.prototype.$render.mixin = true; return Mixin; } diff --git a/packages/openapi-ts/src/ts-dsl/mixins/type-expr.ts b/packages/openapi-ts/src/ts-dsl/mixins/type-expr.ts index 0a93e51b91..08253f99ff 100644 --- a/packages/openapi-ts/src/ts-dsl/mixins/type-expr.ts +++ b/packages/openapi-ts/src/ts-dsl/mixins/type-expr.ts @@ -5,11 +5,6 @@ import type { TypeExprTsDsl } from '../type/expr'; import type { TypeQueryTsDsl } from '../type/query'; import type { TypeOfExprTsDsl } from '../typeof'; -/** - * Lazily register factory callbacks to avoid circular imports and - * ensure predictable mixin application order. - */ - type TypeExprFactory = ( nameOrFn?: string | ((t: TypeExprTsDsl) => void), fn?: (t: TypeExprTsDsl) => void, diff --git a/packages/openapi-ts/src/ts-dsl/object.ts b/packages/openapi-ts/src/ts-dsl/object.ts index 11723e493d..8c35069d6a 100644 --- a/packages/openapi-ts/src/ts-dsl/object.ts +++ b/packages/openapi-ts/src/ts-dsl/object.ts @@ -7,6 +7,7 @@ import type { MaybeTsDsl } from './base'; import { TsDsl } from './base'; import { GetterTsDsl } from './getter'; import { mixin } from './mixins/apply'; +import { AsMixin } from './mixins/as'; import { ExprMixin } from './mixins/expr'; import { HintMixin } from './mixins/hint'; import { LayoutMixin } from './mixins/layout'; @@ -143,10 +144,9 @@ export class ObjectTsDsl extends TsDsl { } } -export interface ObjectTsDsl extends ExprMixin, HintMixin, LayoutMixin {} -mixin( - ObjectTsDsl, - ExprMixin, - [HintMixin, { overrideRender: true }], - LayoutMixin, -); +export interface ObjectTsDsl + extends AsMixin, + ExprMixin, + HintMixin, + LayoutMixin {} +mixin(ObjectTsDsl, AsMixin, ExprMixin, HintMixin, LayoutMixin); diff --git a/packages/openapi-ts/src/ts-dsl/setter.ts b/packages/openapi-ts/src/ts-dsl/setter.ts index fbc4ddcc4d..52d03a491e 100644 --- a/packages/openapi-ts/src/ts-dsl/setter.ts +++ b/packages/openapi-ts/src/ts-dsl/setter.ts @@ -53,7 +53,7 @@ mixin( AbstractMixin, DecoratorMixin, DoMixin, - [DocMixin, { overrideRender: true }], + DocMixin, ParamMixin, PrivateMixin, ProtectedMixin, diff --git a/packages/openapi-ts/src/ts-dsl/utils.ts b/packages/openapi-ts/src/ts-dsl/toExpr.ts similarity index 65% rename from packages/openapi-ts/src/ts-dsl/utils.ts rename to packages/openapi-ts/src/ts-dsl/toExpr.ts index 689f9ac8ff..3f57487736 100644 --- a/packages/openapi-ts/src/ts-dsl/utils.ts +++ b/packages/openapi-ts/src/ts-dsl/toExpr.ts @@ -5,7 +5,12 @@ import { TsDsl } from './base'; import { LiteralTsDsl } from './literal'; import { ObjectTsDsl } from './object'; -export const toExpr = (value: unknown): TsDsl | undefined => { +export const toExpr = ( + value: unknown, + options?: { + layout?: 'pretty'; + }, +): TsDsl | undefined => { if (value instanceof TsDsl) { return value; } @@ -23,15 +28,18 @@ export const toExpr = (value: unknown): TsDsl | undefined => { } if (value instanceof Array) { - return new ArrayTsDsl(...value.map((v) => toExpr(v) ?? v)); + const arr = new ArrayTsDsl(...value.map((v) => toExpr(v, options) ?? v)); + if (options?.layout === 'pretty') arr.pretty(); + return arr; } if (typeof value === 'object') { const obj = new ObjectTsDsl(); for (const [key, val] of Object.entries(value)) { - const expr = toExpr(val); + const expr = toExpr(val, options); if (expr) obj.prop(key, expr); } + if (options?.layout === 'pretty') obj.pretty(); return obj; } diff --git a/packages/openapi-ts/src/ts-dsl/toStmt.ts b/packages/openapi-ts/src/ts-dsl/toStmt.ts new file mode 100644 index 0000000000..f210b8943e --- /dev/null +++ b/packages/openapi-ts/src/ts-dsl/toStmt.ts @@ -0,0 +1,4 @@ +import ts from 'typescript'; + +export const toStmt = (value: ts.Expression | ts.Statement): ts.Statement => + ts.isExpression(value) ? ts.factory.createExpressionStatement(value) : value; diff --git a/packages/openapi-ts/src/ts-dsl/type/func.ts b/packages/openapi-ts/src/ts-dsl/type/func.ts new file mode 100644 index 0000000000..afe3a44633 --- /dev/null +++ b/packages/openapi-ts/src/ts-dsl/type/func.ts @@ -0,0 +1,33 @@ +/* eslint-disable @typescript-eslint/no-unsafe-declaration-merging */ +import ts from 'typescript'; + +import { TypeTsDsl } from '../base'; +import { mixin } from '../mixins/apply'; +import { DocMixin } from '../mixins/doc'; +import { ParamMixin } from '../mixins/param'; +import { TypeParamsMixin } from '../mixins/type-params'; +import { TypeExprTsDsl } from './expr'; + +export class TypeFuncTsDsl extends TypeTsDsl { + private _returns?: TypeTsDsl; + + /** Sets the return type. */ + returns(type: string | TypeTsDsl): this { + this._returns = type instanceof TypeTsDsl ? type : new TypeExprTsDsl(type); + return this; + } + + $render(): ts.FunctionTypeNode { + if (this._returns === undefined) { + throw new Error('Missing return type in function type DSL'); + } + return ts.factory.createFunctionTypeNode( + this.$generics(), + this.$params(), + this.$type(this._returns), + ); + } +} + +export interface TypeFuncTsDsl extends DocMixin, ParamMixin, TypeParamsMixin {} +mixin(TypeFuncTsDsl, DocMixin, ParamMixin, TypeParamsMixin); diff --git a/packages/openapi-ts/src/ts-dsl/type/object.ts b/packages/openapi-ts/src/ts-dsl/type/object.ts index c9c174f6b4..c11ddd7d91 100644 --- a/packages/openapi-ts/src/ts-dsl/type/object.ts +++ b/packages/openapi-ts/src/ts-dsl/type/object.ts @@ -63,4 +63,4 @@ class TypePropTsDsl extends TypeTsDsl { } interface TypePropTsDsl extends DocMixin, OptionalMixin {} -mixin(TypePropTsDsl, [DocMixin, { overrideRender: true }], OptionalMixin); +mixin(TypePropTsDsl, DocMixin, OptionalMixin); diff --git a/packages/openapi-ts/src/ts-dsl/var.ts b/packages/openapi-ts/src/ts-dsl/var.ts index 1b552e5d99..2a1d972373 100644 --- a/packages/openapi-ts/src/ts-dsl/var.ts +++ b/packages/openapi-ts/src/ts-dsl/var.ts @@ -77,9 +77,9 @@ export interface VarTsDsl mixin( VarTsDsl, DefaultMixin, - [DocMixin, { overrideRender: true }], + DocMixin, ExportMixin, - [HintMixin, { overrideRender: true }], + HintMixin, PatternMixin, ValueMixin, );