fork of hey-api/openapi-ts because I need some additional things

chore: add migration notes

Lubos ccefe434 e436bc52

+260 -129
+20
.changeset/long-keys-refuse.md
···
··· 1 + --- 2 + '@hey-api/openapi-ts': minor 3 + --- 4 + 5 + feat: added `client.baseUrl` option 6 + 7 + ### Added `client.baseUrl` option 8 + 9 + You can use this option to configure the default base URL for the generated client. By default, we will attempt to resolve the first defined server or infer the base URL from the input path. If you'd like to preserve the previous behavior, set `baseUrl` to `false`. 10 + 11 + ```js 12 + export default { 13 + input: 'path/to/openapi.json', 14 + output: 'src/client', 15 + plugins: [{ 16 + baseUrl: false, // [!code ++] 17 + name: '@hey-api/client-fetch', 18 + }], 19 + }; 20 + ```
+14 -4
.changeset/unlucky-moles-dance.md
··· 1 --- 2 - '@hey-api/client-axios': patch 3 - '@hey-api/client-fetch': patch 4 - '@hey-api/client-next': patch 5 - '@hey-api/client-nuxt': patch 6 --- 7 8 fix: make createConfig, CreateClientConfig, and Config accept ClientOptions generic
··· 1 --- 2 + '@hey-api/client-axios': minor 3 + '@hey-api/client-fetch': minor 4 + '@hey-api/client-next': minor 5 + '@hey-api/client-nuxt': minor 6 + '@hey-api/openapi-ts': minor 7 --- 8 9 fix: make createConfig, CreateClientConfig, and Config accept ClientOptions generic 10 + 11 + ### Added `ClientOptions` interface 12 + 13 + The `Config` interface now accepts an optional generic extending `ClientOptions` instead of `boolean` type `ThrowOnError`. 14 + 15 + ```ts 16 + type Foo = Config<false> // [!code --] 17 + type Foo = Config<{ throwOnError: false }> // [!code ++] 18 + ```
+1 -1
docs/openapi-ts/clients/axios.md
··· 106 ::: code-group 107 108 ```ts [hey-api.ts] 109 - import type { CreateClientConfig } from '@hey-api/client-axios'; 110 111 export const createClientConfig: CreateClientConfig = (config) => ({ 112 ...config,
··· 106 ::: code-group 107 108 ```ts [hey-api.ts] 109 + import type { CreateClientConfig } from './client/client.gen'; 110 111 export const createClientConfig: CreateClientConfig = (config) => ({ 112 ...config,
+1 -1
docs/openapi-ts/clients/fetch.md
··· 106 ::: code-group 107 108 ```ts [hey-api.ts] 109 - import type { CreateClientConfig } from '@hey-api/client-fetch'; 110 111 export const createClientConfig: CreateClientConfig = (config) => ({ 112 ...config,
··· 106 ::: code-group 107 108 ```ts [hey-api.ts] 109 + import type { CreateClientConfig } from './client/client.gen'; 110 111 export const createClientConfig: CreateClientConfig = (config) => ({ 112 ...config,
+1 -1
docs/openapi-ts/clients/next-js.md
··· 102 ::: code-group 103 104 ```ts [hey-api.ts] 105 - import type { CreateClientConfig } from '@hey-api/client-next'; 106 107 export const createClientConfig: CreateClientConfig = (config) => ({ 108 ...config,
··· 102 ::: code-group 103 104 ```ts [hey-api.ts] 105 + import type { CreateClientConfig } from './client/client.gen'; 106 107 export const createClientConfig: CreateClientConfig = (config) => ({ 108 ...config,
+1 -1
docs/openapi-ts/clients/nuxt.md
··· 102 ::: code-group 103 104 ```ts [hey-api.ts] 105 - import type { CreateClientConfig } from '@hey-api/client-nuxt'; 106 107 export const createClientConfig: CreateClientConfig = (config) => ({ 108 ...config,
··· 102 ::: code-group 103 104 ```ts [hey-api.ts] 105 + import type { CreateClientConfig } from './client/client.gen'; 106 107 export const createClientConfig: CreateClientConfig = (config) => ({ 108 ...config,
+28
docs/openapi-ts/migrating.md
··· 27 28 This config option is deprecated and will be removed. 29 30 ## v0.63.0 31 32 ### Client plugins
··· 27 28 This config option is deprecated and will be removed. 29 30 + ## v0.64.0 31 + 32 + ### Added `ClientOptions` interface 33 + 34 + The `Config` interface now accepts an optional generic extending `ClientOptions` instead of `boolean` type `ThrowOnError`. 35 + 36 + ```ts 37 + type Foo = Config<false>; // [!code --] 38 + type Foo = Config<{ throwOnError: false }>; // [!code ++] 39 + ``` 40 + 41 + ### Added `client.baseUrl` option 42 + 43 + You can use this option to configure the default base URL for the generated client. By default, we will attempt to resolve the first defined server or infer the base URL from the input path. If you'd like to preserve the previous behavior, set `baseUrl` to `false`. 44 + 45 + ```js 46 + export default { 47 + input: 'path/to/openapi.json', 48 + output: 'src/client', 49 + plugins: [ 50 + { 51 + baseUrl: false, // [!code ++] 52 + name: '@hey-api/client-fetch', 53 + }, 54 + ], 55 + }; 56 + ``` 57 + 58 ## v0.63.0 59 60 ### Client plugins
+23 -2
examples/openapi-ts-next/src/client/client.gen.ts
··· 1 // This file is auto-generated by @hey-api/openapi-ts 2 3 - import { createClient, createConfig } from '@hey-api/client-next'; 4 5 import { createClientConfig } from '../hey-api'; 6 7 - export const client = createClient(createClientConfig(createConfig()));
··· 1 // This file is auto-generated by @hey-api/openapi-ts 2 3 + import { 4 + type ClientOptions as DefaultClientOptions, 5 + type Config, 6 + createClient, 7 + createConfig, 8 + } from '@hey-api/client-next'; 9 10 import { createClientConfig } from '../hey-api'; 11 + import type { ClientOptions } from './types.gen'; 12 13 + /** 14 + * The `createClientConfig()` function will be called on client initialization 15 + * and the returned object will become the client's initial configuration. 16 + * 17 + * You may want to initialize your client this way instead of calling 18 + * `setConfig()`. This is useful for example if you're using Next.js 19 + * to ensure your client always has the correct values. 20 + */ 21 + export type CreateClientConfig<T extends DefaultClientOptions = ClientOptions> = 22 + ( 23 + override?: Config<DefaultClientOptions & T>, 24 + ) => Config<Required<DefaultClientOptions> & T>; 25 + 26 + export const client = createClient( 27 + createClientConfig(createConfig<ClientOptions>()), 28 + );
+4
examples/openapi-ts-next/src/client/types.gen.ts
··· 561 */ 562 default: unknown; 563 };
··· 561 */ 562 default: unknown; 563 }; 564 + 565 + export type ClientOptions = { 566 + baseUrl: `${string}://${string}/v3` | (string & {}); 567 + };
+1 -1
examples/openapi-ts-next/src/hey-api.ts
··· 1 - import type { CreateClientConfig } from '@hey-api/client-next'; 2 3 export const createClientConfig: CreateClientConfig = (config) => ({ 4 ...config,
··· 1 + import type { CreateClientConfig } from './client/client.gen'; 2 3 export const createClientConfig: CreateClientConfig = (config) => ({ 4 ...config,
+2 -3
packages/openapi-ts/src/openApi/3.0.x/parser/index.ts
··· 13 import { parametersArrayToObject, parseParameter } from './parameter'; 14 import { parseRequestBody } from './requestBody'; 15 import { parseSchema } from './schema'; 16 17 export const parseV3_0_X = (context: IR.Context<OpenApiV3_0_X>) => { 18 const operationIds = new Map<string, string>(); ··· 99 } 100 } 101 102 - if (context.spec.servers) { 103 - context.ir.servers = context.spec.servers; 104 - } 105 106 for (const path in context.spec.paths) { 107 const pathItem = context.spec.paths[path as keyof PathsObject]!;
··· 13 import { parametersArrayToObject, parseParameter } from './parameter'; 14 import { parseRequestBody } from './requestBody'; 15 import { parseSchema } from './schema'; 16 + import { parseServers } from './server'; 17 18 export const parseV3_0_X = (context: IR.Context<OpenApiV3_0_X>) => { 19 const operationIds = new Map<string, string>(); ··· 100 } 101 } 102 103 + parseServers({ context }); 104 105 for (const path in context.spec.paths) { 106 const pathItem = context.spec.paths[path as keyof PathsObject]!;
+26
packages/openapi-ts/src/openApi/3.0.x/parser/server.ts
···
··· 1 + import type { IR } from '../../../ir/types'; 2 + import { parseUrl } from '../../../utils/url'; 3 + 4 + export const parseServers = ({ context }: { context: IR.Context }) => { 5 + if (context.spec.servers) { 6 + context.ir.servers = context.spec.servers; 7 + return; 8 + } 9 + 10 + if (typeof context.config.input.path === 'string') { 11 + const url = parseUrl(context.config.input.path); 12 + context.ir.servers = [ 13 + { 14 + url: `${url.protocol ? `${url.protocol}://` : ''}${url.host}${url.port ? `:${url.port}` : ''}`, 15 + }, 16 + ]; 17 + } 18 + 19 + if (!context.ir.servers) { 20 + context.ir.servers = [ 21 + { 22 + url: '/', 23 + }, 24 + ]; 25 + } 26 + };
+2 -3
packages/openapi-ts/src/openApi/3.1.x/parser/index.ts
··· 13 import { parametersArrayToObject, parseParameter } from './parameter'; 14 import { parseRequestBody } from './requestBody'; 15 import { parseSchema } from './schema'; 16 17 export const parseV3_1_X = (context: IR.Context<OpenApiV3_1_X>) => { 18 const operationIds = new Map<string, string>(); ··· 99 } 100 } 101 102 - if (context.spec.servers) { 103 - context.ir.servers = context.spec.servers; 104 - } 105 106 for (const path in context.spec.paths) { 107 const pathItem = context.spec.paths[path as keyof PathsObject]!;
··· 13 import { parametersArrayToObject, parseParameter } from './parameter'; 14 import { parseRequestBody } from './requestBody'; 15 import { parseSchema } from './schema'; 16 + import { parseServers } from './server'; 17 18 export const parseV3_1_X = (context: IR.Context<OpenApiV3_1_X>) => { 19 const operationIds = new Map<string, string>(); ··· 100 } 101 } 102 103 + parseServers({ context }); 104 105 for (const path in context.spec.paths) { 106 const pathItem = context.spec.paths[path as keyof PathsObject]!;
+26
packages/openapi-ts/src/openApi/3.1.x/parser/server.ts
···
··· 1 + import type { IR } from '../../../ir/types'; 2 + import { parseUrl } from '../../../utils/url'; 3 + 4 + export const parseServers = ({ context }: { context: IR.Context }) => { 5 + if (context.spec.servers) { 6 + context.ir.servers = context.spec.servers; 7 + return; 8 + } 9 + 10 + if (typeof context.config.input.path === 'string') { 11 + const url = parseUrl(context.config.input.path); 12 + context.ir.servers = [ 13 + { 14 + url: `${url.protocol ? `${url.protocol}://` : ''}${url.host}${url.port ? `:${url.port}` : ''}`, 15 + }, 16 + ]; 17 + } 18 + 19 + if (!context.ir.servers) { 20 + context.ir.servers = [ 21 + { 22 + url: '/', 23 + }, 24 + ]; 25 + } 26 + };
+8 -10
packages/openapi-ts/src/plugins/@hey-api/typescript/clientOptions.ts
··· 53 serverToBaseUrlType({ server }), 54 ); 55 56 - if (!('strictBaseUrl' in client && client.strictBaseUrl)) { 57 - if (servers.length) { 58 - types.push( 59 - compiler.typeIntersectionNode({ 60 - types: [stringType, ts.factory.createTypeLiteralNode([])], 61 - }), 62 - ); 63 - } else { 64 - types.push(stringType); 65 - } 66 } 67 68 const typeClientOptions = compiler.typeAliasDeclaration({
··· 53 serverToBaseUrlType({ server }), 54 ); 55 56 + if (!servers.length) { 57 + types.push(stringType); 58 + } else if (!('strictBaseUrl' in client && client.strictBaseUrl)) { 59 + types.push( 60 + compiler.typeIntersectionNode({ 61 + types: [stringType, ts.factory.createTypeLiteralNode([])], 62 + }), 63 + ); 64 } 65 66 const typeClientOptions = compiler.typeAliasDeclaration({
+1 -1
packages/openapi-ts/test/__snapshots__/3.0.x/additional-properties-false/types.gen.ts
··· 13 }; 14 15 export type ClientOptions = { 16 - baseUrl: string; 17 };
··· 13 }; 14 15 export type ClientOptions = { 16 + baseUrl: `${string}://${string}` | (string & {}); 17 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.0.x/additional-properties-true/types.gen.ts
··· 15 }; 16 17 export type ClientOptions = { 18 - baseUrl: string; 19 };
··· 15 }; 16 17 export type ClientOptions = { 18 + baseUrl: `${string}://${string}` | (string & {}); 19 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.0.x/additional-properties-undefined/types.gen.ts
··· 7 }; 8 9 export type ClientOptions = { 10 - baseUrl: string; 11 };
··· 7 }; 8 9 export type ClientOptions = { 10 + baseUrl: `${string}://${string}` | (string & {}); 11 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.0.x/array-items-one-of-length-1/types.gen.ts
··· 7 export type Bar = string; 8 9 export type ClientOptions = { 10 - baseUrl: string; 11 };
··· 7 export type Bar = string; 8 9 export type ClientOptions = { 10 + baseUrl: `${string}://${string}` | (string & {}); 11 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.0.x/body-response-text-plain/types.gen.ts
··· 17 export type PostFooResponse = PostFooResponses[keyof PostFooResponses]; 18 19 export type ClientOptions = { 20 - baseUrl: string; 21 };
··· 17 export type PostFooResponse = PostFooResponses[keyof PostFooResponses]; 18 19 export type ClientOptions = { 20 + baseUrl: `${string}://${string}` | (string & {}); 21 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.0.x/case-PascalCase/types.gen.ts
··· 85 export type GetFooResponse = GetFooResponses[keyof GetFooResponses]; 86 87 export type ClientOptions = { 88 - baseUrl: string; 89 };
··· 85 export type GetFooResponse = GetFooResponses[keyof GetFooResponses]; 86 87 export type ClientOptions = { 88 + baseUrl: `${string}://${string}` | (string & {}); 89 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.0.x/case-camelCase/types.gen.ts
··· 85 export type getFooResponse = getFooResponses[keyof getFooResponses]; 86 87 export type clientOptions = { 88 - baseUrl: string; 89 };
··· 85 export type getFooResponse = getFooResponses[keyof getFooResponses]; 86 87 export type clientOptions = { 88 + baseUrl: `${string}://${string}` | (string & {}); 89 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.0.x/case-snake_case/types.gen.ts
··· 85 export type get_foo_response = get_foo_responses[keyof get_foo_responses]; 86 87 export type client_options = { 88 - baseUrl: string; 89 };
··· 85 export type get_foo_response = get_foo_responses[keyof get_foo_responses]; 86 87 export type client_options = { 88 + baseUrl: `${string}://${string}` | (string & {}); 89 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.0.x/case/types.gen.ts
··· 85 export type GetFoo_Response = GetFoo_Responses[keyof GetFoo_Responses]; 86 87 export type ClientOptions = { 88 - baseUrl: string; 89 };
··· 85 export type GetFoo_Response = GetFoo_Responses[keyof GetFoo_Responses]; 86 87 export type ClientOptions = { 88 + baseUrl: `${string}://${string}` | (string & {}); 89 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.0.x/components-request-bodies/types.gen.ts
··· 25 }; 26 27 export type ClientOptions = { 28 - baseUrl: string; 29 };
··· 25 }; 26 27 export type ClientOptions = { 28 + baseUrl: `${string}://${string}` | (string & {}); 29 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.0.x/content-binary/types.gen.ts
··· 27 export type GetBarResponse = GetBarResponses[keyof GetBarResponses]; 28 29 export type ClientOptions = { 30 - baseUrl: string; 31 };
··· 27 export type GetBarResponse = GetBarResponses[keyof GetBarResponses]; 28 29 export type ClientOptions = { 30 + baseUrl: `${string}://${string}` | (string & {}); 31 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.0.x/discriminator-all-of/types.gen.ts
··· 45 }; 46 47 export type ClientOptions = { 48 - baseUrl: string; 49 };
··· 45 }; 46 47 export type ClientOptions = { 48 + baseUrl: `${string}://${string}` | (string & {}); 49 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.0.x/discriminator-any-of/types.gen.ts
··· 24 } & Baz); 25 26 export type ClientOptions = { 27 - baseUrl: string; 28 };
··· 24 } & Baz); 25 26 export type ClientOptions = { 27 + baseUrl: `${string}://${string}` | (string & {}); 28 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.0.x/discriminator-one-of/types.gen.ts
··· 24 } & Baz); 25 26 export type ClientOptions = { 27 - baseUrl: string; 28 };
··· 24 } & Baz); 25 26 export type ClientOptions = { 27 + baseUrl: `${string}://${string}` | (string & {}); 28 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.0.x/enum-escape/types.gen.ts
··· 7 export type Bar = "foo'bar" | 'foo"bar'; 8 9 export type ClientOptions = { 10 - baseUrl: string; 11 };
··· 7 export type Bar = "foo'bar" | 'foo"bar'; 8 9 export type ClientOptions = { 10 + baseUrl: `${string}://${string}` | (string & {}); 11 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.0.x/enum-inline-javascript/types.gen.ts
··· 12 }; 13 14 export type ClientOptions = { 15 - baseUrl: string; 16 };
··· 12 }; 13 14 export type ClientOptions = { 15 + baseUrl: `${string}://${string}` | (string & {}); 16 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.0.x/enum-inline-typescript-namespace/types.gen.ts
··· 12 }; 13 14 export type ClientOptions = { 15 - baseUrl: string; 16 };
··· 12 }; 13 14 export type ClientOptions = { 15 + baseUrl: `${string}://${string}` | (string & {}); 16 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.0.x/enum-inline-typescript/types.gen.ts
··· 10 }; 11 12 export type ClientOptions = { 13 - baseUrl: string; 14 };
··· 10 }; 11 12 export type ClientOptions = { 13 + baseUrl: `${string}://${string}` | (string & {}); 14 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.0.x/enum-inline/types.gen.ts
··· 7 }; 8 9 export type ClientOptions = { 10 - baseUrl: string; 11 };
··· 7 }; 8 9 export type ClientOptions = { 10 + baseUrl: `${string}://${string}` | (string & {}); 11 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.0.x/enum-names-values-javascript-PascalCase/types.gen.ts
··· 44 } as const; 45 46 export type ClientOptions = { 47 - baseUrl: string; 48 };
··· 44 } as const; 45 46 export type ClientOptions = { 47 + baseUrl: `${string}://${string}` | (string & {}); 48 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.0.x/enum-names-values-javascript-SCREAMING_SNAKE_CASE/types.gen.ts
··· 44 } as const; 45 46 export type ClientOptions = { 47 - baseUrl: string; 48 };
··· 44 } as const; 45 46 export type ClientOptions = { 47 + baseUrl: `${string}://${string}` | (string & {}); 48 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.0.x/enum-names-values-javascript-camelCase/types.gen.ts
··· 44 } as const; 45 46 export type ClientOptions = { 47 - baseUrl: string; 48 };
··· 44 } as const; 45 46 export type ClientOptions = { 47 + baseUrl: `${string}://${string}` | (string & {}); 48 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.0.x/enum-names-values-javascript-preserve/types.gen.ts
··· 44 } as const; 45 46 export type ClientOptions = { 47 - baseUrl: string; 48 };
··· 44 } as const; 45 46 export type ClientOptions = { 47 + baseUrl: `${string}://${string}` | (string & {}); 48 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.0.x/enum-names-values-javascript-snake_case/types.gen.ts
··· 44 } as const; 45 46 export type ClientOptions = { 47 - baseUrl: string; 48 };
··· 44 } as const; 45 46 export type ClientOptions = { 47 + baseUrl: `${string}://${string}` | (string & {}); 48 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.0.x/enum-names-values-typescript-PascalCase/types.gen.ts
··· 27 } 28 29 export type ClientOptions = { 30 - baseUrl: string; 31 };
··· 27 } 28 29 export type ClientOptions = { 30 + baseUrl: `${string}://${string}` | (string & {}); 31 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.0.x/enum-names-values-typescript-SCREAMING_SNAKE_CASE/types.gen.ts
··· 27 } 28 29 export type ClientOptions = { 30 - baseUrl: string; 31 };
··· 27 } 28 29 export type ClientOptions = { 30 + baseUrl: `${string}://${string}` | (string & {}); 31 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.0.x/enum-names-values-typescript-camelCase/types.gen.ts
··· 27 } 28 29 export type ClientOptions = { 30 - baseUrl: string; 31 };
··· 27 } 28 29 export type ClientOptions = { 30 + baseUrl: `${string}://${string}` | (string & {}); 31 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.0.x/enum-names-values-typescript-preserve/types.gen.ts
··· 27 } 28 29 export type ClientOptions = { 30 - baseUrl: string; 31 };
··· 27 } 28 29 export type ClientOptions = { 30 + baseUrl: `${string}://${string}` | (string & {}); 31 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.0.x/enum-names-values-typescript-snake_case/types.gen.ts
··· 27 } 28 29 export type ClientOptions = { 30 - baseUrl: string; 31 };
··· 27 } 28 29 export type ClientOptions = { 30 + baseUrl: `${string}://${string}` | (string & {}); 31 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.0.x/enum-names-values/types.gen.ts
··· 11 export type Numbers = 100 | 200 | 300 | -100 | -200 | -300; 12 13 export type ClientOptions = { 14 - baseUrl: string; 15 };
··· 11 export type Numbers = 100 | 200 | 300 | -100 | -200 | -300; 12 13 export type ClientOptions = { 14 + baseUrl: `${string}://${string}` | (string & {}); 15 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.0.x/enum-null/types.gen.ts
··· 7 export type Baz = 'foo' | 'bar'; 8 9 export type ClientOptions = { 10 - baseUrl: string; 11 };
··· 7 export type Baz = 'foo' | 'bar'; 8 9 export type ClientOptions = { 10 + baseUrl: `${string}://${string}` | (string & {}); 11 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.0.x/internal-name-conflict/types.gen.ts
··· 15 }; 16 17 export type ClientOptions = { 18 - baseUrl: string; 19 };
··· 15 }; 16 17 export type ClientOptions = { 18 + baseUrl: `${string}://${string}` | (string & {}); 19 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.0.x/operation-204/types.gen.ts
··· 21 export type PostFooResponse = PostFooResponses[keyof PostFooResponses]; 22 23 export type ClientOptions = { 24 - baseUrl: string; 25 };
··· 21 export type PostFooResponse = PostFooResponses[keyof PostFooResponses]; 22 23 export type ClientOptions = { 24 + baseUrl: `${string}://${string}` | (string & {}); 25 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.0.x/parameter-explode-false-axios/types.gen.ts
··· 17 }; 18 19 export type ClientOptions = { 20 - baseURL: string; 21 };
··· 17 }; 18 19 export type ClientOptions = { 20 + baseURL: `${string}://${string}` | (string & {}); 21 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.0.x/parameter-explode-false/types.gen.ts
··· 17 }; 18 19 export type ClientOptions = { 20 - baseUrl: string; 21 };
··· 17 }; 18 19 export type ClientOptions = { 20 + baseUrl: `${string}://${string}` | (string & {}); 21 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.0.x/plugins/@hey-api/transformers/type-format/types.gen.ts
··· 28 export type PostFooResponse = PostFooResponses[keyof PostFooResponses]; 29 30 export type ClientOptions = { 31 - baseUrl: string; 32 };
··· 28 export type PostFooResponse = PostFooResponses[keyof PostFooResponses]; 29 30 export type ClientOptions = { 31 + baseUrl: `${string}://${string}` | (string & {}); 32 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.0.x/security-api-key/types.gen.ts
··· 15 }; 16 17 export type ClientOptions = { 18 - baseUrl: string; 19 };
··· 15 }; 16 17 export type ClientOptions = { 18 + baseUrl: `${string}://${string}` | (string & {}); 19 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.0.x/security-false/types.gen.ts
··· 15 }; 16 17 export type ClientOptions = { 18 - baseUrl: string; 19 };
··· 15 }; 16 17 export type ClientOptions = { 18 + baseUrl: `${string}://${string}` | (string & {}); 19 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.0.x/security-http-bearer/types.gen.ts
··· 15 }; 16 17 export type ClientOptions = { 18 - baseUrl: string; 19 };
··· 15 }; 16 17 export type ClientOptions = { 18 + baseUrl: `${string}://${string}` | (string & {}); 19 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.0.x/security-oauth2/types.gen.ts
··· 15 }; 16 17 export type ClientOptions = { 18 - baseUrl: string; 19 };
··· 15 }; 16 17 export type ClientOptions = { 18 + baseUrl: `${string}://${string}` | (string & {}); 19 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.0.x/security-open-id-connect/types.gen.ts
··· 15 }; 16 17 export type ClientOptions = { 18 - baseUrl: string; 19 };
··· 15 }; 16 17 export type ClientOptions = { 18 + baseUrl: `${string}://${string}` | (string & {}); 19 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.0.x/transformers-all-of/types.gen.ts
··· 42 export type GetFooResponse = GetFooResponses[keyof GetFooResponses]; 43 44 export type ClientOptions = { 45 - baseUrl: string; 46 };
··· 42 export type GetFooResponse = GetFooResponses[keyof GetFooResponses]; 43 44 export type ClientOptions = { 45 + baseUrl: `${string}://${string}` | (string & {}); 46 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.0.x/transformers-any-of-null/types.gen.ts
··· 22 export type GetFooResponse = GetFooResponses[keyof GetFooResponses]; 23 24 export type ClientOptions = { 25 - baseUrl: string; 26 };
··· 22 export type GetFooResponse = GetFooResponses[keyof GetFooResponses]; 23 24 export type ClientOptions = { 25 + baseUrl: `${string}://${string}` | (string & {}); 26 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.0.x/transformers-array/types.gen.ts
··· 21 export type GetFooResponse = GetFooResponses[keyof GetFooResponses]; 22 23 export type ClientOptions = { 24 - baseUrl: string; 25 };
··· 21 export type GetFooResponse = GetFooResponses[keyof GetFooResponses]; 22 23 export type ClientOptions = { 24 + baseUrl: `${string}://${string}` | (string & {}); 25 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.0.x/type-invalid/types.gen.ts
··· 3 export type Foo = unknown; 4 5 export type ClientOptions = { 6 - baseUrl: string; 7 };
··· 3 export type Foo = unknown; 4 5 export type ClientOptions = { 6 + baseUrl: `${string}://${string}` | (string & {}); 7 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.1.x/additional-properties-false/types.gen.ts
··· 13 }; 14 15 export type ClientOptions = { 16 - baseUrl: string; 17 };
··· 13 }; 14 15 export type ClientOptions = { 16 + baseUrl: `${string}://${string}` | (string & {}); 17 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.1.x/additional-properties-true/types.gen.ts
··· 15 }; 16 17 export type ClientOptions = { 18 - baseUrl: string; 19 };
··· 15 }; 16 17 export type ClientOptions = { 18 + baseUrl: `${string}://${string}` | (string & {}); 19 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.1.x/additional-properties-undefined/types.gen.ts
··· 7 }; 8 9 export type ClientOptions = { 10 - baseUrl: string; 11 };
··· 7 }; 8 9 export type ClientOptions = { 10 + baseUrl: `${string}://${string}` | (string & {}); 11 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.1.x/array-items-one-of-length-1/types.gen.ts
··· 7 export type Bar = string; 8 9 export type ClientOptions = { 10 - baseUrl: string; 11 };
··· 7 export type Bar = string; 8 9 export type ClientOptions = { 10 + baseUrl: `${string}://${string}` | (string & {}); 11 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.1.x/body-response-text-plain/types.gen.ts
··· 17 export type PostFooResponse = PostFooResponses[keyof PostFooResponses]; 18 19 export type ClientOptions = { 20 - baseUrl: string; 21 };
··· 17 export type PostFooResponse = PostFooResponses[keyof PostFooResponses]; 18 19 export type ClientOptions = { 20 + baseUrl: `${string}://${string}` | (string & {}); 21 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.1.x/case-PascalCase/types.gen.ts
··· 85 export type GetFooResponse = GetFooResponses[keyof GetFooResponses]; 86 87 export type ClientOptions = { 88 - baseUrl: string; 89 };
··· 85 export type GetFooResponse = GetFooResponses[keyof GetFooResponses]; 86 87 export type ClientOptions = { 88 + baseUrl: `${string}://${string}` | (string & {}); 89 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.1.x/case-camelCase/types.gen.ts
··· 85 export type getFooResponse = getFooResponses[keyof getFooResponses]; 86 87 export type clientOptions = { 88 - baseUrl: string; 89 };
··· 85 export type getFooResponse = getFooResponses[keyof getFooResponses]; 86 87 export type clientOptions = { 88 + baseUrl: `${string}://${string}` | (string & {}); 89 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.1.x/case-snake_case/types.gen.ts
··· 85 export type get_foo_response = get_foo_responses[keyof get_foo_responses]; 86 87 export type client_options = { 88 - baseUrl: string; 89 };
··· 85 export type get_foo_response = get_foo_responses[keyof get_foo_responses]; 86 87 export type client_options = { 88 + baseUrl: `${string}://${string}` | (string & {}); 89 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.1.x/case/types.gen.ts
··· 85 export type GetFoo_Response = GetFoo_Responses[keyof GetFoo_Responses]; 86 87 export type ClientOptions = { 88 - baseUrl: string; 89 };
··· 85 export type GetFoo_Response = GetFoo_Responses[keyof GetFoo_Responses]; 86 87 export type ClientOptions = { 88 + baseUrl: `${string}://${string}` | (string & {}); 89 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.1.x/components-request-bodies/types.gen.ts
··· 25 }; 26 27 export type ClientOptions = { 28 - baseUrl: string; 29 };
··· 25 }; 26 27 export type ClientOptions = { 28 + baseUrl: `${string}://${string}` | (string & {}); 29 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.1.x/const/types.gen.ts
··· 17 export type GetFooResponse = GetFooResponses[keyof GetFooResponses]; 18 19 export type ClientOptions = { 20 - baseUrl: string; 21 };
··· 17 export type GetFooResponse = GetFooResponses[keyof GetFooResponses]; 18 19 export type ClientOptions = { 20 + baseUrl: `${string}://${string}` | (string & {}); 21 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.1.x/content-binary/types.gen.ts
··· 27 export type GetBarResponse = GetBarResponses[keyof GetBarResponses]; 28 29 export type ClientOptions = { 30 - baseUrl: string; 31 };
··· 27 export type GetBarResponse = GetBarResponses[keyof GetBarResponses]; 28 29 export type ClientOptions = { 30 + baseUrl: `${string}://${string}` | (string & {}); 31 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.1.x/discriminator-all-of/types.gen.ts
··· 45 }; 46 47 export type ClientOptions = { 48 - baseUrl: string; 49 };
··· 45 }; 46 47 export type ClientOptions = { 48 + baseUrl: `${string}://${string}` | (string & {}); 49 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.1.x/discriminator-any-of/types.gen.ts
··· 24 } & Baz); 25 26 export type ClientOptions = { 27 - baseUrl: string; 28 };
··· 24 } & Baz); 25 26 export type ClientOptions = { 27 + baseUrl: `${string}://${string}` | (string & {}); 28 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.1.x/discriminator-one-of/types.gen.ts
··· 24 } & Baz); 25 26 export type ClientOptions = { 27 - baseUrl: string; 28 };
··· 24 } & Baz); 25 26 export type ClientOptions = { 27 + baseUrl: `${string}://${string}` | (string & {}); 28 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.1.x/duplicate-null/types.gen.ts
··· 6 export type WeirdEnum = '' | string | null; 7 8 export type ClientOptions = { 9 - baseUrl: string; 10 };
··· 6 export type WeirdEnum = '' | string | null; 7 8 export type ClientOptions = { 9 + baseUrl: `${string}://${string}` | (string & {}); 10 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.1.x/enum-escape/types.gen.ts
··· 7 export type Bar = "foo'bar" | 'foo"bar'; 8 9 export type ClientOptions = { 10 - baseUrl: string; 11 };
··· 7 export type Bar = "foo'bar" | 'foo"bar'; 8 9 export type ClientOptions = { 10 + baseUrl: `${string}://${string}` | (string & {}); 11 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.1.x/enum-inline-javascript/types.gen.ts
··· 12 }; 13 14 export type ClientOptions = { 15 - baseUrl: string; 16 };
··· 12 }; 13 14 export type ClientOptions = { 15 + baseUrl: `${string}://${string}` | (string & {}); 16 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.1.x/enum-inline-typescript-namespace/types.gen.ts
··· 12 }; 13 14 export type ClientOptions = { 15 - baseUrl: string; 16 };
··· 12 }; 13 14 export type ClientOptions = { 15 + baseUrl: `${string}://${string}` | (string & {}); 16 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.1.x/enum-inline-typescript/types.gen.ts
··· 10 }; 11 12 export type ClientOptions = { 13 - baseUrl: string; 14 };
··· 10 }; 11 12 export type ClientOptions = { 13 + baseUrl: `${string}://${string}` | (string & {}); 14 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.1.x/enum-inline/types.gen.ts
··· 7 }; 8 9 export type ClientOptions = { 10 - baseUrl: string; 11 };
··· 7 }; 8 9 export type ClientOptions = { 10 + baseUrl: `${string}://${string}` | (string & {}); 11 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.1.x/enum-names-values-javascript-PascalCase/types.gen.ts
··· 44 } as const; 45 46 export type ClientOptions = { 47 - baseUrl: string; 48 };
··· 44 } as const; 45 46 export type ClientOptions = { 47 + baseUrl: `${string}://${string}` | (string & {}); 48 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.1.x/enum-names-values-javascript-SCREAMING_SNAKE_CASE/types.gen.ts
··· 44 } as const; 45 46 export type ClientOptions = { 47 - baseUrl: string; 48 };
··· 44 } as const; 45 46 export type ClientOptions = { 47 + baseUrl: `${string}://${string}` | (string & {}); 48 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.1.x/enum-names-values-javascript-camelCase/types.gen.ts
··· 44 } as const; 45 46 export type ClientOptions = { 47 - baseUrl: string; 48 };
··· 44 } as const; 45 46 export type ClientOptions = { 47 + baseUrl: `${string}://${string}` | (string & {}); 48 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.1.x/enum-names-values-javascript-preserve/types.gen.ts
··· 44 } as const; 45 46 export type ClientOptions = { 47 - baseUrl: string; 48 };
··· 44 } as const; 45 46 export type ClientOptions = { 47 + baseUrl: `${string}://${string}` | (string & {}); 48 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.1.x/enum-names-values-javascript-snake_case/types.gen.ts
··· 44 } as const; 45 46 export type ClientOptions = { 47 - baseUrl: string; 48 };
··· 44 } as const; 45 46 export type ClientOptions = { 47 + baseUrl: `${string}://${string}` | (string & {}); 48 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.1.x/enum-names-values-typescript-PascalCase/types.gen.ts
··· 27 } 28 29 export type ClientOptions = { 30 - baseUrl: string; 31 };
··· 27 } 28 29 export type ClientOptions = { 30 + baseUrl: `${string}://${string}` | (string & {}); 31 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.1.x/enum-names-values-typescript-SCREAMING_SNAKE_CASE/types.gen.ts
··· 27 } 28 29 export type ClientOptions = { 30 - baseUrl: string; 31 };
··· 27 } 28 29 export type ClientOptions = { 30 + baseUrl: `${string}://${string}` | (string & {}); 31 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.1.x/enum-names-values-typescript-camelCase/types.gen.ts
··· 27 } 28 29 export type ClientOptions = { 30 - baseUrl: string; 31 };
··· 27 } 28 29 export type ClientOptions = { 30 + baseUrl: `${string}://${string}` | (string & {}); 31 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.1.x/enum-names-values-typescript-preserve/types.gen.ts
··· 27 } 28 29 export type ClientOptions = { 30 - baseUrl: string; 31 };
··· 27 } 28 29 export type ClientOptions = { 30 + baseUrl: `${string}://${string}` | (string & {}); 31 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.1.x/enum-names-values-typescript-snake_case/types.gen.ts
··· 27 } 28 29 export type ClientOptions = { 30 - baseUrl: string; 31 };
··· 27 } 28 29 export type ClientOptions = { 30 + baseUrl: `${string}://${string}` | (string & {}); 31 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.1.x/enum-names-values/types.gen.ts
··· 11 export type Numbers = 100 | 200 | 300 | -100 | -200 | -300; 12 13 export type ClientOptions = { 14 - baseUrl: string; 15 };
··· 11 export type Numbers = 100 | 200 | 300 | -100 | -200 | -300; 12 13 export type ClientOptions = { 14 + baseUrl: `${string}://${string}` | (string & {}); 15 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.1.x/enum-null/types.gen.ts
··· 7 export type Baz = 'foo' | 'bar'; 8 9 export type ClientOptions = { 10 - baseUrl: string; 11 };
··· 7 export type Baz = 'foo' | 'bar'; 8 9 export type ClientOptions = { 10 + baseUrl: `${string}://${string}` | (string & {}); 11 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.1.x/internal-name-conflict/types.gen.ts
··· 15 }; 16 17 export type ClientOptions = { 18 - baseUrl: string; 19 };
··· 15 }; 16 17 export type ClientOptions = { 18 + baseUrl: `${string}://${string}` | (string & {}); 19 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.1.x/object-properties-all-of/types.gen.ts
··· 11 }; 12 13 export type ClientOptions = { 14 - baseUrl: string; 15 };
··· 11 }; 12 13 export type ClientOptions = { 14 + baseUrl: `${string}://${string}` | (string & {}); 15 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.1.x/object-properties-any-of/types.gen.ts
··· 11 }; 12 13 export type ClientOptions = { 14 - baseUrl: string; 15 };
··· 11 }; 12 13 export type ClientOptions = { 14 + baseUrl: `${string}://${string}` | (string & {}); 15 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.1.x/object-properties-one-of/types.gen.ts
··· 11 }; 12 13 export type ClientOptions = { 14 - baseUrl: string; 15 };
··· 11 }; 12 13 export type ClientOptions = { 14 + baseUrl: `${string}://${string}` | (string & {}); 15 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.1.x/operation-204/types.gen.ts
··· 21 export type PostFooResponse = PostFooResponses[keyof PostFooResponses]; 22 23 export type ClientOptions = { 24 - baseUrl: string; 25 };
··· 21 export type PostFooResponse = PostFooResponses[keyof PostFooResponses]; 22 23 export type ClientOptions = { 24 + baseUrl: `${string}://${string}` | (string & {}); 25 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.1.x/pagination-ref-any-of/types.gen.ts
··· 19 }; 20 21 export type ClientOptions = { 22 - baseUrl: string; 23 };
··· 19 }; 20 21 export type ClientOptions = { 22 + baseUrl: `${string}://${string}` | (string & {}); 23 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.1.x/parameter-explode-false-axios/types.gen.ts
··· 17 }; 18 19 export type ClientOptions = { 20 - baseURL: string; 21 };
··· 17 }; 18 19 export type ClientOptions = { 20 + baseURL: `${string}://${string}` | (string & {}); 21 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.1.x/parameter-explode-false/types.gen.ts
··· 17 }; 18 19 export type ClientOptions = { 20 - baseUrl: string; 21 };
··· 17 }; 18 19 export type ClientOptions = { 20 + baseUrl: `${string}://${string}` | (string & {}); 21 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.1.x/plugins/@hey-api/transformers/type-format/types.gen.ts
··· 28 export type PostFooResponse = PostFooResponses[keyof PostFooResponses]; 29 30 export type ClientOptions = { 31 - baseUrl: string; 32 };
··· 28 export type PostFooResponse = PostFooResponses[keyof PostFooResponses]; 29 30 export type ClientOptions = { 31 + baseUrl: `${string}://${string}` | (string & {}); 32 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.1.x/required-all-of-ref/types.gen.ts
··· 12 }; 13 14 export type ClientOptions = { 15 - baseUrl: string; 16 };
··· 12 }; 13 14 export type ClientOptions = { 15 + baseUrl: `${string}://${string}` | (string & {}); 16 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.1.x/required-any-of-ref/types.gen.ts
··· 10 }; 11 12 export type ClientOptions = { 13 - baseUrl: string; 14 };
··· 10 }; 11 12 export type ClientOptions = { 13 + baseUrl: `${string}://${string}` | (string & {}); 14 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.1.x/required-one-of-ref/types.gen.ts
··· 10 }; 11 12 export type ClientOptions = { 13 - baseUrl: string; 14 };
··· 10 }; 11 12 export type ClientOptions = { 13 + baseUrl: `${string}://${string}` | (string & {}); 14 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.1.x/schema-const/types.gen.ts
··· 19 }; 20 21 export type ClientOptions = { 22 - baseUrl: string; 23 };
··· 19 }; 20 21 export type ClientOptions = { 22 + baseUrl: `${string}://${string}` | (string & {}); 23 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.1.x/security-api-key/types.gen.ts
··· 15 }; 16 17 export type ClientOptions = { 18 - baseUrl: string; 19 };
··· 15 }; 16 17 export type ClientOptions = { 18 + baseUrl: `${string}://${string}` | (string & {}); 19 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.1.x/security-false/types.gen.ts
··· 15 }; 16 17 export type ClientOptions = { 18 - baseUrl: string; 19 };
··· 15 }; 16 17 export type ClientOptions = { 18 + baseUrl: `${string}://${string}` | (string & {}); 19 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.1.x/security-http-bearer/types.gen.ts
··· 15 }; 16 17 export type ClientOptions = { 18 - baseUrl: string; 19 };
··· 15 }; 16 17 export type ClientOptions = { 18 + baseUrl: `${string}://${string}` | (string & {}); 19 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.1.x/security-oauth2/types.gen.ts
··· 15 }; 16 17 export type ClientOptions = { 18 - baseUrl: string; 19 };
··· 15 }; 16 17 export type ClientOptions = { 18 + baseUrl: `${string}://${string}` | (string & {}); 19 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.1.x/security-open-id-connect/types.gen.ts
··· 15 }; 16 17 export type ClientOptions = { 18 - baseUrl: string; 19 };
··· 15 }; 16 17 export type ClientOptions = { 18 + baseUrl: `${string}://${string}` | (string & {}); 19 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.1.x/transformers-all-of/types.gen.ts
··· 42 export type GetFooResponse = GetFooResponses[keyof GetFooResponses]; 43 44 export type ClientOptions = { 45 - baseUrl: string; 46 };
··· 42 export type GetFooResponse = GetFooResponses[keyof GetFooResponses]; 43 44 export type ClientOptions = { 45 + baseUrl: `${string}://${string}` | (string & {}); 46 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.1.x/transformers-any-of-null/types.gen.ts
··· 23 export type GetFooResponse = GetFooResponses[keyof GetFooResponses]; 24 25 export type ClientOptions = { 26 - baseUrl: string; 27 };
··· 23 export type GetFooResponse = GetFooResponses[keyof GetFooResponses]; 24 25 export type ClientOptions = { 26 + baseUrl: `${string}://${string}` | (string & {}); 27 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.1.x/transformers-array/types.gen.ts
··· 21 export type GetFooResponse = GetFooResponses[keyof GetFooResponses]; 22 23 export type ClientOptions = { 24 - baseUrl: string; 25 };
··· 21 export type GetFooResponse = GetFooResponses[keyof GetFooResponses]; 22 23 export type ClientOptions = { 24 + baseUrl: `${string}://${string}` | (string & {}); 25 };
+1 -1
packages/openapi-ts/test/__snapshots__/3.1.x/type-invalid/types.gen.ts
··· 3 export type Foo = unknown; 4 5 export type ClientOptions = { 6 - baseUrl: string; 7 };
··· 3 export type Foo = unknown; 4 5 export type ClientOptions = { 6 + baseUrl: `${string}://${string}` | (string & {}); 7 };
+2 -2
packages/openapi-ts/test/openapi-ts.config.ts
··· 6 // exclude: '^#/components/schemas/ModelWithCircularReference$', 7 // include: 8 // '^(#/components/schemas/import|#/paths/api/v{api-version}/simple/options)$', 9 - path: './packages/openapi-ts/test/spec/3.0.x/servers.yaml', 10 // path: './test/spec/v3-transforms.json', 11 // path: 'https://mongodb-mms-prod-build-server.s3.amazonaws.com/openapi/2caffd88277a4e27c95dcefc7e3b6a63a3b03297-v2-2023-11-15.json', 12 // path: 'https://raw.githubusercontent.com/swagger-api/swagger-petstore/master/src/main/resources/openapi.yaml', ··· 26 plugins: [ 27 // @ts-ignore 28 { 29 - baseUrl: 'http://example.com', 30 // bundle: true, 31 name: '@hey-api/client-fetch', 32 strictBaseUrl: true,
··· 6 // exclude: '^#/components/schemas/ModelWithCircularReference$', 7 // include: 8 // '^(#/components/schemas/import|#/paths/api/v{api-version}/simple/options)$', 9 + path: './packages/openapi-ts/test/spec/3.1.x/full.json', 10 // path: './test/spec/v3-transforms.json', 11 // path: 'https://mongodb-mms-prod-build-server.s3.amazonaws.com/openapi/2caffd88277a4e27c95dcefc7e3b6a63a3b03297-v2-2023-11-15.json', 12 // path: 'https://raw.githubusercontent.com/swagger-api/swagger-petstore/master/src/main/resources/openapi.yaml', ··· 26 plugins: [ 27 // @ts-ignore 28 { 29 + baseUrl: false, 30 // bundle: true, 31 name: '@hey-api/client-fetch', 32 strictBaseUrl: true,