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

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #2130 from hey-api/feat/sdk-instance

fix(sdk): add `instance` option for instantiable SDKs

authored by

Lubos and committed by
GitHub
2b3700c1 43713930

+7589 -1401
+5
.changeset/neat-pillows-speak.md
··· 1 + --- 2 + '@hey-api/openapi-ts': minor 3 + --- 4 + 5 + fix(sdk): rename `serviceNameBuilder` to `classNameBuilder`
-5
.changeset/shaggy-beers-call.md
··· 1 - --- 2 - '@hey-api/openapi-ts': patch 3 - --- 4 - 5 - fix(parser): add parameters, requestBodies, and responses to supported `input.patch` fields
+5
.changeset/weak-ways-kiss.md
··· 1 + --- 2 + '@hey-api/openapi-ts': patch 3 + --- 4 + 5 + fix(sdk): add `instance` option for instantiable SDKs
+1 -1
docs/.vitepress/theme/custom.css
··· 208 208 } 209 209 210 210 html.dark .authors-list li > a, 211 - html.dark .sponsors-list li > a { 211 + html.dark .sponsors-list li { 212 212 background-color: var(--vp-button-brand-bg); 213 213 } 214 214
+19
docs/openapi-ts/configuration.md
··· 94 94 95 95 You can learn more on the [Output](/openapi-ts/output) page. 96 96 97 + ## Validating 98 + 99 + To validate your input, set `input.validate_EXPERIMENTAL` to `true`. 100 + 101 + ::: warning 102 + The validator feature is very limited. You can help improve it by submitting more [use cases](https://github.com/hey-api/openapi-ts/issues/1970#issuecomment-2933189789). 103 + ::: 104 + 105 + ```js 106 + export default { 107 + input: { 108 + path: 'https://get.heyapi.dev/hey-api/backend', 109 + validate_EXPERIMENTAL: true, // [!code ++] 110 + }, 111 + output: 'src/client', 112 + plugins: ['@hey-api/client-fetch'], 113 + }; 114 + ``` 115 + 97 116 ## Formatting 98 117 99 118 To format your output folder contents, set `output.format` to a valid formatter.
+23
docs/openapi-ts/migrating.md
··· 27 27 28 28 This config option is deprecated and will be removed. 29 29 30 + ## v0.71.0 31 + 32 + ### Renamed `sdk.serviceNameBuilder` option 33 + 34 + This option has been renamed to `sdk.classNameBuilder` to better represent its functionality. Additionally, it's no longer set by default. To preserve the previous behavior, update your configuration. 35 + 36 + ```js 37 + import { defaultPlugins } from '@hey-api/openapi-ts'; 38 + 39 + export default { 40 + input: 'https://get.heyapi.dev/hey-api/backend', 41 + output: 'src/client', 42 + plugins: [ 43 + ...defaultPlugins, 44 + { 45 + classNameBuilder: '{{name}}Service', // [!code ++] 46 + name: '@hey-api/sdk', 47 + serviceNameBuilder: '{{name}}Service', // [!code --] 48 + }, 49 + ], 50 + }; 51 + ``` 52 + 30 53 ## v0.68.0 31 54 32 55 ### Upgraded input filters
+18
packages/openapi-ts-tests/test/__snapshots__/2.0.x/plugins/@hey-api/sdk/instance/client.gen.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + 3 + import type { ClientOptions } from './types.gen'; 4 + import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; 5 + 6 + /** 7 + * The `createClientConfig()` function will be called on client initialization 8 + * and the returned object will become the client's initial configuration. 9 + * 10 + * You may want to initialize your client this way instead of calling 11 + * `setConfig()`. This is useful for example if you're using Next.js 12 + * to ensure your client always has the correct values. 13 + */ 14 + export type CreateClientConfig<T extends DefaultClientOptions = ClientOptions> = (override?: Config<DefaultClientOptions & T>) => Config<Required<DefaultClientOptions> & T>; 15 + 16 + export const client = createClient(createConfig<ClientOptions>({ 17 + baseUrl: 'http://localhost:3000/base' 18 + }));
+3
packages/openapi-ts-tests/test/__snapshots__/2.0.x/plugins/@hey-api/sdk/instance/index.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + export * from './types.gen'; 3 + export * from './sdk.gen';
+289
packages/openapi-ts-tests/test/__snapshots__/2.0.x/plugins/@hey-api/sdk/instance/sdk.gen.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + 3 + import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; 4 + import type { ServiceWithEmptyTagData, PatchApiVbyApiVersionNoTagData, PatchApiVbyApiVersionNoTagResponses, FooWowData, FooWowResponses, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, CallWithDescriptionsData, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponses, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponses, DummyAData, DummyAResponses, DummyBData, DummyBResponses, CallWithResponseData, CallWithResponseResponses, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponses, CallWithDuplicateResponsesErrors, CallWithResponsesData, CallWithResponsesResponses, CallWithResponsesErrors, CollectionFormatData, TypesData, TypesResponses, ComplexTypesData, ComplexTypesResponses, ComplexTypesErrors, CallWithResultFromHeaderData, CallWithResultFromHeaderResponses, CallWithResultFromHeaderErrors, TestErrorCodeData, TestErrorCodeResponses, TestErrorCodeErrors, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Responses, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyResponses, PostApiVbyApiVersionBodyErrors } from './types.gen'; 5 + import { client as _heyApiClient } from './client.gen'; 6 + 7 + export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = ClientOptions<TData, ThrowOnError> & { 8 + /** 9 + * You can provide a client instance returned by `createClient()` instead of 10 + * individual options. This might be also useful if you want to implement a 11 + * custom client. 12 + */ 13 + client?: Client; 14 + /** 15 + * You can pass arbitrary values through the `meta` object. This can be 16 + * used to access values that aren't defined as part of the SDK function. 17 + */ 18 + meta?: Record<string, unknown>; 19 + }; 20 + 21 + export class Sdk { 22 + client: Client = _heyApiClient; 23 + 24 + constructor({ client }: { 25 + client?: Client; 26 + }) { 27 + if (client) { 28 + this.client = client; 29 + } 30 + } 31 + 32 + public serviceWithEmptyTag<ThrowOnError extends boolean = false>(options?: Options<ServiceWithEmptyTagData, ThrowOnError>) { 33 + return (options?.client ?? this.client).get<unknown, unknown, ThrowOnError>({ 34 + url: '/api/v{api-version}/no+tag', 35 + ...options 36 + }); 37 + } 38 + 39 + public patchApiVbyApiVersionNoTag<ThrowOnError extends boolean = false>(options?: Options<PatchApiVbyApiVersionNoTagData, ThrowOnError>) { 40 + return (options?.client ?? this.client).patch<PatchApiVbyApiVersionNoTagResponses, unknown, ThrowOnError>({ 41 + url: '/api/v{api-version}/no+tag', 42 + ...options 43 + }); 44 + } 45 + 46 + public fooWow<ThrowOnError extends boolean = false>(options?: Options<FooWowData, ThrowOnError>) { 47 + return (options?.client ?? this.client).put<FooWowResponses, unknown, ThrowOnError>({ 48 + url: '/api/v{api-version}/no+tag', 49 + ...options 50 + }); 51 + } 52 + 53 + public deleteCallWithoutParametersAndResponse<ThrowOnError extends boolean = false>(options?: Options<DeleteCallWithoutParametersAndResponseData, ThrowOnError>) { 54 + return (options?.client ?? this.client).delete<unknown, unknown, ThrowOnError>({ 55 + url: '/api/v{api-version}/simple', 56 + ...options 57 + }); 58 + } 59 + 60 + public getCallWithoutParametersAndResponse<ThrowOnError extends boolean = false>(options?: Options<GetCallWithoutParametersAndResponseData, ThrowOnError>) { 61 + return (options?.client ?? this.client).get<unknown, unknown, ThrowOnError>({ 62 + url: '/api/v{api-version}/simple', 63 + ...options 64 + }); 65 + } 66 + 67 + public headCallWithoutParametersAndResponse<ThrowOnError extends boolean = false>(options?: Options<HeadCallWithoutParametersAndResponseData, ThrowOnError>) { 68 + return (options?.client ?? this.client).head<unknown, unknown, ThrowOnError>({ 69 + url: '/api/v{api-version}/simple', 70 + ...options 71 + }); 72 + } 73 + 74 + public optionsCallWithoutParametersAndResponse<ThrowOnError extends boolean = false>(options?: Options<OptionsCallWithoutParametersAndResponseData, ThrowOnError>) { 75 + return (options?.client ?? this.client).options<unknown, unknown, ThrowOnError>({ 76 + url: '/api/v{api-version}/simple', 77 + ...options 78 + }); 79 + } 80 + 81 + public patchCallWithoutParametersAndResponse<ThrowOnError extends boolean = false>(options?: Options<PatchCallWithoutParametersAndResponseData, ThrowOnError>) { 82 + return (options?.client ?? this.client).patch<unknown, unknown, ThrowOnError>({ 83 + url: '/api/v{api-version}/simple', 84 + ...options 85 + }); 86 + } 87 + 88 + public postCallWithoutParametersAndResponse<ThrowOnError extends boolean = false>(options?: Options<PostCallWithoutParametersAndResponseData, ThrowOnError>) { 89 + return (options?.client ?? this.client).post<unknown, unknown, ThrowOnError>({ 90 + url: '/api/v{api-version}/simple', 91 + ...options 92 + }); 93 + } 94 + 95 + public putCallWithoutParametersAndResponse<ThrowOnError extends boolean = false>(options?: Options<PutCallWithoutParametersAndResponseData, ThrowOnError>) { 96 + return (options?.client ?? this.client).put<unknown, unknown, ThrowOnError>({ 97 + url: '/api/v{api-version}/simple', 98 + ...options 99 + }); 100 + } 101 + 102 + public callWithDescriptions<ThrowOnError extends boolean = false>(options?: Options<CallWithDescriptionsData, ThrowOnError>) { 103 + return (options?.client ?? this.client).post<unknown, unknown, ThrowOnError>({ 104 + url: '/api/v{api-version}/descriptions/', 105 + ...options 106 + }); 107 + } 108 + 109 + public callWithParameters<ThrowOnError extends boolean = false>(options: Options<CallWithParametersData, ThrowOnError>) { 110 + return (options.client ?? this.client).post<unknown, unknown, ThrowOnError>({ 111 + url: '/api/v{api-version}/parameters/{parameterPath}', 112 + ...options 113 + }); 114 + } 115 + 116 + public callWithWeirdParameterNames<ThrowOnError extends boolean = false>(options: Options<CallWithWeirdParameterNamesData, ThrowOnError>) { 117 + return (options.client ?? this.client).post<unknown, unknown, ThrowOnError>({ 118 + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', 119 + ...options 120 + }); 121 + } 122 + 123 + public callWithDefaultParameters<ThrowOnError extends boolean = false>(options: Options<CallWithDefaultParametersData, ThrowOnError>) { 124 + return (options.client ?? this.client).get<unknown, unknown, ThrowOnError>({ 125 + url: '/api/v{api-version}/defaults', 126 + ...options 127 + }); 128 + } 129 + 130 + public callWithDefaultOptionalParameters<ThrowOnError extends boolean = false>(options?: Options<CallWithDefaultOptionalParametersData, ThrowOnError>) { 131 + return (options?.client ?? this.client).post<unknown, unknown, ThrowOnError>({ 132 + url: '/api/v{api-version}/defaults', 133 + ...options 134 + }); 135 + } 136 + 137 + public callToTestOrderOfParams<ThrowOnError extends boolean = false>(options: Options<CallToTestOrderOfParamsData, ThrowOnError>) { 138 + return (options.client ?? this.client).put<unknown, unknown, ThrowOnError>({ 139 + url: '/api/v{api-version}/defaults', 140 + ...options 141 + }); 142 + } 143 + 144 + public duplicateName<ThrowOnError extends boolean = false>(options?: Options<DuplicateNameData, ThrowOnError>) { 145 + return (options?.client ?? this.client).delete<unknown, unknown, ThrowOnError>({ 146 + url: '/api/v{api-version}/duplicate', 147 + ...options 148 + }); 149 + } 150 + 151 + public duplicateName2<ThrowOnError extends boolean = false>(options?: Options<DuplicateName2Data, ThrowOnError>) { 152 + return (options?.client ?? this.client).get<unknown, unknown, ThrowOnError>({ 153 + url: '/api/v{api-version}/duplicate', 154 + ...options 155 + }); 156 + } 157 + 158 + public duplicateName3<ThrowOnError extends boolean = false>(options?: Options<DuplicateName3Data, ThrowOnError>) { 159 + return (options?.client ?? this.client).post<unknown, unknown, ThrowOnError>({ 160 + url: '/api/v{api-version}/duplicate', 161 + ...options 162 + }); 163 + } 164 + 165 + public duplicateName4<ThrowOnError extends boolean = false>(options?: Options<DuplicateName4Data, ThrowOnError>) { 166 + return (options?.client ?? this.client).put<unknown, unknown, ThrowOnError>({ 167 + url: '/api/v{api-version}/duplicate', 168 + ...options 169 + }); 170 + } 171 + 172 + public callWithNoContentResponse<ThrowOnError extends boolean = false>(options?: Options<CallWithNoContentResponseData, ThrowOnError>) { 173 + return (options?.client ?? this.client).get<CallWithNoContentResponseResponses, unknown, ThrowOnError>({ 174 + url: '/api/v{api-version}/no-content', 175 + ...options 176 + }); 177 + } 178 + 179 + public callWithResponseAndNoContentResponse<ThrowOnError extends boolean = false>(options?: Options<CallWithResponseAndNoContentResponseData, ThrowOnError>) { 180 + return (options?.client ?? this.client).get<CallWithResponseAndNoContentResponseResponses, unknown, ThrowOnError>({ 181 + url: '/api/v{api-version}/multiple-tags/response-and-no-content', 182 + ...options 183 + }); 184 + } 185 + 186 + public dummyA<ThrowOnError extends boolean = false>(options?: Options<DummyAData, ThrowOnError>) { 187 + return (options?.client ?? this.client).get<DummyAResponses, unknown, ThrowOnError>({ 188 + url: '/api/v{api-version}/multiple-tags/a', 189 + ...options 190 + }); 191 + } 192 + 193 + public dummyB<ThrowOnError extends boolean = false>(options?: Options<DummyBData, ThrowOnError>) { 194 + return (options?.client ?? this.client).get<DummyBResponses, unknown, ThrowOnError>({ 195 + url: '/api/v{api-version}/multiple-tags/b', 196 + ...options 197 + }); 198 + } 199 + 200 + public callWithResponse<ThrowOnError extends boolean = false>(options?: Options<CallWithResponseData, ThrowOnError>) { 201 + return (options?.client ?? this.client).get<CallWithResponseResponses, unknown, ThrowOnError>({ 202 + url: '/api/v{api-version}/response', 203 + ...options 204 + }); 205 + } 206 + 207 + public callWithDuplicateResponses<ThrowOnError extends boolean = false>(options?: Options<CallWithDuplicateResponsesData, ThrowOnError>) { 208 + return (options?.client ?? this.client).post<CallWithDuplicateResponsesResponses, CallWithDuplicateResponsesErrors, ThrowOnError>({ 209 + url: '/api/v{api-version}/response', 210 + ...options 211 + }); 212 + } 213 + 214 + public callWithResponses<ThrowOnError extends boolean = false>(options?: Options<CallWithResponsesData, ThrowOnError>) { 215 + return (options?.client ?? this.client).put<CallWithResponsesResponses, CallWithResponsesErrors, ThrowOnError>({ 216 + url: '/api/v{api-version}/response', 217 + ...options 218 + }); 219 + } 220 + 221 + public collectionFormat<ThrowOnError extends boolean = false>(options: Options<CollectionFormatData, ThrowOnError>) { 222 + return (options.client ?? this.client).get<unknown, unknown, ThrowOnError>({ 223 + querySerializer: { 224 + array: { 225 + explode: false, 226 + style: 'form' 227 + } 228 + }, 229 + url: '/api/v{api-version}/collectionFormat', 230 + ...options 231 + }); 232 + } 233 + 234 + public types<ThrowOnError extends boolean = false>(options: Options<TypesData, ThrowOnError>) { 235 + return (options.client ?? this.client).get<TypesResponses, unknown, ThrowOnError>({ 236 + querySerializer: { 237 + array: { 238 + explode: false, 239 + style: 'form' 240 + } 241 + }, 242 + url: '/api/v{api-version}/types', 243 + ...options 244 + }); 245 + } 246 + 247 + public complexTypes<ThrowOnError extends boolean = false>(options: Options<ComplexTypesData, ThrowOnError>) { 248 + return (options.client ?? this.client).get<ComplexTypesResponses, ComplexTypesErrors, ThrowOnError>({ 249 + url: '/api/v{api-version}/complex', 250 + ...options 251 + }); 252 + } 253 + 254 + public callWithResultFromHeader<ThrowOnError extends boolean = false>(options?: Options<CallWithResultFromHeaderData, ThrowOnError>) { 255 + return (options?.client ?? this.client).post<CallWithResultFromHeaderResponses, CallWithResultFromHeaderErrors, ThrowOnError>({ 256 + url: '/api/v{api-version}/header', 257 + ...options 258 + }); 259 + } 260 + 261 + public testErrorCode<ThrowOnError extends boolean = false>(options: Options<TestErrorCodeData, ThrowOnError>) { 262 + return (options.client ?? this.client).post<TestErrorCodeResponses, TestErrorCodeErrors, ThrowOnError>({ 263 + url: '/api/v{api-version}/error', 264 + ...options 265 + }); 266 + } 267 + 268 + public nonAsciiæøåÆøÅöôêÊ字符串<ThrowOnError extends boolean = false>(options: Options<NonAsciiæøåÆøÅöôêÊ字符串Data, ThrowOnError>) { 269 + return (options.client ?? this.client).post<NonAsciiæøåÆøÅöôêÊ字符串Responses, unknown, ThrowOnError>({ 270 + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', 271 + ...options 272 + }); 273 + } 274 + 275 + /** 276 + * Body should not be unknown 277 + * Body should not be unknown 278 + */ 279 + public postApiVbyApiVersionBody<ThrowOnError extends boolean = false>(options: Options<PostApiVbyApiVersionBodyData, ThrowOnError>) { 280 + return (options.client ?? this.client).post<PostApiVbyApiVersionBodyResponses, PostApiVbyApiVersionBodyErrors, ThrowOnError>({ 281 + url: '/api/v{api-version}/body', 282 + ...options, 283 + headers: { 284 + 'Content-Type': 'application/json', 285 + ...options.headers 286 + } 287 + }); 288 + } 289 + }
+1176
packages/openapi-ts-tests/test/__snapshots__/2.0.x/plugins/@hey-api/sdk/instance/types.gen.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + 3 + /** 4 + * Testing multiline comments in string: First line 5 + * Second line 6 + * 7 + * Fourth line 8 + */ 9 + export type CommentWithBreaks = number; 10 + 11 + /** 12 + * Testing backticks in string: `backticks` and ```multiple backticks``` should work 13 + */ 14 + export type CommentWithBackticks = number; 15 + 16 + /** 17 + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work 18 + */ 19 + export type CommentWithBackticksAndQuotes = number; 20 + 21 + /** 22 + * Testing slashes in string: \backwards\\\ and /forwards/// should work 23 + */ 24 + export type CommentWithSlashes = number; 25 + 26 + /** 27 + * Testing expression placeholders in string: ${expression} should work 28 + */ 29 + export type CommentWithExpressionPlaceholders = number; 30 + 31 + /** 32 + * Testing quotes in string: 'single quote''' and "double quotes""" should work 33 + */ 34 + export type CommentWithQuotes = number; 35 + 36 + /** 37 + * Testing reserved characters in string: * inline * and ** inline ** should work 38 + */ 39 + export type CommentWithReservedCharacters = number; 40 + 41 + /** 42 + * This is a simple number 43 + */ 44 + export type SimpleInteger = number; 45 + 46 + /** 47 + * This is a simple boolean 48 + */ 49 + export type SimpleBoolean = boolean; 50 + 51 + /** 52 + * This is a simple string 53 + */ 54 + export type SimpleString = string; 55 + 56 + /** 57 + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) 58 + */ 59 + export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; 60 + 61 + /** 62 + * This is a simple file 63 + */ 64 + export type SimpleFile = Blob | File; 65 + 66 + export type SimpleReference = ModelWithString; 67 + 68 + /** 69 + * This is a simple string 70 + */ 71 + export type SimpleStringWithPattern = string; 72 + 73 + /** 74 + * This is a simple enum with strings 75 + */ 76 + export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; 77 + 78 + /** 79 + * This is a simple enum with numbers 80 + */ 81 + export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; 82 + 83 + /** 84 + * Success=1,Warning=2,Error=3 85 + */ 86 + export type EnumFromDescription = number; 87 + 88 + /** 89 + * This is a simple enum with numbers 90 + */ 91 + export type EnumWithExtensions = 200 | 400 | 500; 92 + 93 + /** 94 + * This is a simple array with numbers 95 + */ 96 + export type ArrayWithNumbers = Array<number>; 97 + 98 + /** 99 + * This is a simple array with booleans 100 + */ 101 + export type ArrayWithBooleans = Array<boolean>; 102 + 103 + /** 104 + * This is a simple array with strings 105 + */ 106 + export type ArrayWithStrings = Array<string>; 107 + 108 + /** 109 + * This is a simple array with references 110 + */ 111 + export type ArrayWithReferences = Array<ModelWithString>; 112 + 113 + /** 114 + * This is a simple array containing an array 115 + */ 116 + export type ArrayWithArray = Array<Array<ModelWithString>>; 117 + 118 + /** 119 + * This is a simple array with properties 120 + */ 121 + export type ArrayWithProperties = Array<{ 122 + foo?: string; 123 + bar?: string; 124 + }>; 125 + 126 + /** 127 + * This is a string dictionary 128 + */ 129 + export type DictionaryWithString = { 130 + [key: string]: string; 131 + }; 132 + 133 + /** 134 + * This is a string reference 135 + */ 136 + export type DictionaryWithReference = { 137 + [key: string]: ModelWithString; 138 + }; 139 + 140 + /** 141 + * This is a complex dictionary 142 + */ 143 + export type DictionaryWithArray = { 144 + [key: string]: Array<ModelWithString>; 145 + }; 146 + 147 + /** 148 + * This is a string dictionary 149 + */ 150 + export type DictionaryWithDictionary = { 151 + [key: string]: { 152 + [key: string]: string; 153 + }; 154 + }; 155 + 156 + /** 157 + * This is a complex dictionary 158 + */ 159 + export type DictionaryWithProperties = { 160 + [key: string]: { 161 + foo?: string; 162 + bar?: string; 163 + }; 164 + }; 165 + 166 + /** 167 + * This is a type-only model that defines Date as a string 168 + */ 169 + export type _Date = string; 170 + 171 + /** 172 + * This is a model with one number property 173 + */ 174 + export type ModelWithInteger = { 175 + /** 176 + * This is a simple number property 177 + */ 178 + prop?: number; 179 + }; 180 + 181 + /** 182 + * This is a model with one boolean property 183 + */ 184 + export type ModelWithBoolean = { 185 + /** 186 + * This is a simple boolean property 187 + */ 188 + prop?: boolean; 189 + }; 190 + 191 + /** 192 + * This is a model with one string property 193 + */ 194 + export type ModelWithString = { 195 + /** 196 + * This is a simple string property 197 + */ 198 + prop?: string; 199 + }; 200 + 201 + /** 202 + * This is a model with one string property 203 + */ 204 + export type ModelWithStringError = { 205 + /** 206 + * This is a simple string property 207 + */ 208 + prop?: string; 209 + }; 210 + 211 + /** 212 + * This is a model with one string property 213 + */ 214 + export type ModelWithNullableString = { 215 + /** 216 + * This is a simple string property 217 + */ 218 + nullableProp?: string | null; 219 + /** 220 + * This is a simple string property 221 + */ 222 + nullableRequiredProp: string | null; 223 + }; 224 + 225 + /** 226 + * This is a model with one enum 227 + */ 228 + export type ModelWithEnum = { 229 + /** 230 + * This is a simple enum with strings 231 + */ 232 + test?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; 233 + /** 234 + * These are the HTTP error code enums 235 + */ 236 + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; 237 + /** 238 + * Simple boolean enum 239 + */ 240 + bool?: true; 241 + }; 242 + 243 + /** 244 + * This is a model with one enum 245 + */ 246 + export type ModelWithEnumFromDescription = { 247 + /** 248 + * Success=1,Warning=2,Error=3 249 + */ 250 + test?: number; 251 + }; 252 + 253 + /** 254 + * This is a model with nested enums 255 + */ 256 + export type ModelWithNestedEnums = { 257 + dictionaryWithEnum?: { 258 + [key: string]: 'Success' | 'Warning' | 'Error'; 259 + }; 260 + dictionaryWithEnumFromDescription?: { 261 + [key: string]: number; 262 + }; 263 + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; 264 + arrayWithDescription?: Array<number>; 265 + }; 266 + 267 + /** 268 + * This is a model with one property containing a reference 269 + */ 270 + export type ModelWithReferenceReadable = { 271 + prop?: ModelWithPropertiesReadable; 272 + }; 273 + 274 + /** 275 + * This is a model with one property containing a reference 276 + */ 277 + export type ModelWithReferenceWritable = { 278 + prop?: ModelWithPropertiesWritable; 279 + }; 280 + 281 + /** 282 + * This is a model with one property containing an array 283 + */ 284 + export type ModelWithArray = { 285 + prop?: Array<ModelWithString>; 286 + propWithFile?: Array<Blob | File>; 287 + propWithNumber?: Array<number>; 288 + }; 289 + 290 + /** 291 + * This is a model with one property containing a dictionary 292 + */ 293 + export type ModelWithDictionary = { 294 + prop?: { 295 + [key: string]: string; 296 + }; 297 + }; 298 + 299 + /** 300 + * This is a model with one property containing a circular reference 301 + */ 302 + export type ModelWithCircularReference = { 303 + prop?: ModelWithCircularReference; 304 + }; 305 + 306 + /** 307 + * This is a model with one nested property 308 + */ 309 + export type ModelWithPropertiesReadable = { 310 + required: string; 311 + readonly requiredAndReadOnly: string; 312 + string?: string; 313 + number?: number; 314 + boolean?: boolean; 315 + reference?: ModelWithString; 316 + 'property with space'?: string; 317 + default?: string; 318 + try?: string; 319 + readonly '@namespace.string'?: string; 320 + readonly '@namespace.integer'?: number; 321 + }; 322 + 323 + /** 324 + * This is a model with one nested property 325 + */ 326 + export type ModelWithPropertiesWritable = { 327 + required: string; 328 + string?: string; 329 + number?: number; 330 + boolean?: boolean; 331 + reference?: ModelWithString; 332 + 'property with space'?: string; 333 + default?: string; 334 + try?: string; 335 + }; 336 + 337 + /** 338 + * This is a model with one nested property 339 + */ 340 + export type ModelWithNestedProperties = { 341 + readonly first: { 342 + readonly second: { 343 + readonly third: string; 344 + }; 345 + }; 346 + }; 347 + 348 + /** 349 + * This is a model with duplicated properties 350 + */ 351 + export type ModelWithDuplicateProperties = { 352 + prop?: ModelWithString; 353 + }; 354 + 355 + /** 356 + * This is a model with ordered properties 357 + */ 358 + export type ModelWithOrderedProperties = { 359 + zebra?: string; 360 + apple?: string; 361 + hawaii?: string; 362 + }; 363 + 364 + /** 365 + * This is a model with duplicated imports 366 + */ 367 + export type ModelWithDuplicateImports = { 368 + propA?: ModelWithString; 369 + propB?: ModelWithString; 370 + propC?: ModelWithString; 371 + }; 372 + 373 + /** 374 + * This is a model that extends another model 375 + */ 376 + export type ModelThatExtends = ModelWithString & { 377 + propExtendsA?: string; 378 + propExtendsB?: ModelWithString; 379 + }; 380 + 381 + /** 382 + * This is a model that extends another model 383 + */ 384 + export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { 385 + propExtendsC?: string; 386 + propExtendsD?: ModelWithString; 387 + }; 388 + 389 + export type Default = { 390 + name?: string; 391 + }; 392 + 393 + /** 394 + * This is a model that contains a some patterns 395 + */ 396 + export type ModelWithPatternReadable = { 397 + key: string; 398 + name: string; 399 + readonly enabled?: boolean; 400 + readonly modified?: string; 401 + id?: string; 402 + text?: string; 403 + patternWithSingleQuotes?: string; 404 + patternWithNewline?: string; 405 + patternWithBacktick?: string; 406 + }; 407 + 408 + /** 409 + * This is a model that contains a some patterns 410 + */ 411 + export type ModelWithPatternWritable = { 412 + key: string; 413 + name: string; 414 + id?: string; 415 + text?: string; 416 + patternWithSingleQuotes?: string; 417 + patternWithNewline?: string; 418 + patternWithBacktick?: string; 419 + }; 420 + 421 + export type ParameterActivityParams = { 422 + description?: string; 423 + graduate_id?: number; 424 + organization_id?: number; 425 + parent_activity?: number; 426 + post_id?: number; 427 + }; 428 + 429 + export type ResponsePostActivityResponse = { 430 + description?: string; 431 + graduate_id?: number; 432 + organization_id?: number; 433 + parent_activity_id?: number; 434 + post_id?: number; 435 + }; 436 + 437 + export type FailureFailure = { 438 + error?: string; 439 + message?: string; 440 + reference_code?: string; 441 + }; 442 + 443 + export type ServiceWithEmptyTagData = { 444 + body?: never; 445 + path?: never; 446 + query?: never; 447 + url: '/api/v{api-version}/no+tag'; 448 + }; 449 + 450 + export type PatchApiVbyApiVersionNoTagData = { 451 + body?: never; 452 + path?: never; 453 + query?: never; 454 + url: '/api/v{api-version}/no+tag'; 455 + }; 456 + 457 + export type PatchApiVbyApiVersionNoTagResponses = { 458 + /** 459 + * OK 460 + */ 461 + default: unknown; 462 + }; 463 + 464 + export type FooWowData = { 465 + body?: never; 466 + path?: never; 467 + query?: never; 468 + url: '/api/v{api-version}/no+tag'; 469 + }; 470 + 471 + export type FooWowResponses = { 472 + /** 473 + * OK 474 + */ 475 + default: unknown; 476 + }; 477 + 478 + export type DeleteCallWithoutParametersAndResponseData = { 479 + body?: never; 480 + path?: never; 481 + query?: never; 482 + url: '/api/v{api-version}/simple'; 483 + }; 484 + 485 + export type GetCallWithoutParametersAndResponseData = { 486 + body?: never; 487 + path?: never; 488 + query?: never; 489 + url: '/api/v{api-version}/simple'; 490 + }; 491 + 492 + export type HeadCallWithoutParametersAndResponseData = { 493 + body?: never; 494 + path?: never; 495 + query?: never; 496 + url: '/api/v{api-version}/simple'; 497 + }; 498 + 499 + export type OptionsCallWithoutParametersAndResponseData = { 500 + body?: never; 501 + path?: never; 502 + query?: never; 503 + url: '/api/v{api-version}/simple'; 504 + }; 505 + 506 + export type PatchCallWithoutParametersAndResponseData = { 507 + body?: never; 508 + path?: never; 509 + query?: never; 510 + url: '/api/v{api-version}/simple'; 511 + }; 512 + 513 + export type PostCallWithoutParametersAndResponseData = { 514 + body?: never; 515 + path?: never; 516 + query?: never; 517 + url: '/api/v{api-version}/simple'; 518 + }; 519 + 520 + export type PutCallWithoutParametersAndResponseData = { 521 + body?: never; 522 + path?: never; 523 + query?: never; 524 + url: '/api/v{api-version}/simple'; 525 + }; 526 + 527 + export type CallWithDescriptionsData = { 528 + body?: never; 529 + path?: never; 530 + query?: { 531 + /** 532 + * Testing multiline comments in string: First line 533 + * Second line 534 + * 535 + * Fourth line 536 + */ 537 + parameterWithBreaks?: string; 538 + /** 539 + * Testing backticks in string: `backticks` and ```multiple backticks``` should work 540 + */ 541 + parameterWithBackticks?: string; 542 + /** 543 + * Testing slashes in string: \backwards\\\ and /forwards/// should work 544 + */ 545 + parameterWithSlashes?: string; 546 + /** 547 + * Testing expression placeholders in string: ${expression} should work 548 + */ 549 + parameterWithExpressionPlaceholders?: string; 550 + /** 551 + * Testing quotes in string: 'single quote''' and "double quotes""" should work 552 + */ 553 + parameterWithQuotes?: string; 554 + /** 555 + * Testing reserved characters in string: * inline * and ** inline ** should work 556 + */ 557 + parameterWithReservedCharacters?: string; 558 + }; 559 + url: '/api/v{api-version}/descriptions/'; 560 + }; 561 + 562 + export type CallWithParametersData = { 563 + body?: never; 564 + headers: { 565 + /** 566 + * This is the parameter that goes into the header 567 + */ 568 + parameterHeader: string; 569 + }; 570 + path: { 571 + /** 572 + * This is the parameter that goes into the path 573 + */ 574 + parameterPath: string; 575 + /** 576 + * api-version should be required in standalone clients 577 + */ 578 + 'api-version': string; 579 + }; 580 + query: { 581 + /** 582 + * This is the parameter that goes into the query params 583 + */ 584 + parameterQuery: string; 585 + }; 586 + url: '/api/v{api-version}/parameters/{parameterPath}'; 587 + }; 588 + 589 + export type CallWithWeirdParameterNamesData = { 590 + body?: never; 591 + headers: { 592 + /** 593 + * This is the parameter that goes into the request header 594 + */ 595 + 'parameter.header': string; 596 + }; 597 + path: { 598 + /** 599 + * This is the parameter that goes into the path 600 + */ 601 + 'parameter.path.1'?: string; 602 + /** 603 + * This is the parameter that goes into the path 604 + */ 605 + 'parameter-path-2'?: string; 606 + /** 607 + * This is the parameter that goes into the path 608 + */ 609 + 'PARAMETER-PATH-3'?: string; 610 + /** 611 + * api-version should be required in standalone clients 612 + */ 613 + 'api-version': string; 614 + }; 615 + query: { 616 + /** 617 + * This is the parameter with a reserved keyword 618 + */ 619 + default?: string; 620 + /** 621 + * This is the parameter that goes into the request query params 622 + */ 623 + 'parameter-query': string; 624 + }; 625 + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; 626 + }; 627 + 628 + export type CallWithDefaultParametersData = { 629 + body?: never; 630 + path?: never; 631 + query: { 632 + /** 633 + * This is a simple string with default value 634 + */ 635 + parameterString: string; 636 + /** 637 + * This is a simple number with default value 638 + */ 639 + parameterNumber: number; 640 + /** 641 + * This is a simple boolean with default value 642 + */ 643 + parameterBoolean: boolean; 644 + /** 645 + * This is a simple enum with default value 646 + */ 647 + parameterEnum: 'Success' | 'Warning' | 'Error'; 648 + /** 649 + * This is a model with one string property 650 + */ 651 + parameterModel: { 652 + /** 653 + * This is a simple string property 654 + */ 655 + prop?: string; 656 + }; 657 + }; 658 + url: '/api/v{api-version}/defaults'; 659 + }; 660 + 661 + export type CallWithDefaultOptionalParametersData = { 662 + body?: never; 663 + path?: never; 664 + query?: { 665 + /** 666 + * This is a simple string that is optional with default value 667 + */ 668 + parameterString?: string; 669 + /** 670 + * This is a simple number that is optional with default value 671 + */ 672 + parameterNumber?: number; 673 + /** 674 + * This is a simple boolean that is optional with default value 675 + */ 676 + parameterBoolean?: boolean; 677 + /** 678 + * This is a simple enum that is optional with default value 679 + */ 680 + parameterEnum?: 'Success' | 'Warning' | 'Error'; 681 + }; 682 + url: '/api/v{api-version}/defaults'; 683 + }; 684 + 685 + export type CallToTestOrderOfParamsData = { 686 + body?: never; 687 + path?: never; 688 + query: { 689 + /** 690 + * This is a optional string with default 691 + */ 692 + parameterOptionalStringWithDefault?: string; 693 + /** 694 + * This is a optional string with empty default 695 + */ 696 + parameterOptionalStringWithEmptyDefault?: string; 697 + /** 698 + * This is a optional string with no default 699 + */ 700 + parameterOptionalStringWithNoDefault?: string; 701 + /** 702 + * This is a string with default 703 + */ 704 + parameterStringWithDefault: string; 705 + /** 706 + * This is a string with empty default 707 + */ 708 + parameterStringWithEmptyDefault: string; 709 + /** 710 + * This is a string with no default 711 + */ 712 + parameterStringWithNoDefault: string; 713 + /** 714 + * This is a string that can be null with no default 715 + */ 716 + parameterStringNullableWithNoDefault?: string | null; 717 + /** 718 + * This is a string that can be null with default 719 + */ 720 + parameterStringNullableWithDefault?: string | null; 721 + }; 722 + url: '/api/v{api-version}/defaults'; 723 + }; 724 + 725 + export type DuplicateNameData = { 726 + body?: never; 727 + path?: never; 728 + query?: never; 729 + url: '/api/v{api-version}/duplicate'; 730 + }; 731 + 732 + export type DuplicateName2Data = { 733 + body?: never; 734 + path?: never; 735 + query?: never; 736 + url: '/api/v{api-version}/duplicate'; 737 + }; 738 + 739 + export type DuplicateName3Data = { 740 + body?: never; 741 + path?: never; 742 + query?: never; 743 + url: '/api/v{api-version}/duplicate'; 744 + }; 745 + 746 + export type DuplicateName4Data = { 747 + body?: never; 748 + path?: never; 749 + query?: never; 750 + url: '/api/v{api-version}/duplicate'; 751 + }; 752 + 753 + export type CallWithNoContentResponseData = { 754 + body?: never; 755 + path?: never; 756 + query?: never; 757 + url: '/api/v{api-version}/no-content'; 758 + }; 759 + 760 + export type CallWithNoContentResponseResponses = { 761 + /** 762 + * Success 763 + */ 764 + 204: unknown; 765 + }; 766 + 767 + export type CallWithResponseAndNoContentResponseData = { 768 + body?: never; 769 + path?: never; 770 + query?: never; 771 + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; 772 + }; 773 + 774 + export type CallWithResponseAndNoContentResponseResponses = { 775 + /** 776 + * Response is a simple number 777 + */ 778 + 200: number; 779 + /** 780 + * Success 781 + */ 782 + 204: unknown; 783 + }; 784 + 785 + export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; 786 + 787 + export type DummyAData = { 788 + body?: never; 789 + path?: never; 790 + query?: never; 791 + url: '/api/v{api-version}/multiple-tags/a'; 792 + }; 793 + 794 + export type DummyAResponses = { 795 + /** 796 + * Success 797 + */ 798 + 204: unknown; 799 + }; 800 + 801 + export type DummyBData = { 802 + body?: never; 803 + path?: never; 804 + query?: never; 805 + url: '/api/v{api-version}/multiple-tags/b'; 806 + }; 807 + 808 + export type DummyBResponses = { 809 + /** 810 + * Success 811 + */ 812 + 204: unknown; 813 + }; 814 + 815 + export type CallWithResponseData = { 816 + body?: never; 817 + path?: never; 818 + query?: never; 819 + url: '/api/v{api-version}/response'; 820 + }; 821 + 822 + export type CallWithResponseResponses = { 823 + /** 824 + * Message for default response 825 + */ 826 + default: ModelWithString; 827 + }; 828 + 829 + export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; 830 + 831 + export type CallWithDuplicateResponsesData = { 832 + body?: never; 833 + path?: never; 834 + query?: never; 835 + url: '/api/v{api-version}/response'; 836 + }; 837 + 838 + export type CallWithDuplicateResponsesErrors = { 839 + /** 840 + * Message for 500 error 841 + */ 842 + 500: ModelWithStringError; 843 + /** 844 + * Message for 501 error 845 + */ 846 + 501: ModelWithStringError; 847 + /** 848 + * Message for 502 error 849 + */ 850 + 502: ModelWithStringError; 851 + /** 852 + * Message for default response 853 + */ 854 + default: ModelWithString; 855 + }; 856 + 857 + export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; 858 + 859 + export type CallWithDuplicateResponsesResponses = { 860 + /** 861 + * Message for 201 response 862 + */ 863 + 201: ModelWithString; 864 + /** 865 + * Message for 202 response 866 + */ 867 + 202: ModelWithString; 868 + }; 869 + 870 + export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; 871 + 872 + export type CallWithResponsesData = { 873 + body?: never; 874 + path?: never; 875 + query?: never; 876 + url: '/api/v{api-version}/response'; 877 + }; 878 + 879 + export type CallWithResponsesErrors = { 880 + /** 881 + * Message for 500 error 882 + */ 883 + 500: ModelWithStringError; 884 + /** 885 + * Message for 501 error 886 + */ 887 + 501: ModelWithStringError; 888 + /** 889 + * Message for 502 error 890 + */ 891 + 502: ModelWithStringError; 892 + /** 893 + * Message for default response 894 + */ 895 + default: ModelWithString; 896 + }; 897 + 898 + export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; 899 + 900 + export type CallWithResponsesResponses = { 901 + /** 902 + * Message for 200 response 903 + */ 904 + 200: { 905 + readonly '@namespace.string'?: string; 906 + readonly '@namespace.integer'?: number; 907 + readonly value?: Array<ModelWithString>; 908 + }; 909 + /** 910 + * Message for 201 response 911 + */ 912 + 201: ModelThatExtends; 913 + /** 914 + * Message for 202 response 915 + */ 916 + 202: ModelThatExtendsExtends; 917 + }; 918 + 919 + export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; 920 + 921 + export type CollectionFormatData = { 922 + body?: never; 923 + path?: never; 924 + query: { 925 + /** 926 + * This is an array parameter that is sent as csv format (comma-separated values) 927 + */ 928 + parameterArrayCSV: Array<string>; 929 + /** 930 + * This is an array parameter that is sent as ssv format (space-separated values) 931 + */ 932 + parameterArraySSV: Array<string>; 933 + /** 934 + * This is an array parameter that is sent as tsv format (tab-separated values) 935 + */ 936 + parameterArrayTSV: Array<string>; 937 + /** 938 + * This is an array parameter that is sent as pipes format (pipe-separated values) 939 + */ 940 + parameterArrayPipes: Array<string>; 941 + /** 942 + * This is an array parameter that is sent as multi format (multiple parameter instances) 943 + */ 944 + parameterArrayMulti: Array<string>; 945 + }; 946 + url: '/api/v{api-version}/collectionFormat'; 947 + }; 948 + 949 + export type TypesData = { 950 + body?: never; 951 + path?: { 952 + /** 953 + * This is a number parameter 954 + */ 955 + id?: number; 956 + }; 957 + query: { 958 + /** 959 + * This is a number parameter 960 + */ 961 + parameterNumber: number; 962 + /** 963 + * This is a string parameter 964 + */ 965 + parameterString: string; 966 + /** 967 + * This is a boolean parameter 968 + */ 969 + parameterBoolean: boolean; 970 + /** 971 + * This is an array parameter 972 + */ 973 + parameterArray: Array<string>; 974 + /** 975 + * This is a dictionary parameter 976 + */ 977 + parameterDictionary: { 978 + [key: string]: unknown; 979 + }; 980 + /** 981 + * This is an enum parameter 982 + */ 983 + parameterEnum: 'Success' | 'Warning' | 'Error'; 984 + }; 985 + url: '/api/v{api-version}/types'; 986 + }; 987 + 988 + export type TypesResponses = { 989 + /** 990 + * Response is a simple number 991 + */ 992 + 200: number; 993 + /** 994 + * Response is a simple string 995 + */ 996 + 201: string; 997 + /** 998 + * Response is a simple boolean 999 + */ 1000 + 202: boolean; 1001 + /** 1002 + * Response is a simple object 1003 + */ 1004 + 203: { 1005 + [key: string]: unknown; 1006 + }; 1007 + }; 1008 + 1009 + export type TypesResponse = TypesResponses[keyof TypesResponses]; 1010 + 1011 + export type ComplexTypesData = { 1012 + body?: never; 1013 + path?: never; 1014 + query: { 1015 + /** 1016 + * Parameter containing object 1017 + */ 1018 + parameterObject: { 1019 + first?: { 1020 + second?: { 1021 + third?: string; 1022 + }; 1023 + }; 1024 + }; 1025 + /** 1026 + * This is a model with one string property 1027 + */ 1028 + parameterReference: { 1029 + /** 1030 + * This is a simple string property 1031 + */ 1032 + prop?: string; 1033 + }; 1034 + }; 1035 + url: '/api/v{api-version}/complex'; 1036 + }; 1037 + 1038 + export type ComplexTypesErrors = { 1039 + /** 1040 + * 400 server error 1041 + */ 1042 + 400: unknown; 1043 + /** 1044 + * 500 server error 1045 + */ 1046 + 500: unknown; 1047 + }; 1048 + 1049 + export type ComplexTypesResponses = { 1050 + /** 1051 + * Successful response 1052 + */ 1053 + 200: Array<ModelWithString>; 1054 + }; 1055 + 1056 + export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; 1057 + 1058 + export type CallWithResultFromHeaderData = { 1059 + body?: never; 1060 + path?: never; 1061 + query?: never; 1062 + url: '/api/v{api-version}/header'; 1063 + }; 1064 + 1065 + export type CallWithResultFromHeaderErrors = { 1066 + /** 1067 + * 400 server error 1068 + */ 1069 + 400: unknown; 1070 + /** 1071 + * 500 server error 1072 + */ 1073 + 500: unknown; 1074 + }; 1075 + 1076 + export type CallWithResultFromHeaderResponses = { 1077 + /** 1078 + * Successful response 1079 + */ 1080 + 200: unknown; 1081 + }; 1082 + 1083 + export type TestErrorCodeData = { 1084 + body?: never; 1085 + path?: never; 1086 + query: { 1087 + /** 1088 + * Status code to return 1089 + */ 1090 + status: string; 1091 + }; 1092 + url: '/api/v{api-version}/error'; 1093 + }; 1094 + 1095 + export type TestErrorCodeErrors = { 1096 + /** 1097 + * Custom message: Internal Server Error 1098 + */ 1099 + 500: unknown; 1100 + /** 1101 + * Custom message: Not Implemented 1102 + */ 1103 + 501: unknown; 1104 + /** 1105 + * Custom message: Bad Gateway 1106 + */ 1107 + 502: unknown; 1108 + /** 1109 + * Custom message: Service Unavailable 1110 + */ 1111 + 503: unknown; 1112 + }; 1113 + 1114 + export type TestErrorCodeResponses = { 1115 + /** 1116 + * Custom message: Successful response 1117 + */ 1118 + 200: unknown; 1119 + }; 1120 + 1121 + export type NonAsciiæøåÆøÅöôêÊ字符串Data = { 1122 + body?: never; 1123 + path?: never; 1124 + query: { 1125 + /** 1126 + * Dummy input param 1127 + */ 1128 + nonAsciiParamæøåÆØÅöôêÊ: number; 1129 + }; 1130 + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; 1131 + }; 1132 + 1133 + export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { 1134 + /** 1135 + * Successful response 1136 + */ 1137 + 200: NonAsciiStringæøåÆøÅöôêÊ字符串; 1138 + }; 1139 + 1140 + export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; 1141 + 1142 + export type PostApiVbyApiVersionBodyData = { 1143 + /** 1144 + * Body should not be unknown 1145 + */ 1146 + body: ParameterActivityParams; 1147 + path?: never; 1148 + query?: never; 1149 + url: '/api/v{api-version}/body'; 1150 + }; 1151 + 1152 + export type PostApiVbyApiVersionBodyErrors = { 1153 + /** 1154 + * Bad Request 1155 + */ 1156 + 400: FailureFailure; 1157 + /** 1158 + * Internal Server Error 1159 + */ 1160 + 500: FailureFailure; 1161 + }; 1162 + 1163 + export type PostApiVbyApiVersionBodyError = PostApiVbyApiVersionBodyErrors[keyof PostApiVbyApiVersionBodyErrors]; 1164 + 1165 + export type PostApiVbyApiVersionBodyResponses = { 1166 + /** 1167 + * OK 1168 + */ 1169 + 200: ResponsePostActivityResponse; 1170 + }; 1171 + 1172 + export type PostApiVbyApiVersionBodyResponse = PostApiVbyApiVersionBodyResponses[keyof PostApiVbyApiVersionBodyResponses]; 1173 + 1174 + export type ClientOptions = { 1175 + baseUrl: 'http://localhost:3000/base' | (string & {}); 1176 + };
-17
packages/openapi-ts-tests/test/__snapshots__/2.0.x/plugins/@tanstack/angular-query-experimental/asClass/sdk.gen.ts
··· 54 54 } 55 55 }); 56 56 } 57 - 58 57 } 59 58 60 59 export class SimpleService { ··· 106 105 ...options 107 106 }); 108 107 } 109 - 110 108 } 111 109 112 110 export class DescriptionsService { ··· 116 114 ...options 117 115 }); 118 116 } 119 - 120 117 } 121 118 122 119 export class ParametersService { ··· 133 130 ...options 134 131 }); 135 132 } 136 - 137 133 } 138 134 139 135 export class DefaultsService { ··· 157 153 ...options 158 154 }); 159 155 } 160 - 161 156 } 162 157 163 158 export class DuplicateService { ··· 188 183 ...options 189 184 }); 190 185 } 191 - 192 186 } 193 187 194 188 export class NoContentService { ··· 205 199 ...options 206 200 }); 207 201 } 208 - 209 202 } 210 203 211 204 export class ResponseService { ··· 236 229 ...options 237 230 }); 238 231 } 239 - 240 232 } 241 233 242 234 export class MultipleTags1Service { ··· 253 245 ...options 254 246 }); 255 247 } 256 - 257 248 } 258 249 259 250 export class MultipleTags2Service { ··· 270 261 ...options 271 262 }); 272 263 } 273 - 274 264 } 275 265 276 266 export class MultipleTags3Service { ··· 280 270 ...options 281 271 }); 282 272 } 283 - 284 273 } 285 274 286 275 export class CollectionFormatService { ··· 296 285 ...options 297 286 }); 298 287 } 299 - 300 288 } 301 289 302 290 export class TypesService { ··· 312 300 ...options 313 301 }); 314 302 } 315 - 316 303 } 317 304 318 305 export class ComplexService { ··· 322 309 ...options 323 310 }); 324 311 } 325 - 326 312 } 327 313 328 314 export class HeaderService { ··· 332 318 ...options 333 319 }); 334 320 } 335 - 336 321 } 337 322 338 323 export class ErrorService { ··· 342 327 ...options 343 328 }); 344 329 } 345 - 346 330 } 347 331 348 332 export class NonAsciiÆøåÆøÅöôêÊService { ··· 352 336 ...options 353 337 }); 354 338 } 355 - 356 339 }
-17
packages/openapi-ts-tests/test/__snapshots__/2.0.x/plugins/@tanstack/react-query/asClass/sdk.gen.ts
··· 54 54 } 55 55 }); 56 56 } 57 - 58 57 } 59 58 60 59 export class SimpleService { ··· 106 105 ...options 107 106 }); 108 107 } 109 - 110 108 } 111 109 112 110 export class DescriptionsService { ··· 116 114 ...options 117 115 }); 118 116 } 119 - 120 117 } 121 118 122 119 export class ParametersService { ··· 133 130 ...options 134 131 }); 135 132 } 136 - 137 133 } 138 134 139 135 export class DefaultsService { ··· 157 153 ...options 158 154 }); 159 155 } 160 - 161 156 } 162 157 163 158 export class DuplicateService { ··· 188 183 ...options 189 184 }); 190 185 } 191 - 192 186 } 193 187 194 188 export class NoContentService { ··· 205 199 ...options 206 200 }); 207 201 } 208 - 209 202 } 210 203 211 204 export class ResponseService { ··· 236 229 ...options 237 230 }); 238 231 } 239 - 240 232 } 241 233 242 234 export class MultipleTags1Service { ··· 253 245 ...options 254 246 }); 255 247 } 256 - 257 248 } 258 249 259 250 export class MultipleTags2Service { ··· 270 261 ...options 271 262 }); 272 263 } 273 - 274 264 } 275 265 276 266 export class MultipleTags3Service { ··· 280 270 ...options 281 271 }); 282 272 } 283 - 284 273 } 285 274 286 275 export class CollectionFormatService { ··· 296 285 ...options 297 286 }); 298 287 } 299 - 300 288 } 301 289 302 290 export class TypesService { ··· 312 300 ...options 313 301 }); 314 302 } 315 - 316 303 } 317 304 318 305 export class ComplexService { ··· 322 309 ...options 323 310 }); 324 311 } 325 - 326 312 } 327 313 328 314 export class HeaderService { ··· 332 318 ...options 333 319 }); 334 320 } 335 - 336 321 } 337 322 338 323 export class ErrorService { ··· 342 327 ...options 343 328 }); 344 329 } 345 - 346 330 } 347 331 348 332 export class NonAsciiÆøåÆøÅöôêÊService { ··· 352 336 ...options 353 337 }); 354 338 } 355 - 356 339 }
-17
packages/openapi-ts-tests/test/__snapshots__/2.0.x/plugins/@tanstack/solid-query/asClass/sdk.gen.ts
··· 54 54 } 55 55 }); 56 56 } 57 - 58 57 } 59 58 60 59 export class SimpleService { ··· 106 105 ...options 107 106 }); 108 107 } 109 - 110 108 } 111 109 112 110 export class DescriptionsService { ··· 116 114 ...options 117 115 }); 118 116 } 119 - 120 117 } 121 118 122 119 export class ParametersService { ··· 133 130 ...options 134 131 }); 135 132 } 136 - 137 133 } 138 134 139 135 export class DefaultsService { ··· 157 153 ...options 158 154 }); 159 155 } 160 - 161 156 } 162 157 163 158 export class DuplicateService { ··· 188 183 ...options 189 184 }); 190 185 } 191 - 192 186 } 193 187 194 188 export class NoContentService { ··· 205 199 ...options 206 200 }); 207 201 } 208 - 209 202 } 210 203 211 204 export class ResponseService { ··· 236 229 ...options 237 230 }); 238 231 } 239 - 240 232 } 241 233 242 234 export class MultipleTags1Service { ··· 253 245 ...options 254 246 }); 255 247 } 256 - 257 248 } 258 249 259 250 export class MultipleTags2Service { ··· 270 261 ...options 271 262 }); 272 263 } 273 - 274 264 } 275 265 276 266 export class MultipleTags3Service { ··· 280 270 ...options 281 271 }); 282 272 } 283 - 284 273 } 285 274 286 275 export class CollectionFormatService { ··· 296 285 ...options 297 286 }); 298 287 } 299 - 300 288 } 301 289 302 290 export class TypesService { ··· 312 300 ...options 313 301 }); 314 302 } 315 - 316 303 } 317 304 318 305 export class ComplexService { ··· 322 309 ...options 323 310 }); 324 311 } 325 - 326 312 } 327 313 328 314 export class HeaderService { ··· 332 318 ...options 333 319 }); 334 320 } 335 - 336 321 } 337 322 338 323 export class ErrorService { ··· 342 327 ...options 343 328 }); 344 329 } 345 - 346 330 } 347 331 348 332 export class NonAsciiÆøåÆøÅöôêÊService { ··· 352 336 ...options 353 337 }); 354 338 } 355 - 356 339 }
-17
packages/openapi-ts-tests/test/__snapshots__/2.0.x/plugins/@tanstack/svelte-query/asClass/sdk.gen.ts
··· 54 54 } 55 55 }); 56 56 } 57 - 58 57 } 59 58 60 59 export class SimpleService { ··· 106 105 ...options 107 106 }); 108 107 } 109 - 110 108 } 111 109 112 110 export class DescriptionsService { ··· 116 114 ...options 117 115 }); 118 116 } 119 - 120 117 } 121 118 122 119 export class ParametersService { ··· 133 130 ...options 134 131 }); 135 132 } 136 - 137 133 } 138 134 139 135 export class DefaultsService { ··· 157 153 ...options 158 154 }); 159 155 } 160 - 161 156 } 162 157 163 158 export class DuplicateService { ··· 188 183 ...options 189 184 }); 190 185 } 191 - 192 186 } 193 187 194 188 export class NoContentService { ··· 205 199 ...options 206 200 }); 207 201 } 208 - 209 202 } 210 203 211 204 export class ResponseService { ··· 236 229 ...options 237 230 }); 238 231 } 239 - 240 232 } 241 233 242 234 export class MultipleTags1Service { ··· 253 245 ...options 254 246 }); 255 247 } 256 - 257 248 } 258 249 259 250 export class MultipleTags2Service { ··· 270 261 ...options 271 262 }); 272 263 } 273 - 274 264 } 275 265 276 266 export class MultipleTags3Service { ··· 280 270 ...options 281 271 }); 282 272 } 283 - 284 273 } 285 274 286 275 export class CollectionFormatService { ··· 296 285 ...options 297 286 }); 298 287 } 299 - 300 288 } 301 289 302 290 export class TypesService { ··· 312 300 ...options 313 301 }); 314 302 } 315 - 316 303 } 317 304 318 305 export class ComplexService { ··· 322 309 ...options 323 310 }); 324 311 } 325 - 326 312 } 327 313 328 314 export class HeaderService { ··· 332 318 ...options 333 319 }); 334 320 } 335 - 336 321 } 337 322 338 323 export class ErrorService { ··· 342 327 ...options 343 328 }); 344 329 } 345 - 346 330 } 347 331 348 332 export class NonAsciiÆøåÆøÅöôêÊService { ··· 352 336 ...options 353 337 }); 354 338 } 355 - 356 339 }
-17
packages/openapi-ts-tests/test/__snapshots__/2.0.x/plugins/@tanstack/vue-query/asClass/sdk.gen.ts
··· 54 54 } 55 55 }); 56 56 } 57 - 58 57 } 59 58 60 59 export class SimpleService { ··· 106 105 ...options 107 106 }); 108 107 } 109 - 110 108 } 111 109 112 110 export class DescriptionsService { ··· 116 114 ...options 117 115 }); 118 116 } 119 - 120 117 } 121 118 122 119 export class ParametersService { ··· 133 130 ...options 134 131 }); 135 132 } 136 - 137 133 } 138 134 139 135 export class DefaultsService { ··· 157 153 ...options 158 154 }); 159 155 } 160 - 161 156 } 162 157 163 158 export class DuplicateService { ··· 188 183 ...options 189 184 }); 190 185 } 191 - 192 186 } 193 187 194 188 export class NoContentService { ··· 205 199 ...options 206 200 }); 207 201 } 208 - 209 202 } 210 203 211 204 export class ResponseService { ··· 236 229 ...options 237 230 }); 238 231 } 239 - 240 232 } 241 233 242 234 export class MultipleTags1Service { ··· 253 245 ...options 254 246 }); 255 247 } 256 - 257 248 } 258 249 259 250 export class MultipleTags2Service { ··· 270 261 ...options 271 262 }); 272 263 } 273 - 274 264 } 275 265 276 266 export class MultipleTags3Service { ··· 280 270 ...options 281 271 }); 282 272 } 283 - 284 273 } 285 274 286 275 export class CollectionFormatService { ··· 296 285 ...options 297 286 }); 298 287 } 299 - 300 288 } 301 289 302 290 export class TypesService { ··· 312 300 ...options 313 301 }); 314 302 } 315 - 316 303 } 317 304 318 305 export class ComplexService { ··· 322 309 ...options 323 310 }); 324 311 } 325 - 326 312 } 327 313 328 314 export class HeaderService { ··· 332 318 ...options 333 319 }); 334 320 } 335 - 336 321 } 337 322 338 323 export class ErrorService { ··· 342 327 ...options 343 328 }); 344 329 } 345 - 346 330 } 347 331 348 332 export class NonAsciiÆøåÆøÅöôêÊService { ··· 352 336 ...options 353 337 }); 354 338 } 355 - 356 339 }
+18
packages/openapi-ts-tests/test/__snapshots__/3.0.x/plugins/@hey-api/sdk/instance/client.gen.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + 3 + import type { ClientOptions } from './types.gen'; 4 + import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; 5 + 6 + /** 7 + * The `createClientConfig()` function will be called on client initialization 8 + * and the returned object will become the client's initial configuration. 9 + * 10 + * You may want to initialize your client this way instead of calling 11 + * `setConfig()`. This is useful for example if you're using Next.js 12 + * to ensure your client always has the correct values. 13 + */ 14 + export type CreateClientConfig<T extends DefaultClientOptions = ClientOptions> = (override?: Config<DefaultClientOptions & T>) => Config<Required<DefaultClientOptions> & T>; 15 + 16 + export const client = createClient(createConfig<ClientOptions>({ 17 + baseUrl: 'http://localhost:3000/base' 18 + }));
+3
packages/openapi-ts-tests/test/__snapshots__/3.0.x/plugins/@hey-api/sdk/instance/index.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + export * from './types.gen'; 3 + export * from './sdk.gen';
+421
packages/openapi-ts-tests/test/__snapshots__/3.0.x/plugins/@hey-api/sdk/instance/sdk.gen.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + 3 + import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-fetch'; 4 + import type { ExportData, PatchApiVbyApiVersionNoTagData, PatchApiVbyApiVersionNoTagResponses, ImportData, ImportResponses, FooWowData, FooWowResponses, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponses, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponses, GetApiVbyApiVersionSimpleOperationErrors, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponses, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponses, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponses, DummyAData, DummyAResponses, DummyBData, DummyBResponses, CallWithResponseData, CallWithResponseResponses, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponses, CallWithDuplicateResponsesErrors, CallWithResponsesData, CallWithResponsesResponses, CallWithResponsesErrors, CollectionFormatData, TypesData, TypesResponses, UploadFileData, UploadFileResponses, FileResponseData, FileResponseResponses, ComplexTypesData, ComplexTypesResponses, ComplexTypesErrors, MultipartResponseData, MultipartResponseResponses, MultipartRequestData, ComplexParamsData, ComplexParamsResponses, CallWithResultFromHeaderData, CallWithResultFromHeaderResponses, CallWithResultFromHeaderErrors, TestErrorCodeData, TestErrorCodeResponses, TestErrorCodeErrors, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Responses, PutWithFormUrlEncodedData } from './types.gen'; 5 + import { client as _heyApiClient } from './client.gen'; 6 + 7 + export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = ClientOptions<TData, ThrowOnError> & { 8 + /** 9 + * You can provide a client instance returned by `createClient()` instead of 10 + * individual options. This might be also useful if you want to implement a 11 + * custom client. 12 + */ 13 + client?: Client; 14 + /** 15 + * You can pass arbitrary values through the `meta` object. This can be 16 + * used to access values that aren't defined as part of the SDK function. 17 + */ 18 + meta?: Record<string, unknown>; 19 + }; 20 + 21 + export class Sdk { 22 + client: Client = _heyApiClient; 23 + 24 + constructor({ client }: { 25 + client?: Client; 26 + }) { 27 + if (client) { 28 + this.client = client; 29 + } 30 + } 31 + 32 + public export<ThrowOnError extends boolean = false>(options?: Options<ExportData, ThrowOnError>) { 33 + return (options?.client ?? this.client).get<unknown, unknown, ThrowOnError>({ 34 + url: '/api/v{api-version}/no+tag', 35 + ...options 36 + }); 37 + } 38 + 39 + public patchApiVbyApiVersionNoTag<ThrowOnError extends boolean = false>(options?: Options<PatchApiVbyApiVersionNoTagData, ThrowOnError>) { 40 + return (options?.client ?? this.client).patch<PatchApiVbyApiVersionNoTagResponses, unknown, ThrowOnError>({ 41 + url: '/api/v{api-version}/no+tag', 42 + ...options 43 + }); 44 + } 45 + 46 + public import<ThrowOnError extends boolean = false>(options: Options<ImportData, ThrowOnError>) { 47 + return (options.client ?? this.client).post<ImportResponses, unknown, ThrowOnError>({ 48 + url: '/api/v{api-version}/no+tag', 49 + ...options, 50 + headers: { 51 + 'Content-Type': 'application/json', 52 + ...options.headers 53 + } 54 + }); 55 + } 56 + 57 + public fooWow<ThrowOnError extends boolean = false>(options?: Options<FooWowData, ThrowOnError>) { 58 + return (options?.client ?? this.client).put<FooWowResponses, unknown, ThrowOnError>({ 59 + url: '/api/v{api-version}/no+tag', 60 + ...options 61 + }); 62 + } 63 + 64 + public apiVVersionODataControllerCount<ThrowOnError extends boolean = false>(options?: Options<ApiVVersionODataControllerCountData, ThrowOnError>) { 65 + return (options?.client ?? this.client).get<ApiVVersionODataControllerCountResponses, unknown, ThrowOnError>({ 66 + url: '/api/v{api-version}/simple/$count', 67 + ...options 68 + }); 69 + } 70 + 71 + public getApiVbyApiVersionSimpleOperation<ThrowOnError extends boolean = false>(options: Options<GetApiVbyApiVersionSimpleOperationData, ThrowOnError>) { 72 + return (options.client ?? this.client).get<GetApiVbyApiVersionSimpleOperationResponses, GetApiVbyApiVersionSimpleOperationErrors, ThrowOnError>({ 73 + url: '/api/v{api-version}/simple:operation', 74 + ...options 75 + }); 76 + } 77 + 78 + public deleteCallWithoutParametersAndResponse<ThrowOnError extends boolean = false>(options?: Options<DeleteCallWithoutParametersAndResponseData, ThrowOnError>) { 79 + return (options?.client ?? this.client).delete<unknown, unknown, ThrowOnError>({ 80 + url: '/api/v{api-version}/simple', 81 + ...options 82 + }); 83 + } 84 + 85 + public getCallWithoutParametersAndResponse<ThrowOnError extends boolean = false>(options?: Options<GetCallWithoutParametersAndResponseData, ThrowOnError>) { 86 + return (options?.client ?? this.client).get<unknown, unknown, ThrowOnError>({ 87 + url: '/api/v{api-version}/simple', 88 + ...options 89 + }); 90 + } 91 + 92 + public headCallWithoutParametersAndResponse<ThrowOnError extends boolean = false>(options?: Options<HeadCallWithoutParametersAndResponseData, ThrowOnError>) { 93 + return (options?.client ?? this.client).head<unknown, unknown, ThrowOnError>({ 94 + url: '/api/v{api-version}/simple', 95 + ...options 96 + }); 97 + } 98 + 99 + public optionsCallWithoutParametersAndResponse<ThrowOnError extends boolean = false>(options?: Options<OptionsCallWithoutParametersAndResponseData, ThrowOnError>) { 100 + return (options?.client ?? this.client).options<unknown, unknown, ThrowOnError>({ 101 + url: '/api/v{api-version}/simple', 102 + ...options 103 + }); 104 + } 105 + 106 + public patchCallWithoutParametersAndResponse<ThrowOnError extends boolean = false>(options?: Options<PatchCallWithoutParametersAndResponseData, ThrowOnError>) { 107 + return (options?.client ?? this.client).patch<unknown, unknown, ThrowOnError>({ 108 + url: '/api/v{api-version}/simple', 109 + ...options 110 + }); 111 + } 112 + 113 + public postCallWithoutParametersAndResponse<ThrowOnError extends boolean = false>(options?: Options<PostCallWithoutParametersAndResponseData, ThrowOnError>) { 114 + return (options?.client ?? this.client).post<unknown, unknown, ThrowOnError>({ 115 + url: '/api/v{api-version}/simple', 116 + ...options 117 + }); 118 + } 119 + 120 + public putCallWithoutParametersAndResponse<ThrowOnError extends boolean = false>(options?: Options<PutCallWithoutParametersAndResponseData, ThrowOnError>) { 121 + return (options?.client ?? this.client).put<unknown, unknown, ThrowOnError>({ 122 + url: '/api/v{api-version}/simple', 123 + ...options 124 + }); 125 + } 126 + 127 + public deleteFoo<ThrowOnError extends boolean = false>(options: Options<DeleteFooData3, ThrowOnError>) { 128 + return (options.client ?? this.client).delete<unknown, unknown, ThrowOnError>({ 129 + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', 130 + ...options 131 + }); 132 + } 133 + 134 + public callWithDescriptions<ThrowOnError extends boolean = false>(options?: Options<CallWithDescriptionsData, ThrowOnError>) { 135 + return (options?.client ?? this.client).post<unknown, unknown, ThrowOnError>({ 136 + url: '/api/v{api-version}/descriptions', 137 + ...options 138 + }); 139 + } 140 + 141 + /** 142 + * @deprecated 143 + */ 144 + public deprecatedCall<ThrowOnError extends boolean = false>(options: Options<DeprecatedCallData, ThrowOnError>) { 145 + return (options.client ?? this.client).post<unknown, unknown, ThrowOnError>({ 146 + url: '/api/v{api-version}/parameters/deprecated', 147 + ...options 148 + }); 149 + } 150 + 151 + public callWithParameters<ThrowOnError extends boolean = false>(options: Options<CallWithParametersData, ThrowOnError>) { 152 + return (options.client ?? this.client).post<unknown, unknown, ThrowOnError>({ 153 + url: '/api/v{api-version}/parameters/{parameterPath}', 154 + ...options, 155 + headers: { 156 + 'Content-Type': 'application/json', 157 + ...options.headers 158 + } 159 + }); 160 + } 161 + 162 + public callWithWeirdParameterNames<ThrowOnError extends boolean = false>(options: Options<CallWithWeirdParameterNamesData, ThrowOnError>) { 163 + return (options.client ?? this.client).post<unknown, unknown, ThrowOnError>({ 164 + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', 165 + ...options, 166 + headers: { 167 + 'Content-Type': 'application/json', 168 + ...options.headers 169 + } 170 + }); 171 + } 172 + 173 + public getCallWithOptionalParam<ThrowOnError extends boolean = false>(options: Options<GetCallWithOptionalParamData, ThrowOnError>) { 174 + return (options.client ?? this.client).get<unknown, unknown, ThrowOnError>({ 175 + url: '/api/v{api-version}/parameters', 176 + ...options, 177 + headers: { 178 + 'Content-Type': 'application/json', 179 + ...options.headers 180 + } 181 + }); 182 + } 183 + 184 + public postCallWithOptionalParam<ThrowOnError extends boolean = false>(options: Options<PostCallWithOptionalParamData, ThrowOnError>) { 185 + return (options.client ?? this.client).post<PostCallWithOptionalParamResponses, unknown, ThrowOnError>({ 186 + url: '/api/v{api-version}/parameters', 187 + ...options, 188 + headers: { 189 + 'Content-Type': 'application/json', 190 + ...options.headers 191 + } 192 + }); 193 + } 194 + 195 + public postApiVbyApiVersionRequestBody<ThrowOnError extends boolean = false>(options?: Options<PostApiVbyApiVersionRequestBodyData, ThrowOnError>) { 196 + return (options?.client ?? this.client).post<unknown, unknown, ThrowOnError>({ 197 + url: '/api/v{api-version}/requestBody', 198 + ...options, 199 + headers: { 200 + 'Content-Type': 'application/json', 201 + ...options?.headers 202 + } 203 + }); 204 + } 205 + 206 + public postApiVbyApiVersionFormData<ThrowOnError extends boolean = false>(options?: Options<PostApiVbyApiVersionFormDataData, ThrowOnError>) { 207 + return (options?.client ?? this.client).post<unknown, unknown, ThrowOnError>({ 208 + ...formDataBodySerializer, 209 + url: '/api/v{api-version}/formData', 210 + ...options, 211 + headers: { 212 + 'Content-Type': null, 213 + ...options?.headers 214 + } 215 + }); 216 + } 217 + 218 + public callWithDefaultParameters<ThrowOnError extends boolean = false>(options?: Options<CallWithDefaultParametersData, ThrowOnError>) { 219 + return (options?.client ?? this.client).get<unknown, unknown, ThrowOnError>({ 220 + url: '/api/v{api-version}/defaults', 221 + ...options 222 + }); 223 + } 224 + 225 + public callWithDefaultOptionalParameters<ThrowOnError extends boolean = false>(options?: Options<CallWithDefaultOptionalParametersData, ThrowOnError>) { 226 + return (options?.client ?? this.client).post<unknown, unknown, ThrowOnError>({ 227 + url: '/api/v{api-version}/defaults', 228 + ...options 229 + }); 230 + } 231 + 232 + public callToTestOrderOfParams<ThrowOnError extends boolean = false>(options: Options<CallToTestOrderOfParamsData, ThrowOnError>) { 233 + return (options.client ?? this.client).put<unknown, unknown, ThrowOnError>({ 234 + url: '/api/v{api-version}/defaults', 235 + ...options 236 + }); 237 + } 238 + 239 + public duplicateName<ThrowOnError extends boolean = false>(options?: Options<DuplicateNameData, ThrowOnError>) { 240 + return (options?.client ?? this.client).delete<unknown, unknown, ThrowOnError>({ 241 + url: '/api/v{api-version}/duplicate', 242 + ...options 243 + }); 244 + } 245 + 246 + public duplicateName2<ThrowOnError extends boolean = false>(options?: Options<DuplicateName2Data, ThrowOnError>) { 247 + return (options?.client ?? this.client).get<unknown, unknown, ThrowOnError>({ 248 + url: '/api/v{api-version}/duplicate', 249 + ...options 250 + }); 251 + } 252 + 253 + public duplicateName3<ThrowOnError extends boolean = false>(options?: Options<DuplicateName3Data, ThrowOnError>) { 254 + return (options?.client ?? this.client).post<unknown, unknown, ThrowOnError>({ 255 + url: '/api/v{api-version}/duplicate', 256 + ...options 257 + }); 258 + } 259 + 260 + public duplicateName4<ThrowOnError extends boolean = false>(options?: Options<DuplicateName4Data, ThrowOnError>) { 261 + return (options?.client ?? this.client).put<unknown, unknown, ThrowOnError>({ 262 + url: '/api/v{api-version}/duplicate', 263 + ...options 264 + }); 265 + } 266 + 267 + public callWithNoContentResponse<ThrowOnError extends boolean = false>(options?: Options<CallWithNoContentResponseData, ThrowOnError>) { 268 + return (options?.client ?? this.client).get<CallWithNoContentResponseResponses, unknown, ThrowOnError>({ 269 + url: '/api/v{api-version}/no-content', 270 + ...options 271 + }); 272 + } 273 + 274 + public callWithResponseAndNoContentResponse<ThrowOnError extends boolean = false>(options?: Options<CallWithResponseAndNoContentResponseData, ThrowOnError>) { 275 + return (options?.client ?? this.client).get<CallWithResponseAndNoContentResponseResponses, unknown, ThrowOnError>({ 276 + url: '/api/v{api-version}/multiple-tags/response-and-no-content', 277 + ...options 278 + }); 279 + } 280 + 281 + public dummyA<ThrowOnError extends boolean = false>(options?: Options<DummyAData, ThrowOnError>) { 282 + return (options?.client ?? this.client).get<DummyAResponses, unknown, ThrowOnError>({ 283 + url: '/api/v{api-version}/multiple-tags/a', 284 + ...options 285 + }); 286 + } 287 + 288 + public dummyB<ThrowOnError extends boolean = false>(options?: Options<DummyBData, ThrowOnError>) { 289 + return (options?.client ?? this.client).get<DummyBResponses, unknown, ThrowOnError>({ 290 + url: '/api/v{api-version}/multiple-tags/b', 291 + ...options 292 + }); 293 + } 294 + 295 + public callWithResponse<ThrowOnError extends boolean = false>(options?: Options<CallWithResponseData, ThrowOnError>) { 296 + return (options?.client ?? this.client).get<CallWithResponseResponses, unknown, ThrowOnError>({ 297 + url: '/api/v{api-version}/response', 298 + ...options 299 + }); 300 + } 301 + 302 + public callWithDuplicateResponses<ThrowOnError extends boolean = false>(options?: Options<CallWithDuplicateResponsesData, ThrowOnError>) { 303 + return (options?.client ?? this.client).post<CallWithDuplicateResponsesResponses, CallWithDuplicateResponsesErrors, ThrowOnError>({ 304 + url: '/api/v{api-version}/response', 305 + ...options 306 + }); 307 + } 308 + 309 + public callWithResponses<ThrowOnError extends boolean = false>(options?: Options<CallWithResponsesData, ThrowOnError>) { 310 + return (options?.client ?? this.client).put<CallWithResponsesResponses, CallWithResponsesErrors, ThrowOnError>({ 311 + url: '/api/v{api-version}/response', 312 + ...options 313 + }); 314 + } 315 + 316 + public collectionFormat<ThrowOnError extends boolean = false>(options: Options<CollectionFormatData, ThrowOnError>) { 317 + return (options.client ?? this.client).get<unknown, unknown, ThrowOnError>({ 318 + url: '/api/v{api-version}/collectionFormat', 319 + ...options 320 + }); 321 + } 322 + 323 + public types<ThrowOnError extends boolean = false>(options: Options<TypesData, ThrowOnError>) { 324 + return (options.client ?? this.client).get<TypesResponses, unknown, ThrowOnError>({ 325 + url: '/api/v{api-version}/types', 326 + ...options 327 + }); 328 + } 329 + 330 + public uploadFile<ThrowOnError extends boolean = false>(options: Options<UploadFileData, ThrowOnError>) { 331 + return (options.client ?? this.client).post<UploadFileResponses, unknown, ThrowOnError>({ 332 + ...urlSearchParamsBodySerializer, 333 + url: '/api/v{api-version}/upload', 334 + ...options, 335 + headers: { 336 + 'Content-Type': 'application/x-www-form-urlencoded', 337 + ...options.headers 338 + } 339 + }); 340 + } 341 + 342 + public fileResponse<ThrowOnError extends boolean = false>(options: Options<FileResponseData, ThrowOnError>) { 343 + return (options.client ?? this.client).get<FileResponseResponses, unknown, ThrowOnError>({ 344 + url: '/api/v{api-version}/file/{id}', 345 + ...options 346 + }); 347 + } 348 + 349 + public complexTypes<ThrowOnError extends boolean = false>(options: Options<ComplexTypesData, ThrowOnError>) { 350 + return (options.client ?? this.client).get<ComplexTypesResponses, ComplexTypesErrors, ThrowOnError>({ 351 + url: '/api/v{api-version}/complex', 352 + ...options 353 + }); 354 + } 355 + 356 + public multipartResponse<ThrowOnError extends boolean = false>(options?: Options<MultipartResponseData, ThrowOnError>) { 357 + return (options?.client ?? this.client).get<MultipartResponseResponses, unknown, ThrowOnError>({ 358 + url: '/api/v{api-version}/multipart', 359 + ...options 360 + }); 361 + } 362 + 363 + public multipartRequest<ThrowOnError extends boolean = false>(options?: Options<MultipartRequestData, ThrowOnError>) { 364 + return (options?.client ?? this.client).post<unknown, unknown, ThrowOnError>({ 365 + ...formDataBodySerializer, 366 + url: '/api/v{api-version}/multipart', 367 + ...options, 368 + headers: { 369 + 'Content-Type': null, 370 + ...options?.headers 371 + } 372 + }); 373 + } 374 + 375 + public complexParams<ThrowOnError extends boolean = false>(options: Options<ComplexParamsData, ThrowOnError>) { 376 + return (options.client ?? this.client).put<ComplexParamsResponses, unknown, ThrowOnError>({ 377 + url: '/api/v{api-version}/complex/{id}', 378 + ...options, 379 + headers: { 380 + 'Content-Type': 'application/json-patch+json', 381 + ...options.headers 382 + } 383 + }); 384 + } 385 + 386 + public callWithResultFromHeader<ThrowOnError extends boolean = false>(options?: Options<CallWithResultFromHeaderData, ThrowOnError>) { 387 + return (options?.client ?? this.client).post<CallWithResultFromHeaderResponses, CallWithResultFromHeaderErrors, ThrowOnError>({ 388 + url: '/api/v{api-version}/header', 389 + ...options 390 + }); 391 + } 392 + 393 + public testErrorCode<ThrowOnError extends boolean = false>(options: Options<TestErrorCodeData, ThrowOnError>) { 394 + return (options.client ?? this.client).post<TestErrorCodeResponses, TestErrorCodeErrors, ThrowOnError>({ 395 + url: '/api/v{api-version}/error', 396 + ...options 397 + }); 398 + } 399 + 400 + public nonAsciiæøåÆøÅöôêÊ字符串<ThrowOnError extends boolean = false>(options: Options<NonAsciiæøåÆøÅöôêÊ字符串Data, ThrowOnError>) { 401 + return (options.client ?? this.client).post<NonAsciiæøåÆøÅöôêÊ字符串Responses, unknown, ThrowOnError>({ 402 + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', 403 + ...options 404 + }); 405 + } 406 + 407 + /** 408 + * Login User 409 + */ 410 + public putWithFormUrlEncoded<ThrowOnError extends boolean = false>(options: Options<PutWithFormUrlEncodedData, ThrowOnError>) { 411 + return (options.client ?? this.client).put<unknown, unknown, ThrowOnError>({ 412 + ...urlSearchParamsBodySerializer, 413 + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', 414 + ...options, 415 + headers: { 416 + 'Content-Type': 'application/x-www-form-urlencoded', 417 + ...options.headers 418 + } 419 + }); 420 + } 421 + }
+2046
packages/openapi-ts-tests/test/__snapshots__/3.0.x/plugins/@hey-api/sdk/instance/types.gen.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + 3 + /** 4 + * Model with number-only name 5 + */ 6 + export type _400 = string; 7 + 8 + /** 9 + * Testing multiline comments in string: First line 10 + * Second line 11 + * 12 + * Fourth line 13 + */ 14 + export type CamelCaseCommentWithBreaks = number; 15 + 16 + /** 17 + * Testing multiline comments in string: First line 18 + * Second line 19 + * 20 + * Fourth line 21 + */ 22 + export type CommentWithBreaks = number; 23 + 24 + /** 25 + * Testing backticks in string: `backticks` and ```multiple backticks``` should work 26 + */ 27 + export type CommentWithBackticks = number; 28 + 29 + /** 30 + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work 31 + */ 32 + export type CommentWithBackticksAndQuotes = number; 33 + 34 + /** 35 + * Testing slashes in string: \backwards\\\ and /forwards/// should work 36 + */ 37 + export type CommentWithSlashes = number; 38 + 39 + /** 40 + * Testing expression placeholders in string: ${expression} should work 41 + */ 42 + export type CommentWithExpressionPlaceholders = number; 43 + 44 + /** 45 + * Testing quotes in string: 'single quote''' and "double quotes""" should work 46 + */ 47 + export type CommentWithQuotes = number; 48 + 49 + /** 50 + * Testing reserved characters in string: * inline * and ** inline ** should work 51 + */ 52 + export type CommentWithReservedCharacters = number; 53 + 54 + /** 55 + * This is a simple number 56 + */ 57 + export type SimpleInteger = number; 58 + 59 + /** 60 + * This is a simple boolean 61 + */ 62 + export type SimpleBoolean = boolean; 63 + 64 + /** 65 + * This is a simple string 66 + */ 67 + export type SimpleString = string; 68 + 69 + /** 70 + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) 71 + */ 72 + export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; 73 + 74 + /** 75 + * This is a simple file 76 + */ 77 + export type SimpleFile = Blob | File; 78 + 79 + /** 80 + * This is a simple reference 81 + */ 82 + export type SimpleReference = ModelWithString; 83 + 84 + /** 85 + * This is a simple string 86 + */ 87 + export type SimpleStringWithPattern = string | null; 88 + 89 + /** 90 + * This is a simple enum with strings 91 + */ 92 + export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; 93 + 94 + export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; 95 + 96 + /** 97 + * This is a simple enum with numbers 98 + */ 99 + export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; 100 + 101 + /** 102 + * Success=1,Warning=2,Error=3 103 + */ 104 + export type EnumFromDescription = number; 105 + 106 + /** 107 + * This is a simple enum with numbers 108 + */ 109 + export type EnumWithExtensions = 200 | 400 | 500; 110 + 111 + export type EnumWithXEnumNames = 0 | 1 | 2; 112 + 113 + /** 114 + * This is a simple array with numbers 115 + */ 116 + export type ArrayWithNumbers = Array<number>; 117 + 118 + /** 119 + * This is a simple array with booleans 120 + */ 121 + export type ArrayWithBooleans = Array<boolean>; 122 + 123 + /** 124 + * This is a simple array with strings 125 + */ 126 + export type ArrayWithStrings = Array<string>; 127 + 128 + /** 129 + * This is a simple array with references 130 + */ 131 + export type ArrayWithReferences = Array<ModelWithString>; 132 + 133 + /** 134 + * This is a simple array containing an array 135 + */ 136 + export type ArrayWithArray = Array<Array<ModelWithString>>; 137 + 138 + /** 139 + * This is a simple array with properties 140 + */ 141 + export type ArrayWithProperties = Array<{ 142 + '16x16'?: CamelCaseCommentWithBreaks; 143 + bar?: string; 144 + }>; 145 + 146 + /** 147 + * This is a simple array with any of properties 148 + */ 149 + export type ArrayWithAnyOfProperties = Array<{ 150 + foo?: string; 151 + } | { 152 + bar?: string; 153 + }>; 154 + 155 + export type AnyOfAnyAndNull = { 156 + data?: unknown; 157 + }; 158 + 159 + /** 160 + * This is a simple array with any of properties 161 + */ 162 + export type AnyOfArrays = { 163 + results?: Array<{ 164 + foo?: string; 165 + } | { 166 + bar?: string; 167 + }>; 168 + }; 169 + 170 + /** 171 + * This is a string dictionary 172 + */ 173 + export type DictionaryWithString = { 174 + [key: string]: string; 175 + }; 176 + 177 + export type DictionaryWithPropertiesAndAdditionalProperties = { 178 + foo?: number; 179 + bar?: boolean; 180 + [key: string]: string | number | boolean | undefined; 181 + }; 182 + 183 + /** 184 + * This is a string reference 185 + */ 186 + export type DictionaryWithReference = { 187 + [key: string]: ModelWithString; 188 + }; 189 + 190 + /** 191 + * This is a complex dictionary 192 + */ 193 + export type DictionaryWithArray = { 194 + [key: string]: Array<ModelWithString>; 195 + }; 196 + 197 + /** 198 + * This is a string dictionary 199 + */ 200 + export type DictionaryWithDictionary = { 201 + [key: string]: { 202 + [key: string]: string; 203 + }; 204 + }; 205 + 206 + /** 207 + * This is a complex dictionary 208 + */ 209 + export type DictionaryWithProperties = { 210 + [key: string]: { 211 + foo?: string; 212 + bar?: string; 213 + }; 214 + }; 215 + 216 + /** 217 + * This is a model with one number property 218 + */ 219 + export type ModelWithInteger = { 220 + /** 221 + * This is a simple number property 222 + */ 223 + prop?: number; 224 + }; 225 + 226 + /** 227 + * This is a model with one boolean property 228 + */ 229 + export type ModelWithBoolean = { 230 + /** 231 + * This is a simple boolean property 232 + */ 233 + prop?: boolean; 234 + }; 235 + 236 + /** 237 + * This is a model with one string property 238 + */ 239 + export type ModelWithString = { 240 + /** 241 + * This is a simple string property 242 + */ 243 + prop?: string; 244 + }; 245 + 246 + /** 247 + * This is a model with one string property 248 + */ 249 + export type ModelWithStringError = { 250 + /** 251 + * This is a simple string property 252 + */ 253 + prop?: string; 254 + }; 255 + 256 + /** 257 + * `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) 258 + */ 259 + export type ModelFromZendesk = string; 260 + 261 + /** 262 + * This is a model with one string property 263 + */ 264 + export type ModelWithNullableString = { 265 + /** 266 + * This is a simple string property 267 + */ 268 + nullableProp1?: string | null; 269 + /** 270 + * This is a simple string property 271 + */ 272 + nullableRequiredProp1: string | null; 273 + /** 274 + * This is a simple string property 275 + */ 276 + nullableProp2?: string | null; 277 + /** 278 + * This is a simple string property 279 + */ 280 + nullableRequiredProp2: string | null; 281 + /** 282 + * This is a simple enum with strings 283 + */ 284 + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; 285 + }; 286 + 287 + /** 288 + * This is a model with one enum 289 + */ 290 + export type ModelWithEnum = { 291 + /** 292 + * This is a simple enum with strings 293 + */ 294 + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; 295 + /** 296 + * These are the HTTP error code enums 297 + */ 298 + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; 299 + /** 300 + * Simple boolean enum 301 + */ 302 + bool?: true; 303 + }; 304 + 305 + /** 306 + * This is a model with one enum with escaped name 307 + */ 308 + export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 312 + 'foo-bar-baz-qux'?: '3.0'; 313 + }; 314 + 315 + /** 316 + * This is a model with one enum 317 + */ 318 + export type ModelWithEnumFromDescription = { 319 + /** 320 + * Success=1,Warning=2,Error=3 321 + */ 322 + test?: number; 323 + }; 324 + 325 + /** 326 + * This is a model with nested enums 327 + */ 328 + export type ModelWithNestedEnums = { 329 + dictionaryWithEnum?: { 330 + [key: string]: 'Success' | 'Warning' | 'Error'; 331 + }; 332 + dictionaryWithEnumFromDescription?: { 333 + [key: string]: number; 334 + }; 335 + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; 336 + arrayWithDescription?: Array<number>; 337 + /** 338 + * This is a simple enum with strings 339 + */ 340 + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; 341 + }; 342 + 343 + /** 344 + * This is a model with one property containing a reference 345 + */ 346 + export type ModelWithReferenceReadable = { 347 + prop?: ModelWithPropertiesReadable; 348 + }; 349 + 350 + /** 351 + * This is a model with one property containing a reference 352 + */ 353 + export type ModelWithReferenceWritable = { 354 + prop?: ModelWithPropertiesWritable; 355 + }; 356 + 357 + /** 358 + * This is a model with one property containing an array 359 + */ 360 + export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { 361 + prop?: Array<ModelWithReadOnlyAndWriteOnlyReadable>; 362 + propWithFile?: Array<Blob | File>; 363 + propWithNumber?: Array<number>; 364 + }; 365 + 366 + /** 367 + * This is a model with one property containing an array 368 + */ 369 + export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { 370 + prop?: Array<ModelWithReadOnlyAndWriteOnlyWritable>; 371 + propWithFile?: Array<Blob | File>; 372 + propWithNumber?: Array<number>; 373 + }; 374 + 375 + /** 376 + * This is a model with one property containing an array 377 + */ 378 + export type ModelWithArray = { 379 + prop?: Array<ModelWithString>; 380 + propWithFile?: Array<Blob | File>; 381 + propWithNumber?: Array<number>; 382 + }; 383 + 384 + /** 385 + * This is a model with one property containing a dictionary 386 + */ 387 + export type ModelWithDictionary = { 388 + prop?: { 389 + [key: string]: string; 390 + }; 391 + }; 392 + 393 + /** 394 + * This is a deprecated model with a deprecated property 395 + * @deprecated 396 + */ 397 + export type DeprecatedModel = { 398 + /** 399 + * This is a deprecated property 400 + * @deprecated 401 + */ 402 + prop?: string; 403 + }; 404 + 405 + /** 406 + * This is a model with one property containing a circular reference 407 + */ 408 + export type ModelWithCircularReference = { 409 + prop?: ModelWithCircularReference; 410 + }; 411 + 412 + /** 413 + * This is a model with one property with a 'one of' relationship 414 + */ 415 + export type CompositionWithOneOf = { 416 + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; 417 + }; 418 + 419 + /** 420 + * This is a model with one property with a 'one of' relationship where the options are not $ref 421 + */ 422 + export type CompositionWithOneOfAnonymous = { 423 + propA?: { 424 + propA?: string; 425 + } | string | number; 426 + }; 427 + 428 + /** 429 + * Circle 430 + */ 431 + export type ModelCircle = { 432 + kind: string; 433 + radius?: number; 434 + }; 435 + 436 + /** 437 + * Square 438 + */ 439 + export type ModelSquare = { 440 + kind: string; 441 + sideLength?: number; 442 + }; 443 + 444 + /** 445 + * This is a model with one property with a 'one of' relationship where the options are not $ref 446 + */ 447 + export type CompositionWithOneOfDiscriminator = ({ 448 + kind: 'circle'; 449 + } & ModelCircle) | ({ 450 + kind: 'square'; 451 + } & ModelSquare); 452 + 453 + /** 454 + * This is a model with one property with a 'any of' relationship 455 + */ 456 + export type CompositionWithAnyOf = { 457 + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; 458 + }; 459 + 460 + /** 461 + * This is a model with one property with a 'any of' relationship where the options are not $ref 462 + */ 463 + export type CompositionWithAnyOfAnonymous = { 464 + propA?: { 465 + propA?: string; 466 + } | string | number; 467 + }; 468 + 469 + /** 470 + * This is a model with nested 'any of' property with a type null 471 + */ 472 + export type CompositionWithNestedAnyAndTypeNull = { 473 + propA?: Array<ModelWithDictionary | null> | Array<ModelWithArray | null>; 474 + }; 475 + 476 + export type _3eNum1Период = 'Bird' | 'Dog'; 477 + 478 + export type ConstValue = 'ConstValue'; 479 + 480 + /** 481 + * This is a model with one property with a 'any of' relationship where the options are not $ref 482 + */ 483 + export type CompositionWithNestedAnyOfAndNull = { 484 + propA?: Array<_3eNum1Период | ConstValue> | null; 485 + }; 486 + 487 + /** 488 + * This is a model with one property with a 'one of' relationship 489 + */ 490 + export type CompositionWithOneOfAndNullable = { 491 + propA?: { 492 + boolean?: boolean; 493 + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; 494 + }; 495 + 496 + /** 497 + * This is a model that contains a simple dictionary within composition 498 + */ 499 + export type CompositionWithOneOfAndSimpleDictionary = { 500 + propA?: boolean | { 501 + [key: string]: number; 502 + }; 503 + }; 504 + 505 + /** 506 + * This is a model that contains a dictionary of simple arrays within composition 507 + */ 508 + export type CompositionWithOneOfAndSimpleArrayDictionary = { 509 + propA?: boolean | { 510 + [key: string]: Array<boolean>; 511 + }; 512 + }; 513 + 514 + /** 515 + * This is a model that contains a dictionary of complex arrays (composited) within composition 516 + */ 517 + export type CompositionWithOneOfAndComplexArrayDictionary = { 518 + propA?: boolean | { 519 + [key: string]: Array<number | string>; 520 + }; 521 + }; 522 + 523 + /** 524 + * This is a model with one property with a 'all of' relationship 525 + */ 526 + export type CompositionWithAllOfAndNullable = { 527 + propA?: ({ 528 + boolean?: boolean; 529 + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; 530 + }; 531 + 532 + /** 533 + * This is a model with one property with a 'any of' relationship 534 + */ 535 + export type CompositionWithAnyOfAndNullable = { 536 + propA?: { 537 + boolean?: boolean; 538 + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; 539 + }; 540 + 541 + /** 542 + * This is a base model with two simple optional properties 543 + */ 544 + export type CompositionBaseModel = { 545 + firstName?: string; 546 + lastname?: string; 547 + }; 548 + 549 + /** 550 + * This is a model that extends the base model 551 + */ 552 + export type CompositionExtendedModel = CompositionBaseModel & { 553 + age: number; 554 + firstName: string; 555 + lastname: string; 556 + }; 557 + 558 + /** 559 + * This is a model with one nested property 560 + */ 561 + export type ModelWithPropertiesReadable = { 562 + required: string; 563 + readonly requiredAndReadOnly: string; 564 + requiredAndNullable: string | null; 565 + string?: string; 566 + number?: number; 567 + boolean?: boolean; 568 + reference?: ModelWithString; 569 + 'property with space'?: string; 570 + default?: string; 571 + try?: string; 572 + readonly '@namespace.string'?: string; 573 + readonly '@namespace.integer'?: number; 574 + }; 575 + 576 + /** 577 + * This is a model with one nested property 578 + */ 579 + export type ModelWithPropertiesWritable = { 580 + required: string; 581 + requiredAndNullable: string | null; 582 + string?: string; 583 + number?: number; 584 + boolean?: boolean; 585 + reference?: ModelWithString; 586 + 'property with space'?: string; 587 + default?: string; 588 + try?: string; 589 + }; 590 + 591 + /** 592 + * This is a model with one nested property 593 + */ 594 + export type ModelWithNestedProperties = { 595 + readonly first: { 596 + readonly second: { 597 + readonly third: string | null; 598 + } | null; 599 + } | null; 600 + }; 601 + 602 + /** 603 + * This is a model with duplicated properties 604 + */ 605 + export type ModelWithDuplicateProperties = { 606 + prop?: ModelWithString; 607 + }; 608 + 609 + /** 610 + * This is a model with ordered properties 611 + */ 612 + export type ModelWithOrderedProperties = { 613 + zebra?: string; 614 + apple?: string; 615 + hawaii?: string; 616 + }; 617 + 618 + /** 619 + * This is a model with duplicated imports 620 + */ 621 + export type ModelWithDuplicateImports = { 622 + propA?: ModelWithString; 623 + propB?: ModelWithString; 624 + propC?: ModelWithString; 625 + }; 626 + 627 + /** 628 + * This is a model that extends another model 629 + */ 630 + export type ModelThatExtends = ModelWithString & { 631 + propExtendsA?: string; 632 + propExtendsB?: ModelWithString; 633 + }; 634 + 635 + /** 636 + * This is a model that extends another model 637 + */ 638 + export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { 639 + propExtendsC?: string; 640 + propExtendsD?: ModelWithString; 641 + }; 642 + 643 + /** 644 + * This is a model that contains a some patterns 645 + */ 646 + export type ModelWithPatternReadable = { 647 + key: string; 648 + name: string; 649 + readonly enabled?: boolean; 650 + readonly modified?: string; 651 + id?: string; 652 + text?: string; 653 + patternWithSingleQuotes?: string; 654 + patternWithNewline?: string; 655 + patternWithBacktick?: string; 656 + }; 657 + 658 + /** 659 + * This is a model that contains a some patterns 660 + */ 661 + export type ModelWithPatternWritable = { 662 + key: string; 663 + name: string; 664 + id?: string; 665 + text?: string; 666 + patternWithSingleQuotes?: string; 667 + patternWithNewline?: string; 668 + patternWithBacktick?: string; 669 + }; 670 + 671 + export type FileReadable = { 672 + /** 673 + * Id 674 + */ 675 + readonly id?: string; 676 + /** 677 + * Updated at 678 + */ 679 + readonly updated_at?: string; 680 + /** 681 + * Created at 682 + */ 683 + readonly created_at?: string; 684 + /** 685 + * Mime 686 + */ 687 + mime: string; 688 + /** 689 + * File 690 + */ 691 + readonly file?: string; 692 + }; 693 + 694 + export type FileWritable = { 695 + /** 696 + * Mime 697 + */ 698 + mime: string; 699 + }; 700 + 701 + export type Default = { 702 + name?: string; 703 + }; 704 + 705 + export type Pageable = { 706 + page?: number; 707 + size?: number; 708 + sort?: Array<string>; 709 + }; 710 + 711 + /** 712 + * This is a free-form object without additionalProperties. 713 + */ 714 + export type FreeFormObjectWithoutAdditionalProperties = { 715 + [key: string]: unknown; 716 + }; 717 + 718 + /** 719 + * This is a free-form object with additionalProperties: true. 720 + */ 721 + export type FreeFormObjectWithAdditionalPropertiesEqTrue = { 722 + [key: string]: unknown; 723 + }; 724 + 725 + /** 726 + * This is a free-form object with additionalProperties: {}. 727 + */ 728 + export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = { 729 + [key: string]: unknown; 730 + }; 731 + 732 + export type ModelWithConst = { 733 + String?: 'String'; 734 + number?: 0; 735 + null?: unknown; 736 + withType?: 'Some string'; 737 + }; 738 + 739 + /** 740 + * This is a model with one property and additionalProperties: true 741 + */ 742 + export type ModelWithAdditionalPropertiesEqTrue = { 743 + /** 744 + * This is a simple string property 745 + */ 746 + prop?: string; 747 + [key: string]: unknown | string | undefined; 748 + }; 749 + 750 + export type NestedAnyOfArraysNullable = { 751 + nullableArray?: Array<string | boolean> | null; 752 + }; 753 + 754 + export type CompositionWithOneOfAndProperties = ({ 755 + foo: SimpleParameter; 756 + } | { 757 + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; 758 + }) & { 759 + baz: number | null; 760 + qux: number; 761 + }; 762 + 763 + /** 764 + * An object that can be null 765 + */ 766 + export type NullableObject = { 767 + foo?: string; 768 + } | null; 769 + 770 + /** 771 + * Some % character 772 + */ 773 + export type CharactersInDescription = string; 774 + 775 + export type ModelWithNullableObject = { 776 + data?: NullableObject; 777 + }; 778 + 779 + export type ModelWithOneOfEnum = { 780 + foo: 'Bar'; 781 + } | { 782 + foo: 'Baz'; 783 + } | { 784 + foo: 'Qux'; 785 + } | { 786 + content: string; 787 + foo: 'Quux'; 788 + } | { 789 + content: [ 790 + string, 791 + string 792 + ]; 793 + foo: 'Corge'; 794 + }; 795 + 796 + export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; 797 + 798 + export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; 799 + 800 + export type ModelWithNestedArrayEnumsData = { 801 + foo?: Array<ModelWithNestedArrayEnumsDataFoo>; 802 + bar?: Array<ModelWithNestedArrayEnumsDataBar>; 803 + }; 804 + 805 + export type ModelWithNestedArrayEnums = { 806 + array_strings?: Array<string>; 807 + data?: ModelWithNestedArrayEnumsData; 808 + }; 809 + 810 + export type ModelWithNestedCompositionEnums = { 811 + foo?: ModelWithNestedArrayEnumsDataFoo; 812 + }; 813 + 814 + export type ModelWithReadOnlyAndWriteOnlyReadable = { 815 + foo: string; 816 + readonly bar: string; 817 + }; 818 + 819 + export type ModelWithReadOnlyAndWriteOnlyWritable = { 820 + foo: string; 821 + baz: string; 822 + }; 823 + 824 + export type ModelWithConstantSizeArray = [ 825 + number, 826 + number 827 + ]; 828 + 829 + export type ModelWithAnyOfConstantSizeArray = [ 830 + number | string, 831 + number | string, 832 + number | string 833 + ]; 834 + 835 + export type ModelWithPrefixItemsConstantSizeArray = Array<ModelWithInteger | number | string>; 836 + 837 + export type ModelWithAnyOfConstantSizeArrayNullable = [ 838 + number | null | string, 839 + number | null | string, 840 + number | null | string 841 + ]; 842 + 843 + export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ 844 + number | Import, 845 + number | Import 846 + ]; 847 + 848 + export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ 849 + number & string, 850 + number & string 851 + ]; 852 + 853 + export type ModelWithNumericEnumUnion = { 854 + /** 855 + * Период 856 + */ 857 + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; 858 + }; 859 + 860 + /** 861 + * Some description with `back ticks` 862 + */ 863 + export type ModelWithBackticksInDescription = { 864 + /** 865 + * The template `that` should be used for parsing and importing the contents of the CSV file. 866 + * 867 + * <br/><p>There is one placeholder currently supported:<ul> <li><b>${x}</b> - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)</li></ul><p>Example of a correct JSON template:</p> 868 + * <pre> 869 + * [ 870 + * { 871 + * "resourceType": "Asset", 872 + * "identifier": { 873 + * "name": "${1}", 874 + * "domain": { 875 + * "name": "${2}", 876 + * "community": { 877 + * "name": "Some Community" 878 + * } 879 + * } 880 + * }, 881 + * "attributes" : { 882 + * "00000000-0000-0000-0000-000000003115" : [ { 883 + * "value" : "${3}" 884 + * } ], 885 + * "00000000-0000-0000-0000-000000000222" : [ { 886 + * "value" : "${4}" 887 + * } ] 888 + * } 889 + * } 890 + * ] 891 + * </pre> 892 + */ 893 + template?: string; 894 + }; 895 + 896 + export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { 897 + baz: number | null; 898 + qux: number; 899 + }; 900 + 901 + /** 902 + * Model used to test deduplication strategy (unused) 903 + */ 904 + export type ParameterSimpleParameterUnused = string; 905 + 906 + /** 907 + * Model used to test deduplication strategy 908 + */ 909 + export type PostServiceWithEmptyTagResponse = string; 910 + 911 + /** 912 + * Model used to test deduplication strategy 913 + */ 914 + export type PostServiceWithEmptyTagResponse2 = string; 915 + 916 + /** 917 + * Model used to test deduplication strategy 918 + */ 919 + export type DeleteFooData = string; 920 + 921 + /** 922 + * Model used to test deduplication strategy 923 + */ 924 + export type DeleteFooData2 = string; 925 + 926 + /** 927 + * Model with restricted keyword name 928 + */ 929 + export type Import = string; 930 + 931 + export type SchemaWithFormRestrictedKeys = { 932 + description?: string; 933 + 'x-enum-descriptions'?: string; 934 + 'x-enum-varnames'?: string; 935 + 'x-enumNames'?: string; 936 + title?: string; 937 + object?: { 938 + description?: string; 939 + 'x-enum-descriptions'?: string; 940 + 'x-enum-varnames'?: string; 941 + 'x-enumNames'?: string; 942 + title?: string; 943 + }; 944 + array?: Array<{ 945 + description?: string; 946 + 'x-enum-descriptions'?: string; 947 + 'x-enum-varnames'?: string; 948 + 'x-enumNames'?: string; 949 + title?: string; 950 + }>; 951 + }; 952 + 953 + /** 954 + * This schema was giving PascalCase transformations a hard time 955 + */ 956 + export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { 957 + /** 958 + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. 959 + */ 960 + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; 961 + }; 962 + 963 + /** 964 + * This schema was giving PascalCase transformations a hard time 965 + */ 966 + export type IoK8sApimachineryPkgApisMetaV1Preconditions = { 967 + /** 968 + * Specifies the target ResourceVersion 969 + */ 970 + resourceVersion?: string; 971 + /** 972 + * Specifies the target UID. 973 + */ 974 + uid?: string; 975 + }; 976 + 977 + export type AdditionalPropertiesUnknownIssue = { 978 + [key: string]: string | number; 979 + }; 980 + 981 + export type AdditionalPropertiesUnknownIssue2 = { 982 + [key: string]: string | number; 983 + }; 984 + 985 + export type AdditionalPropertiesUnknownIssue3 = string & { 986 + entries: { 987 + [key: string]: AdditionalPropertiesUnknownIssue; 988 + }; 989 + }; 990 + 991 + export type AdditionalPropertiesIntegerIssue = { 992 + value: number; 993 + [key: string]: number; 994 + }; 995 + 996 + export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; 997 + 998 + export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; 999 + 1000 + export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { 1001 + item?: boolean; 1002 + error?: string | null; 1003 + readonly hasError?: boolean; 1004 + data?: { 1005 + [key: string]: never; 1006 + }; 1007 + }; 1008 + 1009 + export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { 1010 + item?: boolean; 1011 + error?: string | null; 1012 + data?: { 1013 + [key: string]: never; 1014 + }; 1015 + }; 1016 + 1017 + export type GenericSchemaDuplicateIssue1SystemStringReadable = { 1018 + item?: string | null; 1019 + error?: string | null; 1020 + readonly hasError?: boolean; 1021 + }; 1022 + 1023 + export type GenericSchemaDuplicateIssue1SystemStringWritable = { 1024 + item?: string | null; 1025 + error?: string | null; 1026 + }; 1027 + 1028 + /** 1029 + * This is a reusable parameter 1030 + */ 1031 + export type SimpleParameter = string; 1032 + 1033 + /** 1034 + * Parameter with illegal characters 1035 + */ 1036 + export type XFooBar = ModelWithString; 1037 + 1038 + export type SimpleRequestBody = ModelWithString; 1039 + 1040 + export type SimpleFormData = ModelWithString; 1041 + 1042 + export type ExportData = { 1043 + body?: never; 1044 + path?: never; 1045 + query?: never; 1046 + url: '/api/v{api-version}/no+tag'; 1047 + }; 1048 + 1049 + export type PatchApiVbyApiVersionNoTagData = { 1050 + body?: never; 1051 + path?: never; 1052 + query?: never; 1053 + url: '/api/v{api-version}/no+tag'; 1054 + }; 1055 + 1056 + export type PatchApiVbyApiVersionNoTagResponses = { 1057 + /** 1058 + * OK 1059 + */ 1060 + default: unknown; 1061 + }; 1062 + 1063 + export type ImportData = { 1064 + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; 1065 + path?: never; 1066 + query?: never; 1067 + url: '/api/v{api-version}/no+tag'; 1068 + }; 1069 + 1070 + export type ImportResponses = { 1071 + /** 1072 + * Success 1073 + */ 1074 + 200: ModelFromZendesk; 1075 + /** 1076 + * Default success response 1077 + */ 1078 + default: ModelWithReadOnlyAndWriteOnlyReadable; 1079 + }; 1080 + 1081 + export type ImportResponse = ImportResponses[keyof ImportResponses]; 1082 + 1083 + export type FooWowData = { 1084 + body?: never; 1085 + path?: never; 1086 + query?: never; 1087 + url: '/api/v{api-version}/no+tag'; 1088 + }; 1089 + 1090 + export type FooWowResponses = { 1091 + /** 1092 + * OK 1093 + */ 1094 + default: unknown; 1095 + }; 1096 + 1097 + export type ApiVVersionODataControllerCountData = { 1098 + body?: never; 1099 + path?: never; 1100 + query?: never; 1101 + url: '/api/v{api-version}/simple/$count'; 1102 + }; 1103 + 1104 + export type ApiVVersionODataControllerCountResponses = { 1105 + /** 1106 + * Success 1107 + */ 1108 + 200: ModelFromZendesk; 1109 + }; 1110 + 1111 + export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; 1112 + 1113 + export type GetApiVbyApiVersionSimpleOperationData = { 1114 + body?: never; 1115 + path: { 1116 + /** 1117 + * foo in method 1118 + */ 1119 + foo_param: string; 1120 + }; 1121 + query?: never; 1122 + url: '/api/v{api-version}/simple:operation'; 1123 + }; 1124 + 1125 + export type GetApiVbyApiVersionSimpleOperationErrors = { 1126 + /** 1127 + * Default error response 1128 + */ 1129 + default: ModelWithBoolean; 1130 + }; 1131 + 1132 + export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; 1133 + 1134 + export type GetApiVbyApiVersionSimpleOperationResponses = { 1135 + /** 1136 + * Response is a simple number 1137 + */ 1138 + 200: number; 1139 + }; 1140 + 1141 + export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; 1142 + 1143 + export type DeleteCallWithoutParametersAndResponseData = { 1144 + body?: never; 1145 + path?: never; 1146 + query?: never; 1147 + url: '/api/v{api-version}/simple'; 1148 + }; 1149 + 1150 + export type GetCallWithoutParametersAndResponseData = { 1151 + body?: never; 1152 + path?: never; 1153 + query?: never; 1154 + url: '/api/v{api-version}/simple'; 1155 + }; 1156 + 1157 + export type HeadCallWithoutParametersAndResponseData = { 1158 + body?: never; 1159 + path?: never; 1160 + query?: never; 1161 + url: '/api/v{api-version}/simple'; 1162 + }; 1163 + 1164 + export type OptionsCallWithoutParametersAndResponseData = { 1165 + body?: never; 1166 + path?: never; 1167 + query?: never; 1168 + url: '/api/v{api-version}/simple'; 1169 + }; 1170 + 1171 + export type PatchCallWithoutParametersAndResponseData = { 1172 + body?: never; 1173 + path?: never; 1174 + query?: never; 1175 + url: '/api/v{api-version}/simple'; 1176 + }; 1177 + 1178 + export type PostCallWithoutParametersAndResponseData = { 1179 + body?: never; 1180 + path?: never; 1181 + query?: never; 1182 + url: '/api/v{api-version}/simple'; 1183 + }; 1184 + 1185 + export type PutCallWithoutParametersAndResponseData = { 1186 + body?: never; 1187 + path?: never; 1188 + query?: never; 1189 + url: '/api/v{api-version}/simple'; 1190 + }; 1191 + 1192 + export type DeleteFooData3 = { 1193 + body?: never; 1194 + headers: { 1195 + /** 1196 + * Parameter with illegal characters 1197 + */ 1198 + 'x-Foo-Bar': ModelWithString; 1199 + }; 1200 + path: { 1201 + /** 1202 + * foo in method 1203 + */ 1204 + foo_param: string; 1205 + /** 1206 + * bar in method 1207 + */ 1208 + BarParam: string; 1209 + }; 1210 + query?: never; 1211 + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; 1212 + }; 1213 + 1214 + export type CallWithDescriptionsData = { 1215 + body?: never; 1216 + path?: never; 1217 + query?: { 1218 + /** 1219 + * Testing multiline comments in string: First line 1220 + * Second line 1221 + * 1222 + * Fourth line 1223 + */ 1224 + parameterWithBreaks?: string; 1225 + /** 1226 + * Testing backticks in string: `backticks` and ```multiple backticks``` should work 1227 + */ 1228 + parameterWithBackticks?: string; 1229 + /** 1230 + * Testing slashes in string: \backwards\\\ and /forwards/// should work 1231 + */ 1232 + parameterWithSlashes?: string; 1233 + /** 1234 + * Testing expression placeholders in string: ${expression} should work 1235 + */ 1236 + parameterWithExpressionPlaceholders?: string; 1237 + /** 1238 + * Testing quotes in string: 'single quote''' and "double quotes""" should work 1239 + */ 1240 + parameterWithQuotes?: string; 1241 + /** 1242 + * Testing reserved characters in string: * inline * and ** inline ** should work 1243 + */ 1244 + parameterWithReservedCharacters?: string; 1245 + }; 1246 + url: '/api/v{api-version}/descriptions'; 1247 + }; 1248 + 1249 + export type DeprecatedCallData = { 1250 + body?: never; 1251 + headers: { 1252 + /** 1253 + * This parameter is deprecated 1254 + * @deprecated 1255 + */ 1256 + parameter: DeprecatedModel | null; 1257 + }; 1258 + path?: never; 1259 + query?: never; 1260 + url: '/api/v{api-version}/parameters/deprecated'; 1261 + }; 1262 + 1263 + export type CallWithParametersData = { 1264 + /** 1265 + * This is the parameter that goes into the body 1266 + */ 1267 + body: { 1268 + [key: string]: unknown; 1269 + } | null; 1270 + headers: { 1271 + /** 1272 + * This is the parameter that goes into the header 1273 + */ 1274 + parameterHeader: string | null; 1275 + }; 1276 + path: { 1277 + /** 1278 + * This is the parameter that goes into the path 1279 + */ 1280 + parameterPath: string | null; 1281 + /** 1282 + * api-version should be required in standalone clients 1283 + */ 1284 + 'api-version': string | null; 1285 + }; 1286 + query: { 1287 + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; 1288 + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; 1289 + /** 1290 + * This is the parameter that goes into the query params 1291 + */ 1292 + cursor: string | null; 1293 + }; 1294 + url: '/api/v{api-version}/parameters/{parameterPath}'; 1295 + }; 1296 + 1297 + export type CallWithWeirdParameterNamesData = { 1298 + /** 1299 + * This is the parameter that goes into the body 1300 + */ 1301 + body: ModelWithString | null; 1302 + headers: { 1303 + /** 1304 + * This is the parameter that goes into the request header 1305 + */ 1306 + 'parameter.header': string | null; 1307 + }; 1308 + path: { 1309 + /** 1310 + * This is the parameter that goes into the path 1311 + */ 1312 + 'parameter.path.1'?: string; 1313 + /** 1314 + * This is the parameter that goes into the path 1315 + */ 1316 + 'parameter-path-2'?: string; 1317 + /** 1318 + * This is the parameter that goes into the path 1319 + */ 1320 + 'PARAMETER-PATH-3'?: string; 1321 + /** 1322 + * api-version should be required in standalone clients 1323 + */ 1324 + 'api-version': string | null; 1325 + }; 1326 + query: { 1327 + /** 1328 + * This is the parameter with a reserved keyword 1329 + */ 1330 + default?: string; 1331 + /** 1332 + * This is the parameter that goes into the request query params 1333 + */ 1334 + 'parameter-query': string | null; 1335 + }; 1336 + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; 1337 + }; 1338 + 1339 + export type GetCallWithOptionalParamData = { 1340 + /** 1341 + * This is a required parameter 1342 + */ 1343 + body: ModelWithOneOfEnum; 1344 + path?: never; 1345 + query?: { 1346 + /** 1347 + * This is an optional parameter 1348 + */ 1349 + page?: number; 1350 + }; 1351 + url: '/api/v{api-version}/parameters'; 1352 + }; 1353 + 1354 + export type PostCallWithOptionalParamData = { 1355 + /** 1356 + * This is an optional parameter 1357 + */ 1358 + body?: { 1359 + offset?: number | null; 1360 + }; 1361 + path?: never; 1362 + query: { 1363 + /** 1364 + * This is a required parameter 1365 + */ 1366 + parameter: Pageable; 1367 + }; 1368 + url: '/api/v{api-version}/parameters'; 1369 + }; 1370 + 1371 + export type PostCallWithOptionalParamResponses = { 1372 + /** 1373 + * Response is a simple number 1374 + */ 1375 + 200: number; 1376 + /** 1377 + * Success 1378 + */ 1379 + 204: void; 1380 + }; 1381 + 1382 + export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; 1383 + 1384 + export type PostApiVbyApiVersionRequestBodyData = { 1385 + /** 1386 + * A reusable request body 1387 + */ 1388 + body?: SimpleRequestBody; 1389 + path?: never; 1390 + query?: { 1391 + /** 1392 + * This is a reusable parameter 1393 + */ 1394 + parameter?: string; 1395 + }; 1396 + url: '/api/v{api-version}/requestBody'; 1397 + }; 1398 + 1399 + export type PostApiVbyApiVersionFormDataData = { 1400 + /** 1401 + * A reusable request body 1402 + */ 1403 + body?: SimpleFormData; 1404 + path?: never; 1405 + query?: { 1406 + /** 1407 + * This is a reusable parameter 1408 + */ 1409 + parameter?: string; 1410 + }; 1411 + url: '/api/v{api-version}/formData'; 1412 + }; 1413 + 1414 + export type CallWithDefaultParametersData = { 1415 + body?: never; 1416 + path?: never; 1417 + query?: { 1418 + /** 1419 + * This is a simple string with default value 1420 + */ 1421 + parameterString?: string | null; 1422 + /** 1423 + * This is a simple number with default value 1424 + */ 1425 + parameterNumber?: number | null; 1426 + /** 1427 + * This is a simple boolean with default value 1428 + */ 1429 + parameterBoolean?: boolean | null; 1430 + /** 1431 + * This is a simple enum with default value 1432 + */ 1433 + parameterEnum?: 'Success' | 'Warning' | 'Error'; 1434 + /** 1435 + * This is a simple model with default value 1436 + */ 1437 + parameterModel?: ModelWithString | null; 1438 + }; 1439 + url: '/api/v{api-version}/defaults'; 1440 + }; 1441 + 1442 + export type CallWithDefaultOptionalParametersData = { 1443 + body?: never; 1444 + path?: never; 1445 + query?: { 1446 + /** 1447 + * This is a simple string that is optional with default value 1448 + */ 1449 + parameterString?: string; 1450 + /** 1451 + * This is a simple number that is optional with default value 1452 + */ 1453 + parameterNumber?: number; 1454 + /** 1455 + * This is a simple boolean that is optional with default value 1456 + */ 1457 + parameterBoolean?: boolean; 1458 + /** 1459 + * This is a simple enum that is optional with default value 1460 + */ 1461 + parameterEnum?: 'Success' | 'Warning' | 'Error'; 1462 + /** 1463 + * This is a simple model that is optional with default value 1464 + */ 1465 + parameterModel?: ModelWithString; 1466 + }; 1467 + url: '/api/v{api-version}/defaults'; 1468 + }; 1469 + 1470 + export type CallToTestOrderOfParamsData = { 1471 + body?: never; 1472 + path?: never; 1473 + query: { 1474 + /** 1475 + * This is a optional string with default 1476 + */ 1477 + parameterOptionalStringWithDefault?: string; 1478 + /** 1479 + * This is a optional string with empty default 1480 + */ 1481 + parameterOptionalStringWithEmptyDefault?: string; 1482 + /** 1483 + * This is a optional string with no default 1484 + */ 1485 + parameterOptionalStringWithNoDefault?: string; 1486 + /** 1487 + * This is a string with default 1488 + */ 1489 + parameterStringWithDefault: string; 1490 + /** 1491 + * This is a string with empty default 1492 + */ 1493 + parameterStringWithEmptyDefault: string; 1494 + /** 1495 + * This is a string with no default 1496 + */ 1497 + parameterStringWithNoDefault: string; 1498 + /** 1499 + * This is a string that can be null with no default 1500 + */ 1501 + parameterStringNullableWithNoDefault?: string | null; 1502 + /** 1503 + * This is a string that can be null with default 1504 + */ 1505 + parameterStringNullableWithDefault?: string | null; 1506 + }; 1507 + url: '/api/v{api-version}/defaults'; 1508 + }; 1509 + 1510 + export type DuplicateNameData = { 1511 + body?: never; 1512 + path?: never; 1513 + query?: never; 1514 + url: '/api/v{api-version}/duplicate'; 1515 + }; 1516 + 1517 + export type DuplicateName2Data = { 1518 + body?: never; 1519 + path?: never; 1520 + query?: never; 1521 + url: '/api/v{api-version}/duplicate'; 1522 + }; 1523 + 1524 + export type DuplicateName3Data = { 1525 + body?: never; 1526 + path?: never; 1527 + query?: never; 1528 + url: '/api/v{api-version}/duplicate'; 1529 + }; 1530 + 1531 + export type DuplicateName4Data = { 1532 + body?: never; 1533 + path?: never; 1534 + query?: never; 1535 + url: '/api/v{api-version}/duplicate'; 1536 + }; 1537 + 1538 + export type CallWithNoContentResponseData = { 1539 + body?: never; 1540 + path?: never; 1541 + query?: never; 1542 + url: '/api/v{api-version}/no-content'; 1543 + }; 1544 + 1545 + export type CallWithNoContentResponseResponses = { 1546 + /** 1547 + * Success 1548 + */ 1549 + 204: void; 1550 + }; 1551 + 1552 + export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; 1553 + 1554 + export type CallWithResponseAndNoContentResponseData = { 1555 + body?: never; 1556 + path?: never; 1557 + query?: never; 1558 + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; 1559 + }; 1560 + 1561 + export type CallWithResponseAndNoContentResponseResponses = { 1562 + /** 1563 + * Response is a simple number 1564 + */ 1565 + 200: number; 1566 + /** 1567 + * Success 1568 + */ 1569 + 204: void; 1570 + }; 1571 + 1572 + export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; 1573 + 1574 + export type DummyAData = { 1575 + body?: never; 1576 + path?: never; 1577 + query?: never; 1578 + url: '/api/v{api-version}/multiple-tags/a'; 1579 + }; 1580 + 1581 + export type DummyAResponses = { 1582 + 200: _400; 1583 + }; 1584 + 1585 + export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; 1586 + 1587 + export type DummyBData = { 1588 + body?: never; 1589 + path?: never; 1590 + query?: never; 1591 + url: '/api/v{api-version}/multiple-tags/b'; 1592 + }; 1593 + 1594 + export type DummyBResponses = { 1595 + /** 1596 + * Success 1597 + */ 1598 + 204: void; 1599 + }; 1600 + 1601 + export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; 1602 + 1603 + export type CallWithResponseData = { 1604 + body?: never; 1605 + path?: never; 1606 + query?: never; 1607 + url: '/api/v{api-version}/response'; 1608 + }; 1609 + 1610 + export type CallWithResponseResponses = { 1611 + default: Import; 1612 + }; 1613 + 1614 + export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; 1615 + 1616 + export type CallWithDuplicateResponsesData = { 1617 + body?: never; 1618 + path?: never; 1619 + query?: never; 1620 + url: '/api/v{api-version}/response'; 1621 + }; 1622 + 1623 + export type CallWithDuplicateResponsesErrors = { 1624 + /** 1625 + * Message for 500 error 1626 + */ 1627 + 500: ModelWithStringError; 1628 + /** 1629 + * Message for 501 error 1630 + */ 1631 + 501: ModelWithStringError; 1632 + /** 1633 + * Message for 502 error 1634 + */ 1635 + 502: ModelWithStringError; 1636 + /** 1637 + * Message for 4XX errors 1638 + */ 1639 + '4XX': DictionaryWithArray; 1640 + /** 1641 + * Default error response 1642 + */ 1643 + default: ModelWithBoolean; 1644 + }; 1645 + 1646 + export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; 1647 + 1648 + export type CallWithDuplicateResponsesResponses = { 1649 + /** 1650 + * Message for 200 response 1651 + */ 1652 + 200: ModelWithBoolean & ModelWithInteger; 1653 + /** 1654 + * Message for 201 response 1655 + */ 1656 + 201: ModelWithString; 1657 + /** 1658 + * Message for 202 response 1659 + */ 1660 + 202: ModelWithString; 1661 + }; 1662 + 1663 + export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; 1664 + 1665 + export type CallWithResponsesData = { 1666 + body?: never; 1667 + path?: never; 1668 + query?: never; 1669 + url: '/api/v{api-version}/response'; 1670 + }; 1671 + 1672 + export type CallWithResponsesErrors = { 1673 + /** 1674 + * Message for 500 error 1675 + */ 1676 + 500: ModelWithStringError; 1677 + /** 1678 + * Message for 501 error 1679 + */ 1680 + 501: ModelWithStringError; 1681 + /** 1682 + * Message for 502 error 1683 + */ 1684 + 502: ModelWithStringError; 1685 + /** 1686 + * Message for default response 1687 + */ 1688 + default: ModelWithStringError; 1689 + }; 1690 + 1691 + export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; 1692 + 1693 + export type CallWithResponsesResponses = { 1694 + /** 1695 + * Message for 200 response 1696 + */ 1697 + 200: { 1698 + readonly '@namespace.string'?: string; 1699 + readonly '@namespace.integer'?: number; 1700 + readonly value?: Array<ModelWithString>; 1701 + }; 1702 + /** 1703 + * Message for 201 response 1704 + */ 1705 + 201: ModelThatExtends; 1706 + /** 1707 + * Message for 202 response 1708 + */ 1709 + 202: ModelThatExtendsExtends; 1710 + }; 1711 + 1712 + export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; 1713 + 1714 + export type CollectionFormatData = { 1715 + body?: never; 1716 + path?: never; 1717 + query: { 1718 + /** 1719 + * This is an array parameter that is sent as csv format (comma-separated values) 1720 + */ 1721 + parameterArrayCSV: Array<string> | null; 1722 + /** 1723 + * This is an array parameter that is sent as ssv format (space-separated values) 1724 + */ 1725 + parameterArraySSV: Array<string> | null; 1726 + /** 1727 + * This is an array parameter that is sent as tsv format (tab-separated values) 1728 + */ 1729 + parameterArrayTSV: Array<string> | null; 1730 + /** 1731 + * This is an array parameter that is sent as pipes format (pipe-separated values) 1732 + */ 1733 + parameterArrayPipes: Array<string> | null; 1734 + /** 1735 + * This is an array parameter that is sent as multi format (multiple parameter instances) 1736 + */ 1737 + parameterArrayMulti: Array<string> | null; 1738 + }; 1739 + url: '/api/v{api-version}/collectionFormat'; 1740 + }; 1741 + 1742 + export type TypesData = { 1743 + body?: never; 1744 + path?: { 1745 + /** 1746 + * This is a number parameter 1747 + */ 1748 + id?: number; 1749 + }; 1750 + query: { 1751 + /** 1752 + * This is a number parameter 1753 + */ 1754 + parameterNumber: number; 1755 + /** 1756 + * This is a string parameter 1757 + */ 1758 + parameterString: string | null; 1759 + /** 1760 + * This is a boolean parameter 1761 + */ 1762 + parameterBoolean: boolean | null; 1763 + /** 1764 + * This is an object parameter 1765 + */ 1766 + parameterObject: { 1767 + [key: string]: unknown; 1768 + } | null; 1769 + /** 1770 + * This is an array parameter 1771 + */ 1772 + parameterArray: Array<string> | null; 1773 + /** 1774 + * This is a dictionary parameter 1775 + */ 1776 + parameterDictionary: { 1777 + [key: string]: unknown; 1778 + } | null; 1779 + /** 1780 + * This is an enum parameter 1781 + */ 1782 + parameterEnum: 'Success' | 'Warning' | 'Error'; 1783 + }; 1784 + url: '/api/v{api-version}/types'; 1785 + }; 1786 + 1787 + export type TypesResponses = { 1788 + /** 1789 + * Response is a simple number 1790 + */ 1791 + 200: number; 1792 + /** 1793 + * Response is a simple string 1794 + */ 1795 + 201: string; 1796 + /** 1797 + * Response is a simple boolean 1798 + */ 1799 + 202: boolean; 1800 + /** 1801 + * Response is a simple object 1802 + */ 1803 + 203: { 1804 + [key: string]: unknown; 1805 + }; 1806 + }; 1807 + 1808 + export type TypesResponse = TypesResponses[keyof TypesResponses]; 1809 + 1810 + export type UploadFileData = { 1811 + body: Blob | File; 1812 + path: { 1813 + /** 1814 + * api-version should be required in standalone clients 1815 + */ 1816 + 'api-version': string | null; 1817 + }; 1818 + query?: never; 1819 + url: '/api/v{api-version}/upload'; 1820 + }; 1821 + 1822 + export type UploadFileResponses = { 1823 + 200: boolean; 1824 + }; 1825 + 1826 + export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; 1827 + 1828 + export type FileResponseData = { 1829 + body?: never; 1830 + path: { 1831 + id: string; 1832 + /** 1833 + * api-version should be required in standalone clients 1834 + */ 1835 + 'api-version': string; 1836 + }; 1837 + query?: never; 1838 + url: '/api/v{api-version}/file/{id}'; 1839 + }; 1840 + 1841 + export type FileResponseResponses = { 1842 + /** 1843 + * Success 1844 + */ 1845 + 200: Blob | File; 1846 + }; 1847 + 1848 + export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; 1849 + 1850 + export type ComplexTypesData = { 1851 + body?: never; 1852 + path?: never; 1853 + query: { 1854 + /** 1855 + * Parameter containing object 1856 + */ 1857 + parameterObject: { 1858 + first?: { 1859 + second?: { 1860 + third?: string; 1861 + }; 1862 + }; 1863 + }; 1864 + /** 1865 + * Parameter containing reference 1866 + */ 1867 + parameterReference: ModelWithString; 1868 + }; 1869 + url: '/api/v{api-version}/complex'; 1870 + }; 1871 + 1872 + export type ComplexTypesErrors = { 1873 + /** 1874 + * 400 `server` error 1875 + */ 1876 + 400: unknown; 1877 + /** 1878 + * 500 server error 1879 + */ 1880 + 500: unknown; 1881 + }; 1882 + 1883 + export type ComplexTypesResponses = { 1884 + /** 1885 + * Successful response 1886 + */ 1887 + 200: Array<ModelWithString>; 1888 + }; 1889 + 1890 + export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; 1891 + 1892 + export type MultipartResponseData = { 1893 + body?: never; 1894 + path?: never; 1895 + query?: never; 1896 + url: '/api/v{api-version}/multipart'; 1897 + }; 1898 + 1899 + export type MultipartResponseResponses = { 1900 + /** 1901 + * OK 1902 + */ 1903 + 200: { 1904 + file?: Blob | File; 1905 + metadata?: { 1906 + foo?: string; 1907 + bar?: string; 1908 + }; 1909 + }; 1910 + }; 1911 + 1912 + export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; 1913 + 1914 + export type MultipartRequestData = { 1915 + body?: { 1916 + content?: Blob | File; 1917 + data?: ModelWithString | null; 1918 + }; 1919 + path?: never; 1920 + query?: never; 1921 + url: '/api/v{api-version}/multipart'; 1922 + }; 1923 + 1924 + export type ComplexParamsData = { 1925 + body?: { 1926 + name: string | null; 1927 + enabled?: boolean; 1928 + type: 'Monkey' | 'Horse' | 'Bird'; 1929 + listOfModels?: Array<ModelWithString> | null; 1930 + listOfStrings?: Array<string> | null; 1931 + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; 1932 + }; 1933 + path: { 1934 + id: number; 1935 + /** 1936 + * api-version should be required in standalone clients 1937 + */ 1938 + 'api-version': string; 1939 + }; 1940 + query?: never; 1941 + url: '/api/v{api-version}/complex/{id}'; 1942 + }; 1943 + 1944 + export type ComplexParamsResponses = { 1945 + /** 1946 + * Success 1947 + */ 1948 + 200: ModelWithString; 1949 + }; 1950 + 1951 + export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; 1952 + 1953 + export type CallWithResultFromHeaderData = { 1954 + body?: never; 1955 + path?: never; 1956 + query?: never; 1957 + url: '/api/v{api-version}/header'; 1958 + }; 1959 + 1960 + export type CallWithResultFromHeaderErrors = { 1961 + /** 1962 + * 400 server error 1963 + */ 1964 + 400: unknown; 1965 + /** 1966 + * 500 server error 1967 + */ 1968 + 500: unknown; 1969 + }; 1970 + 1971 + export type CallWithResultFromHeaderResponses = { 1972 + /** 1973 + * Successful response 1974 + */ 1975 + 200: unknown; 1976 + }; 1977 + 1978 + export type TestErrorCodeData = { 1979 + body?: never; 1980 + path?: never; 1981 + query: { 1982 + /** 1983 + * Status code to return 1984 + */ 1985 + status: number; 1986 + }; 1987 + url: '/api/v{api-version}/error'; 1988 + }; 1989 + 1990 + export type TestErrorCodeErrors = { 1991 + /** 1992 + * Custom message: Internal Server Error 1993 + */ 1994 + 500: unknown; 1995 + /** 1996 + * Custom message: Not Implemented 1997 + */ 1998 + 501: unknown; 1999 + /** 2000 + * Custom message: Bad Gateway 2001 + */ 2002 + 502: unknown; 2003 + /** 2004 + * Custom message: Service Unavailable 2005 + */ 2006 + 503: unknown; 2007 + }; 2008 + 2009 + export type TestErrorCodeResponses = { 2010 + /** 2011 + * Custom message: Successful response 2012 + */ 2013 + 200: unknown; 2014 + }; 2015 + 2016 + export type NonAsciiæøåÆøÅöôêÊ字符串Data = { 2017 + body?: never; 2018 + path?: never; 2019 + query: { 2020 + /** 2021 + * Dummy input param 2022 + */ 2023 + nonAsciiParamæøåÆØÅöôêÊ: number; 2024 + }; 2025 + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; 2026 + }; 2027 + 2028 + export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { 2029 + /** 2030 + * Successful response 2031 + */ 2032 + 200: Array<NonAsciiStringæøåÆøÅöôêÊ字符串>; 2033 + }; 2034 + 2035 + export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; 2036 + 2037 + export type PutWithFormUrlEncodedData = { 2038 + body: ArrayWithStrings; 2039 + path?: never; 2040 + query?: never; 2041 + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; 2042 + }; 2043 + 2044 + export type ClientOptions = { 2045 + baseUrl: 'http://localhost:3000/base' | (string & {}); 2046 + };
-23
packages/openapi-ts-tests/test/__snapshots__/3.0.x/plugins/@tanstack/angular-query-experimental/asClass/sdk.gen.ts
··· 57 57 ...options 58 58 }); 59 59 } 60 - 61 60 } 62 61 63 62 export class SimpleService { ··· 116 115 ...options 117 116 }); 118 117 } 119 - 120 118 } 121 119 122 120 export class ParametersService { ··· 170 168 } 171 169 }); 172 170 } 173 - 174 171 } 175 172 176 173 export class DescriptionsService { ··· 180 177 ...options 181 178 }); 182 179 } 183 - 184 180 } 185 181 186 182 export class DeprecatedService { ··· 193 189 ...options 194 190 }); 195 191 } 196 - 197 192 } 198 193 199 194 export class RequestBodyService { ··· 207 202 } 208 203 }); 209 204 } 210 - 211 205 } 212 206 213 207 export class FormDataService { ··· 222 216 } 223 217 }); 224 218 } 225 - 226 219 } 227 220 228 221 export class DefaultsService { ··· 246 239 ...options 247 240 }); 248 241 } 249 - 250 242 } 251 243 252 244 export class DuplicateService { ··· 277 269 ...options 278 270 }); 279 271 } 280 - 281 272 } 282 273 283 274 export class NoContentService { ··· 294 285 ...options 295 286 }); 296 287 } 297 - 298 288 } 299 289 300 290 export class ResponseService { ··· 325 315 ...options 326 316 }); 327 317 } 328 - 329 318 } 330 319 331 320 export class MultipleTags1Service { ··· 342 331 ...options 343 332 }); 344 333 } 345 - 346 334 } 347 335 348 336 export class MultipleTags2Service { ··· 359 347 ...options 360 348 }); 361 349 } 362 - 363 350 } 364 351 365 352 export class MultipleTags3Service { ··· 369 356 ...options 370 357 }); 371 358 } 372 - 373 359 } 374 360 375 361 export class CollectionFormatService { ··· 379 365 ...options 380 366 }); 381 367 } 382 - 383 368 } 384 369 385 370 export class TypesService { ··· 389 374 ...options 390 375 }); 391 376 } 392 - 393 377 } 394 378 395 379 export class UploadService { ··· 404 388 } 405 389 }); 406 390 } 407 - 408 391 } 409 392 410 393 export class FileResponseService { ··· 414 397 ...options 415 398 }); 416 399 } 417 - 418 400 } 419 401 420 402 export class ComplexService { ··· 435 417 } 436 418 }); 437 419 } 438 - 439 420 } 440 421 441 422 export class MultipartService { ··· 457 438 } 458 439 }); 459 440 } 460 - 461 441 } 462 442 463 443 export class HeaderService { ··· 467 447 ...options 468 448 }); 469 449 } 470 - 471 450 } 472 451 473 452 export class ErrorService { ··· 477 456 ...options 478 457 }); 479 458 } 480 - 481 459 } 482 460 483 461 export class NonAsciiÆøåÆøÅöôêÊService { ··· 502 480 } 503 481 }); 504 482 } 505 - 506 483 }
-23
packages/openapi-ts-tests/test/__snapshots__/3.0.x/plugins/@tanstack/react-query/asClass/sdk.gen.ts
··· 57 57 ...options 58 58 }); 59 59 } 60 - 61 60 } 62 61 63 62 export class SimpleService { ··· 116 115 ...options 117 116 }); 118 117 } 119 - 120 118 } 121 119 122 120 export class ParametersService { ··· 170 168 } 171 169 }); 172 170 } 173 - 174 171 } 175 172 176 173 export class DescriptionsService { ··· 180 177 ...options 181 178 }); 182 179 } 183 - 184 180 } 185 181 186 182 export class DeprecatedService { ··· 193 189 ...options 194 190 }); 195 191 } 196 - 197 192 } 198 193 199 194 export class RequestBodyService { ··· 207 202 } 208 203 }); 209 204 } 210 - 211 205 } 212 206 213 207 export class FormDataService { ··· 222 216 } 223 217 }); 224 218 } 225 - 226 219 } 227 220 228 221 export class DefaultsService { ··· 246 239 ...options 247 240 }); 248 241 } 249 - 250 242 } 251 243 252 244 export class DuplicateService { ··· 277 269 ...options 278 270 }); 279 271 } 280 - 281 272 } 282 273 283 274 export class NoContentService { ··· 294 285 ...options 295 286 }); 296 287 } 297 - 298 288 } 299 289 300 290 export class ResponseService { ··· 325 315 ...options 326 316 }); 327 317 } 328 - 329 318 } 330 319 331 320 export class MultipleTags1Service { ··· 342 331 ...options 343 332 }); 344 333 } 345 - 346 334 } 347 335 348 336 export class MultipleTags2Service { ··· 359 347 ...options 360 348 }); 361 349 } 362 - 363 350 } 364 351 365 352 export class MultipleTags3Service { ··· 369 356 ...options 370 357 }); 371 358 } 372 - 373 359 } 374 360 375 361 export class CollectionFormatService { ··· 379 365 ...options 380 366 }); 381 367 } 382 - 383 368 } 384 369 385 370 export class TypesService { ··· 389 374 ...options 390 375 }); 391 376 } 392 - 393 377 } 394 378 395 379 export class UploadService { ··· 404 388 } 405 389 }); 406 390 } 407 - 408 391 } 409 392 410 393 export class FileResponseService { ··· 414 397 ...options 415 398 }); 416 399 } 417 - 418 400 } 419 401 420 402 export class ComplexService { ··· 435 417 } 436 418 }); 437 419 } 438 - 439 420 } 440 421 441 422 export class MultipartService { ··· 457 438 } 458 439 }); 459 440 } 460 - 461 441 } 462 442 463 443 export class HeaderService { ··· 467 447 ...options 468 448 }); 469 449 } 470 - 471 450 } 472 451 473 452 export class ErrorService { ··· 477 456 ...options 478 457 }); 479 458 } 480 - 481 459 } 482 460 483 461 export class NonAsciiÆøåÆøÅöôêÊService { ··· 502 480 } 503 481 }); 504 482 } 505 - 506 483 }
-23
packages/openapi-ts-tests/test/__snapshots__/3.0.x/plugins/@tanstack/solid-query/asClass/sdk.gen.ts
··· 57 57 ...options 58 58 }); 59 59 } 60 - 61 60 } 62 61 63 62 export class SimpleService { ··· 116 115 ...options 117 116 }); 118 117 } 119 - 120 118 } 121 119 122 120 export class ParametersService { ··· 170 168 } 171 169 }); 172 170 } 173 - 174 171 } 175 172 176 173 export class DescriptionsService { ··· 180 177 ...options 181 178 }); 182 179 } 183 - 184 180 } 185 181 186 182 export class DeprecatedService { ··· 193 189 ...options 194 190 }); 195 191 } 196 - 197 192 } 198 193 199 194 export class RequestBodyService { ··· 207 202 } 208 203 }); 209 204 } 210 - 211 205 } 212 206 213 207 export class FormDataService { ··· 222 216 } 223 217 }); 224 218 } 225 - 226 219 } 227 220 228 221 export class DefaultsService { ··· 246 239 ...options 247 240 }); 248 241 } 249 - 250 242 } 251 243 252 244 export class DuplicateService { ··· 277 269 ...options 278 270 }); 279 271 } 280 - 281 272 } 282 273 283 274 export class NoContentService { ··· 294 285 ...options 295 286 }); 296 287 } 297 - 298 288 } 299 289 300 290 export class ResponseService { ··· 325 315 ...options 326 316 }); 327 317 } 328 - 329 318 } 330 319 331 320 export class MultipleTags1Service { ··· 342 331 ...options 343 332 }); 344 333 } 345 - 346 334 } 347 335 348 336 export class MultipleTags2Service { ··· 359 347 ...options 360 348 }); 361 349 } 362 - 363 350 } 364 351 365 352 export class MultipleTags3Service { ··· 369 356 ...options 370 357 }); 371 358 } 372 - 373 359 } 374 360 375 361 export class CollectionFormatService { ··· 379 365 ...options 380 366 }); 381 367 } 382 - 383 368 } 384 369 385 370 export class TypesService { ··· 389 374 ...options 390 375 }); 391 376 } 392 - 393 377 } 394 378 395 379 export class UploadService { ··· 404 388 } 405 389 }); 406 390 } 407 - 408 391 } 409 392 410 393 export class FileResponseService { ··· 414 397 ...options 415 398 }); 416 399 } 417 - 418 400 } 419 401 420 402 export class ComplexService { ··· 435 417 } 436 418 }); 437 419 } 438 - 439 420 } 440 421 441 422 export class MultipartService { ··· 457 438 } 458 439 }); 459 440 } 460 - 461 441 } 462 442 463 443 export class HeaderService { ··· 467 447 ...options 468 448 }); 469 449 } 470 - 471 450 } 472 451 473 452 export class ErrorService { ··· 477 456 ...options 478 457 }); 479 458 } 480 - 481 459 } 482 460 483 461 export class NonAsciiÆøåÆøÅöôêÊService { ··· 502 480 } 503 481 }); 504 482 } 505 - 506 483 }
-23
packages/openapi-ts-tests/test/__snapshots__/3.0.x/plugins/@tanstack/svelte-query/asClass/sdk.gen.ts
··· 57 57 ...options 58 58 }); 59 59 } 60 - 61 60 } 62 61 63 62 export class SimpleService { ··· 116 115 ...options 117 116 }); 118 117 } 119 - 120 118 } 121 119 122 120 export class ParametersService { ··· 170 168 } 171 169 }); 172 170 } 173 - 174 171 } 175 172 176 173 export class DescriptionsService { ··· 180 177 ...options 181 178 }); 182 179 } 183 - 184 180 } 185 181 186 182 export class DeprecatedService { ··· 193 189 ...options 194 190 }); 195 191 } 196 - 197 192 } 198 193 199 194 export class RequestBodyService { ··· 207 202 } 208 203 }); 209 204 } 210 - 211 205 } 212 206 213 207 export class FormDataService { ··· 222 216 } 223 217 }); 224 218 } 225 - 226 219 } 227 220 228 221 export class DefaultsService { ··· 246 239 ...options 247 240 }); 248 241 } 249 - 250 242 } 251 243 252 244 export class DuplicateService { ··· 277 269 ...options 278 270 }); 279 271 } 280 - 281 272 } 282 273 283 274 export class NoContentService { ··· 294 285 ...options 295 286 }); 296 287 } 297 - 298 288 } 299 289 300 290 export class ResponseService { ··· 325 315 ...options 326 316 }); 327 317 } 328 - 329 318 } 330 319 331 320 export class MultipleTags1Service { ··· 342 331 ...options 343 332 }); 344 333 } 345 - 346 334 } 347 335 348 336 export class MultipleTags2Service { ··· 359 347 ...options 360 348 }); 361 349 } 362 - 363 350 } 364 351 365 352 export class MultipleTags3Service { ··· 369 356 ...options 370 357 }); 371 358 } 372 - 373 359 } 374 360 375 361 export class CollectionFormatService { ··· 379 365 ...options 380 366 }); 381 367 } 382 - 383 368 } 384 369 385 370 export class TypesService { ··· 389 374 ...options 390 375 }); 391 376 } 392 - 393 377 } 394 378 395 379 export class UploadService { ··· 404 388 } 405 389 }); 406 390 } 407 - 408 391 } 409 392 410 393 export class FileResponseService { ··· 414 397 ...options 415 398 }); 416 399 } 417 - 418 400 } 419 401 420 402 export class ComplexService { ··· 435 417 } 436 418 }); 437 419 } 438 - 439 420 } 440 421 441 422 export class MultipartService { ··· 457 438 } 458 439 }); 459 440 } 460 - 461 441 } 462 442 463 443 export class HeaderService { ··· 467 447 ...options 468 448 }); 469 449 } 470 - 471 450 } 472 451 473 452 export class ErrorService { ··· 477 456 ...options 478 457 }); 479 458 } 480 - 481 459 } 482 460 483 461 export class NonAsciiÆøåÆøÅöôêÊService { ··· 502 480 } 503 481 }); 504 482 } 505 - 506 483 }
-23
packages/openapi-ts-tests/test/__snapshots__/3.0.x/plugins/@tanstack/vue-query/asClass/sdk.gen.ts
··· 57 57 ...options 58 58 }); 59 59 } 60 - 61 60 } 62 61 63 62 export class SimpleService { ··· 116 115 ...options 117 116 }); 118 117 } 119 - 120 118 } 121 119 122 120 export class ParametersService { ··· 170 168 } 171 169 }); 172 170 } 173 - 174 171 } 175 172 176 173 export class DescriptionsService { ··· 180 177 ...options 181 178 }); 182 179 } 183 - 184 180 } 185 181 186 182 export class DeprecatedService { ··· 193 189 ...options 194 190 }); 195 191 } 196 - 197 192 } 198 193 199 194 export class RequestBodyService { ··· 207 202 } 208 203 }); 209 204 } 210 - 211 205 } 212 206 213 207 export class FormDataService { ··· 222 216 } 223 217 }); 224 218 } 225 - 226 219 } 227 220 228 221 export class DefaultsService { ··· 246 239 ...options 247 240 }); 248 241 } 249 - 250 242 } 251 243 252 244 export class DuplicateService { ··· 277 269 ...options 278 270 }); 279 271 } 280 - 281 272 } 282 273 283 274 export class NoContentService { ··· 294 285 ...options 295 286 }); 296 287 } 297 - 298 288 } 299 289 300 290 export class ResponseService { ··· 325 315 ...options 326 316 }); 327 317 } 328 - 329 318 } 330 319 331 320 export class MultipleTags1Service { ··· 342 331 ...options 343 332 }); 344 333 } 345 - 346 334 } 347 335 348 336 export class MultipleTags2Service { ··· 359 347 ...options 360 348 }); 361 349 } 362 - 363 350 } 364 351 365 352 export class MultipleTags3Service { ··· 369 356 ...options 370 357 }); 371 358 } 372 - 373 359 } 374 360 375 361 export class CollectionFormatService { ··· 379 365 ...options 380 366 }); 381 367 } 382 - 383 368 } 384 369 385 370 export class TypesService { ··· 389 374 ...options 390 375 }); 391 376 } 392 - 393 377 } 394 378 395 379 export class UploadService { ··· 404 388 } 405 389 }); 406 390 } 407 - 408 391 } 409 392 410 393 export class FileResponseService { ··· 414 397 ...options 415 398 }); 416 399 } 417 - 418 400 } 419 401 420 402 export class ComplexService { ··· 435 417 } 436 418 }); 437 419 } 438 - 439 420 } 440 421 441 422 export class MultipartService { ··· 457 438 } 458 439 }); 459 440 } 460 - 461 441 } 462 442 463 443 export class HeaderService { ··· 467 447 ...options 468 448 }); 469 449 } 470 - 471 450 } 472 451 473 452 export class ErrorService { ··· 477 456 ...options 478 457 }); 479 458 } 480 - 481 459 } 482 460 483 461 export class NonAsciiÆøåÆøÅöôêÊService { ··· 502 480 } 503 481 }); 504 482 } 505 - 506 483 }
+18
packages/openapi-ts-tests/test/__snapshots__/3.1.x/plugins/@hey-api/sdk/instance/client.gen.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + 3 + import type { ClientOptions } from './types.gen'; 4 + import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; 5 + 6 + /** 7 + * The `createClientConfig()` function will be called on client initialization 8 + * and the returned object will become the client's initial configuration. 9 + * 10 + * You may want to initialize your client this way instead of calling 11 + * `setConfig()`. This is useful for example if you're using Next.js 12 + * to ensure your client always has the correct values. 13 + */ 14 + export type CreateClientConfig<T extends DefaultClientOptions = ClientOptions> = (override?: Config<DefaultClientOptions & T>) => Config<Required<DefaultClientOptions> & T>; 15 + 16 + export const client = createClient(createConfig<ClientOptions>({ 17 + baseUrl: 'http://localhost:3000/base' 18 + }));
+3
packages/openapi-ts-tests/test/__snapshots__/3.1.x/plugins/@hey-api/sdk/instance/index.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + export * from './types.gen'; 3 + export * from './sdk.gen';
+421
packages/openapi-ts-tests/test/__snapshots__/3.1.x/plugins/@hey-api/sdk/instance/sdk.gen.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + 3 + import { type Options as ClientOptions, type TDataShape, type Client, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-fetch'; 4 + import type { ExportData, PatchApiVbyApiVersionNoTagData, PatchApiVbyApiVersionNoTagResponses, ImportData, ImportResponses, FooWowData, FooWowResponses, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponses, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationResponses, GetApiVbyApiVersionSimpleOperationErrors, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponses, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponses, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponses, DummyAData, DummyAResponses, DummyBData, DummyBResponses, CallWithResponseData, CallWithResponseResponses, CallWithDuplicateResponsesData, CallWithDuplicateResponsesResponses, CallWithDuplicateResponsesErrors, CallWithResponsesData, CallWithResponsesResponses, CallWithResponsesErrors, CollectionFormatData, TypesData, TypesResponses, UploadFileData, UploadFileResponses, FileResponseData, FileResponseResponses, ComplexTypesData, ComplexTypesResponses, ComplexTypesErrors, MultipartResponseData, MultipartResponseResponses, MultipartRequestData, ComplexParamsData, ComplexParamsResponses, CallWithResultFromHeaderData, CallWithResultFromHeaderResponses, CallWithResultFromHeaderErrors, TestErrorCodeData, TestErrorCodeResponses, TestErrorCodeErrors, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Responses, PutWithFormUrlEncodedData } from './types.gen'; 5 + import { client as _heyApiClient } from './client.gen'; 6 + 7 + export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = ClientOptions<TData, ThrowOnError> & { 8 + /** 9 + * You can provide a client instance returned by `createClient()` instead of 10 + * individual options. This might be also useful if you want to implement a 11 + * custom client. 12 + */ 13 + client?: Client; 14 + /** 15 + * You can pass arbitrary values through the `meta` object. This can be 16 + * used to access values that aren't defined as part of the SDK function. 17 + */ 18 + meta?: Record<string, unknown>; 19 + }; 20 + 21 + export class Sdk { 22 + client: Client = _heyApiClient; 23 + 24 + constructor({ client }: { 25 + client?: Client; 26 + }) { 27 + if (client) { 28 + this.client = client; 29 + } 30 + } 31 + 32 + public export<ThrowOnError extends boolean = false>(options?: Options<ExportData, ThrowOnError>) { 33 + return (options?.client ?? this.client).get<unknown, unknown, ThrowOnError>({ 34 + url: '/api/v{api-version}/no+tag', 35 + ...options 36 + }); 37 + } 38 + 39 + public patchApiVbyApiVersionNoTag<ThrowOnError extends boolean = false>(options?: Options<PatchApiVbyApiVersionNoTagData, ThrowOnError>) { 40 + return (options?.client ?? this.client).patch<PatchApiVbyApiVersionNoTagResponses, unknown, ThrowOnError>({ 41 + url: '/api/v{api-version}/no+tag', 42 + ...options 43 + }); 44 + } 45 + 46 + public import<ThrowOnError extends boolean = false>(options: Options<ImportData, ThrowOnError>) { 47 + return (options.client ?? this.client).post<ImportResponses, unknown, ThrowOnError>({ 48 + url: '/api/v{api-version}/no+tag', 49 + ...options, 50 + headers: { 51 + 'Content-Type': 'application/json', 52 + ...options.headers 53 + } 54 + }); 55 + } 56 + 57 + public fooWow<ThrowOnError extends boolean = false>(options?: Options<FooWowData, ThrowOnError>) { 58 + return (options?.client ?? this.client).put<FooWowResponses, unknown, ThrowOnError>({ 59 + url: '/api/v{api-version}/no+tag', 60 + ...options 61 + }); 62 + } 63 + 64 + public apiVVersionODataControllerCount<ThrowOnError extends boolean = false>(options?: Options<ApiVVersionODataControllerCountData, ThrowOnError>) { 65 + return (options?.client ?? this.client).get<ApiVVersionODataControllerCountResponses, unknown, ThrowOnError>({ 66 + url: '/api/v{api-version}/simple/$count', 67 + ...options 68 + }); 69 + } 70 + 71 + public getApiVbyApiVersionSimpleOperation<ThrowOnError extends boolean = false>(options: Options<GetApiVbyApiVersionSimpleOperationData, ThrowOnError>) { 72 + return (options.client ?? this.client).get<GetApiVbyApiVersionSimpleOperationResponses, GetApiVbyApiVersionSimpleOperationErrors, ThrowOnError>({ 73 + url: '/api/v{api-version}/simple:operation', 74 + ...options 75 + }); 76 + } 77 + 78 + public deleteCallWithoutParametersAndResponse<ThrowOnError extends boolean = false>(options?: Options<DeleteCallWithoutParametersAndResponseData, ThrowOnError>) { 79 + return (options?.client ?? this.client).delete<unknown, unknown, ThrowOnError>({ 80 + url: '/api/v{api-version}/simple', 81 + ...options 82 + }); 83 + } 84 + 85 + public getCallWithoutParametersAndResponse<ThrowOnError extends boolean = false>(options?: Options<GetCallWithoutParametersAndResponseData, ThrowOnError>) { 86 + return (options?.client ?? this.client).get<unknown, unknown, ThrowOnError>({ 87 + url: '/api/v{api-version}/simple', 88 + ...options 89 + }); 90 + } 91 + 92 + public headCallWithoutParametersAndResponse<ThrowOnError extends boolean = false>(options?: Options<HeadCallWithoutParametersAndResponseData, ThrowOnError>) { 93 + return (options?.client ?? this.client).head<unknown, unknown, ThrowOnError>({ 94 + url: '/api/v{api-version}/simple', 95 + ...options 96 + }); 97 + } 98 + 99 + public optionsCallWithoutParametersAndResponse<ThrowOnError extends boolean = false>(options?: Options<OptionsCallWithoutParametersAndResponseData, ThrowOnError>) { 100 + return (options?.client ?? this.client).options<unknown, unknown, ThrowOnError>({ 101 + url: '/api/v{api-version}/simple', 102 + ...options 103 + }); 104 + } 105 + 106 + public patchCallWithoutParametersAndResponse<ThrowOnError extends boolean = false>(options?: Options<PatchCallWithoutParametersAndResponseData, ThrowOnError>) { 107 + return (options?.client ?? this.client).patch<unknown, unknown, ThrowOnError>({ 108 + url: '/api/v{api-version}/simple', 109 + ...options 110 + }); 111 + } 112 + 113 + public postCallWithoutParametersAndResponse<ThrowOnError extends boolean = false>(options?: Options<PostCallWithoutParametersAndResponseData, ThrowOnError>) { 114 + return (options?.client ?? this.client).post<unknown, unknown, ThrowOnError>({ 115 + url: '/api/v{api-version}/simple', 116 + ...options 117 + }); 118 + } 119 + 120 + public putCallWithoutParametersAndResponse<ThrowOnError extends boolean = false>(options?: Options<PutCallWithoutParametersAndResponseData, ThrowOnError>) { 121 + return (options?.client ?? this.client).put<unknown, unknown, ThrowOnError>({ 122 + url: '/api/v{api-version}/simple', 123 + ...options 124 + }); 125 + } 126 + 127 + public deleteFoo<ThrowOnError extends boolean = false>(options: Options<DeleteFooData3, ThrowOnError>) { 128 + return (options.client ?? this.client).delete<unknown, unknown, ThrowOnError>({ 129 + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}', 130 + ...options 131 + }); 132 + } 133 + 134 + public callWithDescriptions<ThrowOnError extends boolean = false>(options?: Options<CallWithDescriptionsData, ThrowOnError>) { 135 + return (options?.client ?? this.client).post<unknown, unknown, ThrowOnError>({ 136 + url: '/api/v{api-version}/descriptions', 137 + ...options 138 + }); 139 + } 140 + 141 + /** 142 + * @deprecated 143 + */ 144 + public deprecatedCall<ThrowOnError extends boolean = false>(options: Options<DeprecatedCallData, ThrowOnError>) { 145 + return (options.client ?? this.client).post<unknown, unknown, ThrowOnError>({ 146 + url: '/api/v{api-version}/parameters/deprecated', 147 + ...options 148 + }); 149 + } 150 + 151 + public callWithParameters<ThrowOnError extends boolean = false>(options: Options<CallWithParametersData, ThrowOnError>) { 152 + return (options.client ?? this.client).post<unknown, unknown, ThrowOnError>({ 153 + url: '/api/v{api-version}/parameters/{parameterPath}', 154 + ...options, 155 + headers: { 156 + 'Content-Type': 'application/json', 157 + ...options.headers 158 + } 159 + }); 160 + } 161 + 162 + public callWithWeirdParameterNames<ThrowOnError extends boolean = false>(options: Options<CallWithWeirdParameterNamesData, ThrowOnError>) { 163 + return (options.client ?? this.client).post<unknown, unknown, ThrowOnError>({ 164 + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}', 165 + ...options, 166 + headers: { 167 + 'Content-Type': 'application/json', 168 + ...options.headers 169 + } 170 + }); 171 + } 172 + 173 + public getCallWithOptionalParam<ThrowOnError extends boolean = false>(options: Options<GetCallWithOptionalParamData, ThrowOnError>) { 174 + return (options.client ?? this.client).get<unknown, unknown, ThrowOnError>({ 175 + url: '/api/v{api-version}/parameters', 176 + ...options, 177 + headers: { 178 + 'Content-Type': 'application/json', 179 + ...options.headers 180 + } 181 + }); 182 + } 183 + 184 + public postCallWithOptionalParam<ThrowOnError extends boolean = false>(options: Options<PostCallWithOptionalParamData, ThrowOnError>) { 185 + return (options.client ?? this.client).post<PostCallWithOptionalParamResponses, unknown, ThrowOnError>({ 186 + url: '/api/v{api-version}/parameters', 187 + ...options, 188 + headers: { 189 + 'Content-Type': 'application/json', 190 + ...options.headers 191 + } 192 + }); 193 + } 194 + 195 + public postApiVbyApiVersionRequestBody<ThrowOnError extends boolean = false>(options?: Options<PostApiVbyApiVersionRequestBodyData, ThrowOnError>) { 196 + return (options?.client ?? this.client).post<unknown, unknown, ThrowOnError>({ 197 + url: '/api/v{api-version}/requestBody', 198 + ...options, 199 + headers: { 200 + 'Content-Type': 'application/json', 201 + ...options?.headers 202 + } 203 + }); 204 + } 205 + 206 + public postApiVbyApiVersionFormData<ThrowOnError extends boolean = false>(options?: Options<PostApiVbyApiVersionFormDataData, ThrowOnError>) { 207 + return (options?.client ?? this.client).post<unknown, unknown, ThrowOnError>({ 208 + ...formDataBodySerializer, 209 + url: '/api/v{api-version}/formData', 210 + ...options, 211 + headers: { 212 + 'Content-Type': null, 213 + ...options?.headers 214 + } 215 + }); 216 + } 217 + 218 + public callWithDefaultParameters<ThrowOnError extends boolean = false>(options?: Options<CallWithDefaultParametersData, ThrowOnError>) { 219 + return (options?.client ?? this.client).get<unknown, unknown, ThrowOnError>({ 220 + url: '/api/v{api-version}/defaults', 221 + ...options 222 + }); 223 + } 224 + 225 + public callWithDefaultOptionalParameters<ThrowOnError extends boolean = false>(options?: Options<CallWithDefaultOptionalParametersData, ThrowOnError>) { 226 + return (options?.client ?? this.client).post<unknown, unknown, ThrowOnError>({ 227 + url: '/api/v{api-version}/defaults', 228 + ...options 229 + }); 230 + } 231 + 232 + public callToTestOrderOfParams<ThrowOnError extends boolean = false>(options: Options<CallToTestOrderOfParamsData, ThrowOnError>) { 233 + return (options.client ?? this.client).put<unknown, unknown, ThrowOnError>({ 234 + url: '/api/v{api-version}/defaults', 235 + ...options 236 + }); 237 + } 238 + 239 + public duplicateName<ThrowOnError extends boolean = false>(options?: Options<DuplicateNameData, ThrowOnError>) { 240 + return (options?.client ?? this.client).delete<unknown, unknown, ThrowOnError>({ 241 + url: '/api/v{api-version}/duplicate', 242 + ...options 243 + }); 244 + } 245 + 246 + public duplicateName2<ThrowOnError extends boolean = false>(options?: Options<DuplicateName2Data, ThrowOnError>) { 247 + return (options?.client ?? this.client).get<unknown, unknown, ThrowOnError>({ 248 + url: '/api/v{api-version}/duplicate', 249 + ...options 250 + }); 251 + } 252 + 253 + public duplicateName3<ThrowOnError extends boolean = false>(options?: Options<DuplicateName3Data, ThrowOnError>) { 254 + return (options?.client ?? this.client).post<unknown, unknown, ThrowOnError>({ 255 + url: '/api/v{api-version}/duplicate', 256 + ...options 257 + }); 258 + } 259 + 260 + public duplicateName4<ThrowOnError extends boolean = false>(options?: Options<DuplicateName4Data, ThrowOnError>) { 261 + return (options?.client ?? this.client).put<unknown, unknown, ThrowOnError>({ 262 + url: '/api/v{api-version}/duplicate', 263 + ...options 264 + }); 265 + } 266 + 267 + public callWithNoContentResponse<ThrowOnError extends boolean = false>(options?: Options<CallWithNoContentResponseData, ThrowOnError>) { 268 + return (options?.client ?? this.client).get<CallWithNoContentResponseResponses, unknown, ThrowOnError>({ 269 + url: '/api/v{api-version}/no-content', 270 + ...options 271 + }); 272 + } 273 + 274 + public callWithResponseAndNoContentResponse<ThrowOnError extends boolean = false>(options?: Options<CallWithResponseAndNoContentResponseData, ThrowOnError>) { 275 + return (options?.client ?? this.client).get<CallWithResponseAndNoContentResponseResponses, unknown, ThrowOnError>({ 276 + url: '/api/v{api-version}/multiple-tags/response-and-no-content', 277 + ...options 278 + }); 279 + } 280 + 281 + public dummyA<ThrowOnError extends boolean = false>(options?: Options<DummyAData, ThrowOnError>) { 282 + return (options?.client ?? this.client).get<DummyAResponses, unknown, ThrowOnError>({ 283 + url: '/api/v{api-version}/multiple-tags/a', 284 + ...options 285 + }); 286 + } 287 + 288 + public dummyB<ThrowOnError extends boolean = false>(options?: Options<DummyBData, ThrowOnError>) { 289 + return (options?.client ?? this.client).get<DummyBResponses, unknown, ThrowOnError>({ 290 + url: '/api/v{api-version}/multiple-tags/b', 291 + ...options 292 + }); 293 + } 294 + 295 + public callWithResponse<ThrowOnError extends boolean = false>(options?: Options<CallWithResponseData, ThrowOnError>) { 296 + return (options?.client ?? this.client).get<CallWithResponseResponses, unknown, ThrowOnError>({ 297 + url: '/api/v{api-version}/response', 298 + ...options 299 + }); 300 + } 301 + 302 + public callWithDuplicateResponses<ThrowOnError extends boolean = false>(options?: Options<CallWithDuplicateResponsesData, ThrowOnError>) { 303 + return (options?.client ?? this.client).post<CallWithDuplicateResponsesResponses, CallWithDuplicateResponsesErrors, ThrowOnError>({ 304 + url: '/api/v{api-version}/response', 305 + ...options 306 + }); 307 + } 308 + 309 + public callWithResponses<ThrowOnError extends boolean = false>(options?: Options<CallWithResponsesData, ThrowOnError>) { 310 + return (options?.client ?? this.client).put<CallWithResponsesResponses, CallWithResponsesErrors, ThrowOnError>({ 311 + url: '/api/v{api-version}/response', 312 + ...options 313 + }); 314 + } 315 + 316 + public collectionFormat<ThrowOnError extends boolean = false>(options: Options<CollectionFormatData, ThrowOnError>) { 317 + return (options.client ?? this.client).get<unknown, unknown, ThrowOnError>({ 318 + url: '/api/v{api-version}/collectionFormat', 319 + ...options 320 + }); 321 + } 322 + 323 + public types<ThrowOnError extends boolean = false>(options: Options<TypesData, ThrowOnError>) { 324 + return (options.client ?? this.client).get<TypesResponses, unknown, ThrowOnError>({ 325 + url: '/api/v{api-version}/types', 326 + ...options 327 + }); 328 + } 329 + 330 + public uploadFile<ThrowOnError extends boolean = false>(options: Options<UploadFileData, ThrowOnError>) { 331 + return (options.client ?? this.client).post<UploadFileResponses, unknown, ThrowOnError>({ 332 + ...urlSearchParamsBodySerializer, 333 + url: '/api/v{api-version}/upload', 334 + ...options, 335 + headers: { 336 + 'Content-Type': 'application/x-www-form-urlencoded', 337 + ...options.headers 338 + } 339 + }); 340 + } 341 + 342 + public fileResponse<ThrowOnError extends boolean = false>(options: Options<FileResponseData, ThrowOnError>) { 343 + return (options.client ?? this.client).get<FileResponseResponses, unknown, ThrowOnError>({ 344 + url: '/api/v{api-version}/file/{id}', 345 + ...options 346 + }); 347 + } 348 + 349 + public complexTypes<ThrowOnError extends boolean = false>(options: Options<ComplexTypesData, ThrowOnError>) { 350 + return (options.client ?? this.client).get<ComplexTypesResponses, ComplexTypesErrors, ThrowOnError>({ 351 + url: '/api/v{api-version}/complex', 352 + ...options 353 + }); 354 + } 355 + 356 + public multipartResponse<ThrowOnError extends boolean = false>(options?: Options<MultipartResponseData, ThrowOnError>) { 357 + return (options?.client ?? this.client).get<MultipartResponseResponses, unknown, ThrowOnError>({ 358 + url: '/api/v{api-version}/multipart', 359 + ...options 360 + }); 361 + } 362 + 363 + public multipartRequest<ThrowOnError extends boolean = false>(options?: Options<MultipartRequestData, ThrowOnError>) { 364 + return (options?.client ?? this.client).post<unknown, unknown, ThrowOnError>({ 365 + ...formDataBodySerializer, 366 + url: '/api/v{api-version}/multipart', 367 + ...options, 368 + headers: { 369 + 'Content-Type': null, 370 + ...options?.headers 371 + } 372 + }); 373 + } 374 + 375 + public complexParams<ThrowOnError extends boolean = false>(options: Options<ComplexParamsData, ThrowOnError>) { 376 + return (options.client ?? this.client).put<ComplexParamsResponses, unknown, ThrowOnError>({ 377 + url: '/api/v{api-version}/complex/{id}', 378 + ...options, 379 + headers: { 380 + 'Content-Type': 'application/json-patch+json', 381 + ...options.headers 382 + } 383 + }); 384 + } 385 + 386 + public callWithResultFromHeader<ThrowOnError extends boolean = false>(options?: Options<CallWithResultFromHeaderData, ThrowOnError>) { 387 + return (options?.client ?? this.client).post<CallWithResultFromHeaderResponses, CallWithResultFromHeaderErrors, ThrowOnError>({ 388 + url: '/api/v{api-version}/header', 389 + ...options 390 + }); 391 + } 392 + 393 + public testErrorCode<ThrowOnError extends boolean = false>(options: Options<TestErrorCodeData, ThrowOnError>) { 394 + return (options.client ?? this.client).post<TestErrorCodeResponses, TestErrorCodeErrors, ThrowOnError>({ 395 + url: '/api/v{api-version}/error', 396 + ...options 397 + }); 398 + } 399 + 400 + public nonAsciiæøåÆøÅöôêÊ字符串<ThrowOnError extends boolean = false>(options: Options<NonAsciiæøåÆøÅöôêÊ字符串Data, ThrowOnError>) { 401 + return (options.client ?? this.client).post<NonAsciiæøåÆøÅöôêÊ字符串Responses, unknown, ThrowOnError>({ 402 + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', 403 + ...options 404 + }); 405 + } 406 + 407 + /** 408 + * Login User 409 + */ 410 + public putWithFormUrlEncoded<ThrowOnError extends boolean = false>(options: Options<PutWithFormUrlEncodedData, ThrowOnError>) { 411 + return (options.client ?? this.client).put<unknown, unknown, ThrowOnError>({ 412 + ...urlSearchParamsBodySerializer, 413 + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串', 414 + ...options, 415 + headers: { 416 + 'Content-Type': 'application/x-www-form-urlencoded', 417 + ...options.headers 418 + } 419 + }); 420 + } 421 + }
+2059
packages/openapi-ts-tests/test/__snapshots__/3.1.x/plugins/@hey-api/sdk/instance/types.gen.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + 3 + /** 4 + * Model with number-only name 5 + */ 6 + export type _400 = string; 7 + 8 + /** 9 + * Testing multiline comments in string: First line 10 + * Second line 11 + * 12 + * Fourth line 13 + */ 14 + export type CamelCaseCommentWithBreaks = number; 15 + 16 + /** 17 + * Testing multiline comments in string: First line 18 + * Second line 19 + * 20 + * Fourth line 21 + */ 22 + export type CommentWithBreaks = number; 23 + 24 + /** 25 + * Testing backticks in string: `backticks` and ```multiple backticks``` should work 26 + */ 27 + export type CommentWithBackticks = number; 28 + 29 + /** 30 + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work 31 + */ 32 + export type CommentWithBackticksAndQuotes = number; 33 + 34 + /** 35 + * Testing slashes in string: \backwards\\\ and /forwards/// should work 36 + */ 37 + export type CommentWithSlashes = number; 38 + 39 + /** 40 + * Testing expression placeholders in string: ${expression} should work 41 + */ 42 + export type CommentWithExpressionPlaceholders = number; 43 + 44 + /** 45 + * Testing quotes in string: 'single quote''' and "double quotes""" should work 46 + */ 47 + export type CommentWithQuotes = number; 48 + 49 + /** 50 + * Testing reserved characters in string: * inline * and ** inline ** should work 51 + */ 52 + export type CommentWithReservedCharacters = number; 53 + 54 + /** 55 + * This is a simple number 56 + */ 57 + export type SimpleInteger = number; 58 + 59 + /** 60 + * This is a simple boolean 61 + */ 62 + export type SimpleBoolean = boolean; 63 + 64 + /** 65 + * This is a simple string 66 + */ 67 + export type SimpleString = string; 68 + 69 + /** 70 + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) 71 + */ 72 + export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; 73 + 74 + /** 75 + * This is a simple file 76 + */ 77 + export type SimpleFile = Blob | File; 78 + 79 + /** 80 + * This is a simple reference 81 + */ 82 + export type SimpleReference = ModelWithString; 83 + 84 + /** 85 + * This is a simple string 86 + */ 87 + export type SimpleStringWithPattern = string | null; 88 + 89 + /** 90 + * This is a simple enum with strings 91 + */ 92 + export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; 93 + 94 + export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; 95 + 96 + /** 97 + * This is a simple enum with numbers 98 + */ 99 + export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; 100 + 101 + /** 102 + * Success=1,Warning=2,Error=3 103 + */ 104 + export type EnumFromDescription = number; 105 + 106 + /** 107 + * This is a simple enum with numbers 108 + */ 109 + export type EnumWithExtensions = 200 | 400 | 500; 110 + 111 + export type EnumWithXEnumNames = 0 | 1 | 2; 112 + 113 + /** 114 + * This is a simple array with numbers 115 + */ 116 + export type ArrayWithNumbers = Array<number>; 117 + 118 + /** 119 + * This is a simple array with booleans 120 + */ 121 + export type ArrayWithBooleans = Array<boolean>; 122 + 123 + /** 124 + * This is a simple array with strings 125 + */ 126 + export type ArrayWithStrings = Array<string>; 127 + 128 + /** 129 + * This is a simple array with references 130 + */ 131 + export type ArrayWithReferences = Array<ModelWithString>; 132 + 133 + /** 134 + * This is a simple array containing an array 135 + */ 136 + export type ArrayWithArray = Array<Array<ModelWithString>>; 137 + 138 + /** 139 + * This is a simple array with properties 140 + */ 141 + export type ArrayWithProperties = Array<{ 142 + '16x16'?: CamelCaseCommentWithBreaks; 143 + bar?: string; 144 + }>; 145 + 146 + /** 147 + * This is a simple array with any of properties 148 + */ 149 + export type ArrayWithAnyOfProperties = Array<{ 150 + foo?: string; 151 + } | { 152 + bar?: string; 153 + }>; 154 + 155 + export type AnyOfAnyAndNull = { 156 + data?: unknown | null; 157 + }; 158 + 159 + /** 160 + * This is a simple array with any of properties 161 + */ 162 + export type AnyOfArrays = { 163 + results?: Array<{ 164 + foo?: string; 165 + } | { 166 + bar?: string; 167 + }>; 168 + }; 169 + 170 + /** 171 + * This is a string dictionary 172 + */ 173 + export type DictionaryWithString = { 174 + [key: string]: string; 175 + }; 176 + 177 + export type DictionaryWithPropertiesAndAdditionalProperties = { 178 + foo?: number; 179 + bar?: boolean; 180 + [key: string]: string | number | boolean | undefined; 181 + }; 182 + 183 + /** 184 + * This is a string reference 185 + */ 186 + export type DictionaryWithReference = { 187 + [key: string]: ModelWithString; 188 + }; 189 + 190 + /** 191 + * This is a complex dictionary 192 + */ 193 + export type DictionaryWithArray = { 194 + [key: string]: Array<ModelWithString>; 195 + }; 196 + 197 + /** 198 + * This is a string dictionary 199 + */ 200 + export type DictionaryWithDictionary = { 201 + [key: string]: { 202 + [key: string]: string; 203 + }; 204 + }; 205 + 206 + /** 207 + * This is a complex dictionary 208 + */ 209 + export type DictionaryWithProperties = { 210 + [key: string]: { 211 + foo?: string; 212 + bar?: string; 213 + }; 214 + }; 215 + 216 + /** 217 + * This is a model with one number property 218 + */ 219 + export type ModelWithInteger = { 220 + /** 221 + * This is a simple number property 222 + */ 223 + prop?: number; 224 + }; 225 + 226 + /** 227 + * This is a model with one boolean property 228 + */ 229 + export type ModelWithBoolean = { 230 + /** 231 + * This is a simple boolean property 232 + */ 233 + prop?: boolean; 234 + }; 235 + 236 + /** 237 + * This is a model with one string property 238 + */ 239 + export type ModelWithString = { 240 + /** 241 + * This is a simple string property 242 + */ 243 + prop?: string; 244 + }; 245 + 246 + /** 247 + * This is a model with one string property 248 + */ 249 + export type ModelWithStringError = { 250 + /** 251 + * This is a simple string property 252 + */ 253 + prop?: string; 254 + }; 255 + 256 + /** 257 + * `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) 258 + */ 259 + export type ModelFromZendesk = string; 260 + 261 + /** 262 + * This is a model with one string property 263 + */ 264 + export type ModelWithNullableString = { 265 + /** 266 + * This is a simple string property 267 + */ 268 + nullableProp1?: string | null; 269 + /** 270 + * This is a simple string property 271 + */ 272 + nullableRequiredProp1: string | null; 273 + /** 274 + * This is a simple string property 275 + */ 276 + nullableProp2?: string | null; 277 + /** 278 + * This is a simple string property 279 + */ 280 + nullableRequiredProp2: string | null; 281 + /** 282 + * This is a simple enum with strings 283 + */ 284 + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; 285 + }; 286 + 287 + /** 288 + * This is a model with one enum 289 + */ 290 + export type ModelWithEnum = { 291 + /** 292 + * This is a simple enum with strings 293 + */ 294 + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; 295 + /** 296 + * These are the HTTP error code enums 297 + */ 298 + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; 299 + /** 300 + * Simple boolean enum 301 + */ 302 + bool?: true; 303 + }; 304 + 305 + /** 306 + * This is a model with one enum with escaped name 307 + */ 308 + export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 312 + 'foo-bar-baz-qux'?: '3.0'; 313 + }; 314 + 315 + /** 316 + * This is a model with one enum 317 + */ 318 + export type ModelWithEnumFromDescription = { 319 + /** 320 + * Success=1,Warning=2,Error=3 321 + */ 322 + test?: number; 323 + }; 324 + 325 + /** 326 + * This is a model with nested enums 327 + */ 328 + export type ModelWithNestedEnums = { 329 + dictionaryWithEnum?: { 330 + [key: string]: 'Success' | 'Warning' | 'Error'; 331 + }; 332 + dictionaryWithEnumFromDescription?: { 333 + [key: string]: number; 334 + }; 335 + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; 336 + arrayWithDescription?: Array<number>; 337 + /** 338 + * This is a simple enum with strings 339 + */ 340 + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; 341 + }; 342 + 343 + /** 344 + * This is a model with one property containing a reference 345 + */ 346 + export type ModelWithReferenceReadable = { 347 + prop?: ModelWithPropertiesReadable; 348 + }; 349 + 350 + /** 351 + * This is a model with one property containing a reference 352 + */ 353 + export type ModelWithReferenceWritable = { 354 + prop?: ModelWithPropertiesWritable; 355 + }; 356 + 357 + /** 358 + * This is a model with one property containing an array 359 + */ 360 + export type ModelWithArrayReadOnlyAndWriteOnlyReadable = { 361 + prop?: Array<ModelWithReadOnlyAndWriteOnlyReadable>; 362 + propWithFile?: Array<Blob | File>; 363 + propWithNumber?: Array<number>; 364 + }; 365 + 366 + /** 367 + * This is a model with one property containing an array 368 + */ 369 + export type ModelWithArrayReadOnlyAndWriteOnlyWritable = { 370 + prop?: Array<ModelWithReadOnlyAndWriteOnlyWritable>; 371 + propWithFile?: Array<Blob | File>; 372 + propWithNumber?: Array<number>; 373 + }; 374 + 375 + /** 376 + * This is a model with one property containing an array 377 + */ 378 + export type ModelWithArray = { 379 + prop?: Array<ModelWithString>; 380 + propWithFile?: Array<Blob | File>; 381 + propWithNumber?: Array<number>; 382 + }; 383 + 384 + /** 385 + * This is a model with one property containing a dictionary 386 + */ 387 + export type ModelWithDictionary = { 388 + prop?: { 389 + [key: string]: string; 390 + }; 391 + }; 392 + 393 + /** 394 + * This is a deprecated model with a deprecated property 395 + * @deprecated 396 + */ 397 + export type DeprecatedModel = { 398 + /** 399 + * This is a deprecated property 400 + * @deprecated 401 + */ 402 + prop?: string; 403 + }; 404 + 405 + /** 406 + * This is a model with one property containing a circular reference 407 + */ 408 + export type ModelWithCircularReference = { 409 + prop?: ModelWithCircularReference; 410 + }; 411 + 412 + /** 413 + * This is a model with one property with a 'one of' relationship 414 + */ 415 + export type CompositionWithOneOf = { 416 + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; 417 + }; 418 + 419 + /** 420 + * This is a model with one property with a 'one of' relationship where the options are not $ref 421 + */ 422 + export type CompositionWithOneOfAnonymous = { 423 + propA?: { 424 + propA?: string; 425 + } | string | number; 426 + }; 427 + 428 + /** 429 + * Circle 430 + */ 431 + export type ModelCircle = { 432 + kind: string; 433 + radius?: number; 434 + }; 435 + 436 + /** 437 + * Square 438 + */ 439 + export type ModelSquare = { 440 + kind: string; 441 + sideLength?: number; 442 + }; 443 + 444 + /** 445 + * This is a model with one property with a 'one of' relationship where the options are not $ref 446 + */ 447 + export type CompositionWithOneOfDiscriminator = ({ 448 + kind: 'circle'; 449 + } & ModelCircle) | ({ 450 + kind: 'square'; 451 + } & ModelSquare); 452 + 453 + /** 454 + * This is a model with one property with a 'any of' relationship 455 + */ 456 + export type CompositionWithAnyOf = { 457 + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; 458 + }; 459 + 460 + /** 461 + * This is a model with one property with a 'any of' relationship where the options are not $ref 462 + */ 463 + export type CompositionWithAnyOfAnonymous = { 464 + propA?: { 465 + propA?: string; 466 + } | string | number; 467 + }; 468 + 469 + /** 470 + * This is a model with nested 'any of' property with a type null 471 + */ 472 + export type CompositionWithNestedAnyAndTypeNull = { 473 + propA?: Array<ModelWithDictionary | null> | Array<ModelWithArray | null>; 474 + }; 475 + 476 + export type _3eNum1Период = 'Bird' | 'Dog'; 477 + 478 + export type ConstValue = 'ConstValue'; 479 + 480 + /** 481 + * This is a model with one property with a 'any of' relationship where the options are not $ref 482 + */ 483 + export type CompositionWithNestedAnyOfAndNull = { 484 + /** 485 + * Scopes 486 + */ 487 + propA?: Array<_3eNum1Период | ConstValue> | null; 488 + }; 489 + 490 + /** 491 + * This is a model with one property with a 'one of' relationship 492 + */ 493 + export type CompositionWithOneOfAndNullable = { 494 + propA?: { 495 + boolean?: boolean; 496 + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; 497 + }; 498 + 499 + /** 500 + * This is a model that contains a simple dictionary within composition 501 + */ 502 + export type CompositionWithOneOfAndSimpleDictionary = { 503 + propA?: boolean | { 504 + [key: string]: number; 505 + }; 506 + }; 507 + 508 + /** 509 + * This is a model that contains a dictionary of simple arrays within composition 510 + */ 511 + export type CompositionWithOneOfAndSimpleArrayDictionary = { 512 + propA?: boolean | { 513 + [key: string]: Array<boolean>; 514 + }; 515 + }; 516 + 517 + /** 518 + * This is a model that contains a dictionary of complex arrays (composited) within composition 519 + */ 520 + export type CompositionWithOneOfAndComplexArrayDictionary = { 521 + propA?: boolean | { 522 + [key: string]: Array<number | string>; 523 + }; 524 + }; 525 + 526 + /** 527 + * This is a model with one property with a 'all of' relationship 528 + */ 529 + export type CompositionWithAllOfAndNullable = { 530 + propA?: ({ 531 + boolean?: boolean; 532 + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; 533 + }; 534 + 535 + /** 536 + * This is a model with one property with a 'any of' relationship 537 + */ 538 + export type CompositionWithAnyOfAndNullable = { 539 + propA?: { 540 + boolean?: boolean; 541 + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; 542 + }; 543 + 544 + /** 545 + * This is a base model with two simple optional properties 546 + */ 547 + export type CompositionBaseModel = { 548 + firstName?: string; 549 + lastname?: string; 550 + }; 551 + 552 + /** 553 + * This is a model that extends the base model 554 + */ 555 + export type CompositionExtendedModel = CompositionBaseModel & { 556 + age: number; 557 + firstName: string; 558 + lastname: string; 559 + }; 560 + 561 + /** 562 + * This is a model with one nested property 563 + */ 564 + export type ModelWithPropertiesReadable = { 565 + required: string; 566 + readonly requiredAndReadOnly: string; 567 + requiredAndNullable: string | null; 568 + string?: string; 569 + number?: number; 570 + boolean?: boolean; 571 + reference?: ModelWithString; 572 + 'property with space'?: string; 573 + default?: string; 574 + try?: string; 575 + readonly '@namespace.string'?: string; 576 + readonly '@namespace.integer'?: number; 577 + }; 578 + 579 + /** 580 + * This is a model with one nested property 581 + */ 582 + export type ModelWithPropertiesWritable = { 583 + required: string; 584 + requiredAndNullable: string | null; 585 + string?: string; 586 + number?: number; 587 + boolean?: boolean; 588 + reference?: ModelWithString; 589 + 'property with space'?: string; 590 + default?: string; 591 + try?: string; 592 + }; 593 + 594 + /** 595 + * This is a model with one nested property 596 + */ 597 + export type ModelWithNestedProperties = { 598 + readonly first: { 599 + readonly second: { 600 + readonly third: string | null; 601 + } | null; 602 + } | null; 603 + }; 604 + 605 + /** 606 + * This is a model with duplicated properties 607 + */ 608 + export type ModelWithDuplicateProperties = { 609 + prop?: ModelWithString; 610 + }; 611 + 612 + /** 613 + * This is a model with ordered properties 614 + */ 615 + export type ModelWithOrderedProperties = { 616 + zebra?: string; 617 + apple?: string; 618 + hawaii?: string; 619 + }; 620 + 621 + /** 622 + * This is a model with duplicated imports 623 + */ 624 + export type ModelWithDuplicateImports = { 625 + propA?: ModelWithString; 626 + propB?: ModelWithString; 627 + propC?: ModelWithString; 628 + }; 629 + 630 + /** 631 + * This is a model that extends another model 632 + */ 633 + export type ModelThatExtends = ModelWithString & { 634 + propExtendsA?: string; 635 + propExtendsB?: ModelWithString; 636 + }; 637 + 638 + /** 639 + * This is a model that extends another model 640 + */ 641 + export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { 642 + propExtendsC?: string; 643 + propExtendsD?: ModelWithString; 644 + }; 645 + 646 + /** 647 + * This is a model that contains a some patterns 648 + */ 649 + export type ModelWithPatternReadable = { 650 + key: string; 651 + name: string; 652 + readonly enabled?: boolean; 653 + readonly modified?: string; 654 + id?: string; 655 + text?: string; 656 + patternWithSingleQuotes?: string; 657 + patternWithNewline?: string; 658 + patternWithBacktick?: string; 659 + }; 660 + 661 + /** 662 + * This is a model that contains a some patterns 663 + */ 664 + export type ModelWithPatternWritable = { 665 + key: string; 666 + name: string; 667 + id?: string; 668 + text?: string; 669 + patternWithSingleQuotes?: string; 670 + patternWithNewline?: string; 671 + patternWithBacktick?: string; 672 + }; 673 + 674 + export type FileReadable = { 675 + /** 676 + * Id 677 + */ 678 + readonly id?: string; 679 + /** 680 + * Updated at 681 + */ 682 + readonly updated_at?: string; 683 + /** 684 + * Created at 685 + */ 686 + readonly created_at?: string; 687 + /** 688 + * Mime 689 + */ 690 + mime: string; 691 + /** 692 + * File 693 + */ 694 + readonly file?: string; 695 + }; 696 + 697 + export type FileWritable = { 698 + /** 699 + * Mime 700 + */ 701 + mime: string; 702 + }; 703 + 704 + export type Default = { 705 + name?: string; 706 + }; 707 + 708 + export type Pageable = { 709 + page?: number; 710 + size?: number; 711 + sort?: Array<string>; 712 + }; 713 + 714 + /** 715 + * This is a free-form object without additionalProperties. 716 + */ 717 + export type FreeFormObjectWithoutAdditionalProperties = { 718 + [key: string]: unknown; 719 + }; 720 + 721 + /** 722 + * This is a free-form object with additionalProperties: true. 723 + */ 724 + export type FreeFormObjectWithAdditionalPropertiesEqTrue = { 725 + [key: string]: unknown; 726 + }; 727 + 728 + /** 729 + * This is a free-form object with additionalProperties: {}. 730 + */ 731 + export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = { 732 + [key: string]: unknown; 733 + }; 734 + 735 + export type ModelWithConst = { 736 + String?: 'String'; 737 + number?: 0; 738 + null?: null; 739 + withType?: 'Some string'; 740 + }; 741 + 742 + /** 743 + * This is a model with one property and additionalProperties: true 744 + */ 745 + export type ModelWithAdditionalPropertiesEqTrue = { 746 + /** 747 + * This is a simple string property 748 + */ 749 + prop?: string; 750 + [key: string]: unknown | string | undefined; 751 + }; 752 + 753 + export type NestedAnyOfArraysNullable = { 754 + nullableArray?: Array<string | boolean> | null; 755 + }; 756 + 757 + export type CompositionWithOneOfAndProperties = ({ 758 + foo: SimpleParameter; 759 + } | { 760 + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; 761 + }) & { 762 + baz: number | null; 763 + qux: number; 764 + }; 765 + 766 + /** 767 + * An object that can be null 768 + */ 769 + export type NullableObject = { 770 + foo?: string; 771 + } | null; 772 + 773 + /** 774 + * Some % character 775 + */ 776 + export type CharactersInDescription = string; 777 + 778 + export type ModelWithNullableObject = { 779 + data?: NullableObject; 780 + }; 781 + 782 + export type ModelWithOneOfEnum = { 783 + foo: 'Bar'; 784 + } | { 785 + foo: 'Baz'; 786 + } | { 787 + foo: 'Qux'; 788 + } | { 789 + content: string; 790 + foo: 'Quux'; 791 + } | { 792 + content: [ 793 + string, 794 + string 795 + ]; 796 + foo: 'Corge'; 797 + }; 798 + 799 + export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; 800 + 801 + export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; 802 + 803 + export type ModelWithNestedArrayEnumsData = { 804 + foo?: Array<ModelWithNestedArrayEnumsDataFoo>; 805 + bar?: Array<ModelWithNestedArrayEnumsDataBar>; 806 + }; 807 + 808 + export type ModelWithNestedArrayEnums = { 809 + array_strings?: Array<string>; 810 + data?: ModelWithNestedArrayEnumsData; 811 + }; 812 + 813 + export type ModelWithNestedCompositionEnums = { 814 + foo?: ModelWithNestedArrayEnumsDataFoo; 815 + }; 816 + 817 + export type ModelWithReadOnlyAndWriteOnlyReadable = { 818 + foo: string; 819 + readonly bar: string; 820 + }; 821 + 822 + export type ModelWithReadOnlyAndWriteOnlyWritable = { 823 + foo: string; 824 + baz: string; 825 + }; 826 + 827 + export type ModelWithConstantSizeArray = [ 828 + number, 829 + number 830 + ]; 831 + 832 + export type ModelWithAnyOfConstantSizeArray = [ 833 + number | string, 834 + number | string, 835 + number | string 836 + ]; 837 + 838 + export type ModelWithPrefixItemsConstantSizeArray = [ 839 + ModelWithInteger, 840 + number | string, 841 + string 842 + ]; 843 + 844 + export type ModelWithAnyOfConstantSizeArrayNullable = [ 845 + number | null | string, 846 + number | null | string, 847 + number | null | string 848 + ]; 849 + 850 + export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ 851 + number | Import, 852 + number | Import 853 + ]; 854 + 855 + export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ 856 + number & string, 857 + number & string 858 + ]; 859 + 860 + export type ModelWithNumericEnumUnion = { 861 + /** 862 + * Период 863 + */ 864 + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; 865 + }; 866 + 867 + /** 868 + * Some description with `back ticks` 869 + */ 870 + export type ModelWithBackticksInDescription = { 871 + /** 872 + * The template `that` should be used for parsing and importing the contents of the CSV file. 873 + * 874 + * <br/><p>There is one placeholder currently supported:<ul> <li><b>${x}</b> - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)</li></ul><p>Example of a correct JSON template:</p> 875 + * <pre> 876 + * [ 877 + * { 878 + * "resourceType": "Asset", 879 + * "identifier": { 880 + * "name": "${1}", 881 + * "domain": { 882 + * "name": "${2}", 883 + * "community": { 884 + * "name": "Some Community" 885 + * } 886 + * } 887 + * }, 888 + * "attributes" : { 889 + * "00000000-0000-0000-0000-000000003115" : [ { 890 + * "value" : "${3}" 891 + * } ], 892 + * "00000000-0000-0000-0000-000000000222" : [ { 893 + * "value" : "${4}" 894 + * } ] 895 + * } 896 + * } 897 + * ] 898 + * </pre> 899 + */ 900 + template?: string; 901 + }; 902 + 903 + export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { 904 + baz: number | null; 905 + qux: number; 906 + }; 907 + 908 + /** 909 + * Model used to test deduplication strategy (unused) 910 + */ 911 + export type ParameterSimpleParameterUnused = string; 912 + 913 + /** 914 + * Model used to test deduplication strategy 915 + */ 916 + export type PostServiceWithEmptyTagResponse = string; 917 + 918 + /** 919 + * Model used to test deduplication strategy 920 + */ 921 + export type PostServiceWithEmptyTagResponse2 = string; 922 + 923 + /** 924 + * Model used to test deduplication strategy 925 + */ 926 + export type DeleteFooData = string; 927 + 928 + /** 929 + * Model used to test deduplication strategy 930 + */ 931 + export type DeleteFooData2 = string; 932 + 933 + /** 934 + * Model with restricted keyword name 935 + */ 936 + export type Import = string; 937 + 938 + export type SchemaWithFormRestrictedKeys = { 939 + description?: string; 940 + 'x-enum-descriptions'?: string; 941 + 'x-enum-varnames'?: string; 942 + 'x-enumNames'?: string; 943 + title?: string; 944 + object?: { 945 + description?: string; 946 + 'x-enum-descriptions'?: string; 947 + 'x-enum-varnames'?: string; 948 + 'x-enumNames'?: string; 949 + title?: string; 950 + }; 951 + array?: Array<{ 952 + description?: string; 953 + 'x-enum-descriptions'?: string; 954 + 'x-enum-varnames'?: string; 955 + 'x-enumNames'?: string; 956 + title?: string; 957 + }>; 958 + }; 959 + 960 + /** 961 + * This schema was giving PascalCase transformations a hard time 962 + */ 963 + export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { 964 + /** 965 + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. 966 + */ 967 + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; 968 + }; 969 + 970 + /** 971 + * This schema was giving PascalCase transformations a hard time 972 + */ 973 + export type IoK8sApimachineryPkgApisMetaV1Preconditions = { 974 + /** 975 + * Specifies the target ResourceVersion 976 + */ 977 + resourceVersion?: string; 978 + /** 979 + * Specifies the target UID. 980 + */ 981 + uid?: string; 982 + }; 983 + 984 + export type AdditionalPropertiesUnknownIssue = { 985 + [key: string]: string | number; 986 + }; 987 + 988 + export type AdditionalPropertiesUnknownIssue2 = { 989 + [key: string]: string | number; 990 + }; 991 + 992 + export type AdditionalPropertiesUnknownIssue3 = string & { 993 + entries: { 994 + [key: string]: AdditionalPropertiesUnknownIssue; 995 + }; 996 + }; 997 + 998 + export type AdditionalPropertiesIntegerIssue = { 999 + value: number; 1000 + [key: string]: number; 1001 + }; 1002 + 1003 + export type OneOfAllOfIssueReadable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanReadable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringReadable; 1004 + 1005 + export type OneOfAllOfIssueWritable = ((ConstValue | GenericSchemaDuplicateIssue1SystemBooleanWritable) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemStringWritable; 1006 + 1007 + export type GenericSchemaDuplicateIssue1SystemBooleanReadable = { 1008 + item?: boolean; 1009 + error?: string | null; 1010 + readonly hasError?: boolean; 1011 + data?: { 1012 + [key: string]: never; 1013 + }; 1014 + }; 1015 + 1016 + export type GenericSchemaDuplicateIssue1SystemBooleanWritable = { 1017 + item?: boolean; 1018 + error?: string | null; 1019 + data?: { 1020 + [key: string]: never; 1021 + }; 1022 + }; 1023 + 1024 + export type GenericSchemaDuplicateIssue1SystemStringReadable = { 1025 + item?: string | null; 1026 + error?: string | null; 1027 + readonly hasError?: boolean; 1028 + }; 1029 + 1030 + export type GenericSchemaDuplicateIssue1SystemStringWritable = { 1031 + item?: string | null; 1032 + error?: string | null; 1033 + }; 1034 + 1035 + /** 1036 + * This is a reusable parameter 1037 + */ 1038 + export type SimpleParameter = string; 1039 + 1040 + /** 1041 + * Parameter with illegal characters 1042 + */ 1043 + export type XFooBar = ModelWithString; 1044 + 1045 + /** 1046 + * A reusable request body 1047 + */ 1048 + export type SimpleRequestBody = ModelWithString; 1049 + 1050 + /** 1051 + * A reusable request body 1052 + */ 1053 + export type SimpleFormData = ModelWithString; 1054 + 1055 + export type ExportData = { 1056 + body?: never; 1057 + path?: never; 1058 + query?: never; 1059 + url: '/api/v{api-version}/no+tag'; 1060 + }; 1061 + 1062 + export type PatchApiVbyApiVersionNoTagData = { 1063 + body?: never; 1064 + path?: never; 1065 + query?: never; 1066 + url: '/api/v{api-version}/no+tag'; 1067 + }; 1068 + 1069 + export type PatchApiVbyApiVersionNoTagResponses = { 1070 + /** 1071 + * OK 1072 + */ 1073 + default: unknown; 1074 + }; 1075 + 1076 + export type ImportData = { 1077 + body: ModelWithReadOnlyAndWriteOnlyWritable | ModelWithArrayReadOnlyAndWriteOnlyWritable; 1078 + path?: never; 1079 + query?: never; 1080 + url: '/api/v{api-version}/no+tag'; 1081 + }; 1082 + 1083 + export type ImportResponses = { 1084 + /** 1085 + * Success 1086 + */ 1087 + 200: ModelFromZendesk; 1088 + /** 1089 + * Default success response 1090 + */ 1091 + default: ModelWithReadOnlyAndWriteOnlyReadable; 1092 + }; 1093 + 1094 + export type ImportResponse = ImportResponses[keyof ImportResponses]; 1095 + 1096 + export type FooWowData = { 1097 + body?: never; 1098 + path?: never; 1099 + query?: never; 1100 + url: '/api/v{api-version}/no+tag'; 1101 + }; 1102 + 1103 + export type FooWowResponses = { 1104 + /** 1105 + * OK 1106 + */ 1107 + default: unknown; 1108 + }; 1109 + 1110 + export type ApiVVersionODataControllerCountData = { 1111 + body?: never; 1112 + path?: never; 1113 + query?: never; 1114 + url: '/api/v{api-version}/simple/$count'; 1115 + }; 1116 + 1117 + export type ApiVVersionODataControllerCountResponses = { 1118 + /** 1119 + * Success 1120 + */ 1121 + 200: ModelFromZendesk; 1122 + }; 1123 + 1124 + export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; 1125 + 1126 + export type GetApiVbyApiVersionSimpleOperationData = { 1127 + body?: never; 1128 + path: { 1129 + /** 1130 + * foo in method 1131 + */ 1132 + foo_param: string; 1133 + }; 1134 + query?: never; 1135 + url: '/api/v{api-version}/simple:operation'; 1136 + }; 1137 + 1138 + export type GetApiVbyApiVersionSimpleOperationErrors = { 1139 + /** 1140 + * Default error response 1141 + */ 1142 + default: ModelWithBoolean; 1143 + }; 1144 + 1145 + export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; 1146 + 1147 + export type GetApiVbyApiVersionSimpleOperationResponses = { 1148 + /** 1149 + * Response is a simple number 1150 + */ 1151 + 200: number; 1152 + }; 1153 + 1154 + export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; 1155 + 1156 + export type DeleteCallWithoutParametersAndResponseData = { 1157 + body?: never; 1158 + path?: never; 1159 + query?: never; 1160 + url: '/api/v{api-version}/simple'; 1161 + }; 1162 + 1163 + export type GetCallWithoutParametersAndResponseData = { 1164 + body?: never; 1165 + path?: never; 1166 + query?: never; 1167 + url: '/api/v{api-version}/simple'; 1168 + }; 1169 + 1170 + export type HeadCallWithoutParametersAndResponseData = { 1171 + body?: never; 1172 + path?: never; 1173 + query?: never; 1174 + url: '/api/v{api-version}/simple'; 1175 + }; 1176 + 1177 + export type OptionsCallWithoutParametersAndResponseData = { 1178 + body?: never; 1179 + path?: never; 1180 + query?: never; 1181 + url: '/api/v{api-version}/simple'; 1182 + }; 1183 + 1184 + export type PatchCallWithoutParametersAndResponseData = { 1185 + body?: never; 1186 + path?: never; 1187 + query?: never; 1188 + url: '/api/v{api-version}/simple'; 1189 + }; 1190 + 1191 + export type PostCallWithoutParametersAndResponseData = { 1192 + body?: never; 1193 + path?: never; 1194 + query?: never; 1195 + url: '/api/v{api-version}/simple'; 1196 + }; 1197 + 1198 + export type PutCallWithoutParametersAndResponseData = { 1199 + body?: never; 1200 + path?: never; 1201 + query?: never; 1202 + url: '/api/v{api-version}/simple'; 1203 + }; 1204 + 1205 + export type DeleteFooData3 = { 1206 + body?: never; 1207 + headers: { 1208 + /** 1209 + * Parameter with illegal characters 1210 + */ 1211 + 'x-Foo-Bar': ModelWithString; 1212 + }; 1213 + path: { 1214 + /** 1215 + * foo in method 1216 + */ 1217 + foo_param: string; 1218 + /** 1219 + * bar in method 1220 + */ 1221 + BarParam: string; 1222 + }; 1223 + query?: never; 1224 + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; 1225 + }; 1226 + 1227 + export type CallWithDescriptionsData = { 1228 + body?: never; 1229 + path?: never; 1230 + query?: { 1231 + /** 1232 + * Testing multiline comments in string: First line 1233 + * Second line 1234 + * 1235 + * Fourth line 1236 + */ 1237 + parameterWithBreaks?: string; 1238 + /** 1239 + * Testing backticks in string: `backticks` and ```multiple backticks``` should work 1240 + */ 1241 + parameterWithBackticks?: string; 1242 + /** 1243 + * Testing slashes in string: \backwards\\\ and /forwards/// should work 1244 + */ 1245 + parameterWithSlashes?: string; 1246 + /** 1247 + * Testing expression placeholders in string: ${expression} should work 1248 + */ 1249 + parameterWithExpressionPlaceholders?: string; 1250 + /** 1251 + * Testing quotes in string: 'single quote''' and "double quotes""" should work 1252 + */ 1253 + parameterWithQuotes?: string; 1254 + /** 1255 + * Testing reserved characters in string: * inline * and ** inline ** should work 1256 + */ 1257 + parameterWithReservedCharacters?: string; 1258 + }; 1259 + url: '/api/v{api-version}/descriptions'; 1260 + }; 1261 + 1262 + export type DeprecatedCallData = { 1263 + body?: never; 1264 + headers: { 1265 + /** 1266 + * This parameter is deprecated 1267 + * @deprecated 1268 + */ 1269 + parameter: DeprecatedModel | null; 1270 + }; 1271 + path?: never; 1272 + query?: never; 1273 + url: '/api/v{api-version}/parameters/deprecated'; 1274 + }; 1275 + 1276 + export type CallWithParametersData = { 1277 + /** 1278 + * This is the parameter that goes into the body 1279 + */ 1280 + body: { 1281 + [key: string]: unknown; 1282 + } | null; 1283 + headers: { 1284 + /** 1285 + * This is the parameter that goes into the header 1286 + */ 1287 + parameterHeader: string | null; 1288 + }; 1289 + path: { 1290 + /** 1291 + * This is the parameter that goes into the path 1292 + */ 1293 + parameterPath: string | null; 1294 + /** 1295 + * api-version should be required in standalone clients 1296 + */ 1297 + 'api-version': string | null; 1298 + }; 1299 + query: { 1300 + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; 1301 + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; 1302 + /** 1303 + * This is the parameter that goes into the query params 1304 + */ 1305 + cursor: string | null; 1306 + }; 1307 + url: '/api/v{api-version}/parameters/{parameterPath}'; 1308 + }; 1309 + 1310 + export type CallWithWeirdParameterNamesData = { 1311 + /** 1312 + * This is the parameter that goes into the body 1313 + */ 1314 + body: ModelWithString | null; 1315 + headers: { 1316 + /** 1317 + * This is the parameter that goes into the request header 1318 + */ 1319 + 'parameter.header': string | null; 1320 + }; 1321 + path: { 1322 + /** 1323 + * This is the parameter that goes into the path 1324 + */ 1325 + 'parameter.path.1'?: string; 1326 + /** 1327 + * This is the parameter that goes into the path 1328 + */ 1329 + 'parameter-path-2'?: string; 1330 + /** 1331 + * This is the parameter that goes into the path 1332 + */ 1333 + 'PARAMETER-PATH-3'?: string; 1334 + /** 1335 + * api-version should be required in standalone clients 1336 + */ 1337 + 'api-version': string | null; 1338 + }; 1339 + query: { 1340 + /** 1341 + * This is the parameter with a reserved keyword 1342 + */ 1343 + default?: string; 1344 + /** 1345 + * This is the parameter that goes into the request query params 1346 + */ 1347 + 'parameter-query': string | null; 1348 + }; 1349 + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; 1350 + }; 1351 + 1352 + export type GetCallWithOptionalParamData = { 1353 + /** 1354 + * This is a required parameter 1355 + */ 1356 + body: ModelWithOneOfEnum; 1357 + path?: never; 1358 + query?: { 1359 + /** 1360 + * This is an optional parameter 1361 + */ 1362 + page?: number; 1363 + }; 1364 + url: '/api/v{api-version}/parameters'; 1365 + }; 1366 + 1367 + export type PostCallWithOptionalParamData = { 1368 + /** 1369 + * This is an optional parameter 1370 + */ 1371 + body?: { 1372 + offset?: number | null; 1373 + }; 1374 + path?: never; 1375 + query: { 1376 + /** 1377 + * This is a required parameter 1378 + */ 1379 + parameter: Pageable; 1380 + }; 1381 + url: '/api/v{api-version}/parameters'; 1382 + }; 1383 + 1384 + export type PostCallWithOptionalParamResponses = { 1385 + /** 1386 + * Response is a simple number 1387 + */ 1388 + 200: number; 1389 + /** 1390 + * Success 1391 + */ 1392 + 204: void; 1393 + }; 1394 + 1395 + export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; 1396 + 1397 + export type PostApiVbyApiVersionRequestBodyData = { 1398 + /** 1399 + * A reusable request body 1400 + */ 1401 + body?: SimpleRequestBody; 1402 + path?: never; 1403 + query?: { 1404 + /** 1405 + * This is a reusable parameter 1406 + */ 1407 + parameter?: string; 1408 + }; 1409 + url: '/api/v{api-version}/requestBody'; 1410 + }; 1411 + 1412 + export type PostApiVbyApiVersionFormDataData = { 1413 + /** 1414 + * A reusable request body 1415 + */ 1416 + body?: SimpleFormData; 1417 + path?: never; 1418 + query?: { 1419 + /** 1420 + * This is a reusable parameter 1421 + */ 1422 + parameter?: string; 1423 + }; 1424 + url: '/api/v{api-version}/formData'; 1425 + }; 1426 + 1427 + export type CallWithDefaultParametersData = { 1428 + body?: never; 1429 + path?: never; 1430 + query?: { 1431 + /** 1432 + * This is a simple string with default value 1433 + */ 1434 + parameterString?: string | null; 1435 + /** 1436 + * This is a simple number with default value 1437 + */ 1438 + parameterNumber?: number | null; 1439 + /** 1440 + * This is a simple boolean with default value 1441 + */ 1442 + parameterBoolean?: boolean | null; 1443 + /** 1444 + * This is a simple enum with default value 1445 + */ 1446 + parameterEnum?: 'Success' | 'Warning' | 'Error'; 1447 + /** 1448 + * This is a simple model with default value 1449 + */ 1450 + parameterModel?: ModelWithString | null; 1451 + }; 1452 + url: '/api/v{api-version}/defaults'; 1453 + }; 1454 + 1455 + export type CallWithDefaultOptionalParametersData = { 1456 + body?: never; 1457 + path?: never; 1458 + query?: { 1459 + /** 1460 + * This is a simple string that is optional with default value 1461 + */ 1462 + parameterString?: string; 1463 + /** 1464 + * This is a simple number that is optional with default value 1465 + */ 1466 + parameterNumber?: number; 1467 + /** 1468 + * This is a simple boolean that is optional with default value 1469 + */ 1470 + parameterBoolean?: boolean; 1471 + /** 1472 + * This is a simple enum that is optional with default value 1473 + */ 1474 + parameterEnum?: 'Success' | 'Warning' | 'Error'; 1475 + /** 1476 + * This is a simple model that is optional with default value 1477 + */ 1478 + parameterModel?: ModelWithString; 1479 + }; 1480 + url: '/api/v{api-version}/defaults'; 1481 + }; 1482 + 1483 + export type CallToTestOrderOfParamsData = { 1484 + body?: never; 1485 + path?: never; 1486 + query: { 1487 + /** 1488 + * This is a optional string with default 1489 + */ 1490 + parameterOptionalStringWithDefault?: string; 1491 + /** 1492 + * This is a optional string with empty default 1493 + */ 1494 + parameterOptionalStringWithEmptyDefault?: string; 1495 + /** 1496 + * This is a optional string with no default 1497 + */ 1498 + parameterOptionalStringWithNoDefault?: string; 1499 + /** 1500 + * This is a string with default 1501 + */ 1502 + parameterStringWithDefault: string; 1503 + /** 1504 + * This is a string with empty default 1505 + */ 1506 + parameterStringWithEmptyDefault: string; 1507 + /** 1508 + * This is a string with no default 1509 + */ 1510 + parameterStringWithNoDefault: string; 1511 + /** 1512 + * This is a string that can be null with no default 1513 + */ 1514 + parameterStringNullableWithNoDefault?: string | null; 1515 + /** 1516 + * This is a string that can be null with default 1517 + */ 1518 + parameterStringNullableWithDefault?: string | null; 1519 + }; 1520 + url: '/api/v{api-version}/defaults'; 1521 + }; 1522 + 1523 + export type DuplicateNameData = { 1524 + body?: never; 1525 + path?: never; 1526 + query?: never; 1527 + url: '/api/v{api-version}/duplicate'; 1528 + }; 1529 + 1530 + export type DuplicateName2Data = { 1531 + body?: never; 1532 + path?: never; 1533 + query?: never; 1534 + url: '/api/v{api-version}/duplicate'; 1535 + }; 1536 + 1537 + export type DuplicateName3Data = { 1538 + body?: never; 1539 + path?: never; 1540 + query?: never; 1541 + url: '/api/v{api-version}/duplicate'; 1542 + }; 1543 + 1544 + export type DuplicateName4Data = { 1545 + body?: never; 1546 + path?: never; 1547 + query?: never; 1548 + url: '/api/v{api-version}/duplicate'; 1549 + }; 1550 + 1551 + export type CallWithNoContentResponseData = { 1552 + body?: never; 1553 + path?: never; 1554 + query?: never; 1555 + url: '/api/v{api-version}/no-content'; 1556 + }; 1557 + 1558 + export type CallWithNoContentResponseResponses = { 1559 + /** 1560 + * Success 1561 + */ 1562 + 204: void; 1563 + }; 1564 + 1565 + export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; 1566 + 1567 + export type CallWithResponseAndNoContentResponseData = { 1568 + body?: never; 1569 + path?: never; 1570 + query?: never; 1571 + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; 1572 + }; 1573 + 1574 + export type CallWithResponseAndNoContentResponseResponses = { 1575 + /** 1576 + * Response is a simple number 1577 + */ 1578 + 200: number; 1579 + /** 1580 + * Success 1581 + */ 1582 + 204: void; 1583 + }; 1584 + 1585 + export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; 1586 + 1587 + export type DummyAData = { 1588 + body?: never; 1589 + path?: never; 1590 + query?: never; 1591 + url: '/api/v{api-version}/multiple-tags/a'; 1592 + }; 1593 + 1594 + export type DummyAResponses = { 1595 + 200: _400; 1596 + }; 1597 + 1598 + export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; 1599 + 1600 + export type DummyBData = { 1601 + body?: never; 1602 + path?: never; 1603 + query?: never; 1604 + url: '/api/v{api-version}/multiple-tags/b'; 1605 + }; 1606 + 1607 + export type DummyBResponses = { 1608 + /** 1609 + * Success 1610 + */ 1611 + 204: void; 1612 + }; 1613 + 1614 + export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; 1615 + 1616 + export type CallWithResponseData = { 1617 + body?: never; 1618 + path?: never; 1619 + query?: never; 1620 + url: '/api/v{api-version}/response'; 1621 + }; 1622 + 1623 + export type CallWithResponseResponses = { 1624 + default: Import; 1625 + }; 1626 + 1627 + export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; 1628 + 1629 + export type CallWithDuplicateResponsesData = { 1630 + body?: never; 1631 + path?: never; 1632 + query?: never; 1633 + url: '/api/v{api-version}/response'; 1634 + }; 1635 + 1636 + export type CallWithDuplicateResponsesErrors = { 1637 + /** 1638 + * Message for 500 error 1639 + */ 1640 + 500: ModelWithStringError; 1641 + /** 1642 + * Message for 501 error 1643 + */ 1644 + 501: ModelWithStringError; 1645 + /** 1646 + * Message for 502 error 1647 + */ 1648 + 502: ModelWithStringError; 1649 + /** 1650 + * Message for 4XX errors 1651 + */ 1652 + '4XX': DictionaryWithArray; 1653 + /** 1654 + * Default error response 1655 + */ 1656 + default: ModelWithBoolean; 1657 + }; 1658 + 1659 + export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; 1660 + 1661 + export type CallWithDuplicateResponsesResponses = { 1662 + /** 1663 + * Message for 200 response 1664 + */ 1665 + 200: ModelWithBoolean & ModelWithInteger; 1666 + /** 1667 + * Message for 201 response 1668 + */ 1669 + 201: ModelWithString; 1670 + /** 1671 + * Message for 202 response 1672 + */ 1673 + 202: ModelWithString; 1674 + }; 1675 + 1676 + export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; 1677 + 1678 + export type CallWithResponsesData = { 1679 + body?: never; 1680 + path?: never; 1681 + query?: never; 1682 + url: '/api/v{api-version}/response'; 1683 + }; 1684 + 1685 + export type CallWithResponsesErrors = { 1686 + /** 1687 + * Message for 500 error 1688 + */ 1689 + 500: ModelWithStringError; 1690 + /** 1691 + * Message for 501 error 1692 + */ 1693 + 501: ModelWithStringError; 1694 + /** 1695 + * Message for 502 error 1696 + */ 1697 + 502: ModelWithStringError; 1698 + /** 1699 + * Message for default response 1700 + */ 1701 + default: ModelWithStringError; 1702 + }; 1703 + 1704 + export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; 1705 + 1706 + export type CallWithResponsesResponses = { 1707 + /** 1708 + * Message for 200 response 1709 + */ 1710 + 200: { 1711 + readonly '@namespace.string'?: string; 1712 + readonly '@namespace.integer'?: number; 1713 + readonly value?: Array<ModelWithString>; 1714 + }; 1715 + /** 1716 + * Message for 201 response 1717 + */ 1718 + 201: ModelThatExtends; 1719 + /** 1720 + * Message for 202 response 1721 + */ 1722 + 202: ModelThatExtendsExtends; 1723 + }; 1724 + 1725 + export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; 1726 + 1727 + export type CollectionFormatData = { 1728 + body?: never; 1729 + path?: never; 1730 + query: { 1731 + /** 1732 + * This is an array parameter that is sent as csv format (comma-separated values) 1733 + */ 1734 + parameterArrayCSV: Array<string> | null; 1735 + /** 1736 + * This is an array parameter that is sent as ssv format (space-separated values) 1737 + */ 1738 + parameterArraySSV: Array<string> | null; 1739 + /** 1740 + * This is an array parameter that is sent as tsv format (tab-separated values) 1741 + */ 1742 + parameterArrayTSV: Array<string> | null; 1743 + /** 1744 + * This is an array parameter that is sent as pipes format (pipe-separated values) 1745 + */ 1746 + parameterArrayPipes: Array<string> | null; 1747 + /** 1748 + * This is an array parameter that is sent as multi format (multiple parameter instances) 1749 + */ 1750 + parameterArrayMulti: Array<string> | null; 1751 + }; 1752 + url: '/api/v{api-version}/collectionFormat'; 1753 + }; 1754 + 1755 + export type TypesData = { 1756 + body?: never; 1757 + path?: { 1758 + /** 1759 + * This is a number parameter 1760 + */ 1761 + id?: number; 1762 + }; 1763 + query: { 1764 + /** 1765 + * This is a number parameter 1766 + */ 1767 + parameterNumber: number; 1768 + /** 1769 + * This is a string parameter 1770 + */ 1771 + parameterString: string | null; 1772 + /** 1773 + * This is a boolean parameter 1774 + */ 1775 + parameterBoolean: boolean | null; 1776 + /** 1777 + * This is an object parameter 1778 + */ 1779 + parameterObject: { 1780 + [key: string]: unknown; 1781 + } | null; 1782 + /** 1783 + * This is an array parameter 1784 + */ 1785 + parameterArray: Array<string> | null; 1786 + /** 1787 + * This is a dictionary parameter 1788 + */ 1789 + parameterDictionary: { 1790 + [key: string]: unknown; 1791 + } | null; 1792 + /** 1793 + * This is an enum parameter 1794 + */ 1795 + parameterEnum: 'Success' | 'Warning' | 'Error' | null; 1796 + }; 1797 + url: '/api/v{api-version}/types'; 1798 + }; 1799 + 1800 + export type TypesResponses = { 1801 + /** 1802 + * Response is a simple number 1803 + */ 1804 + 200: number; 1805 + /** 1806 + * Response is a simple string 1807 + */ 1808 + 201: string; 1809 + /** 1810 + * Response is a simple boolean 1811 + */ 1812 + 202: boolean; 1813 + /** 1814 + * Response is a simple object 1815 + */ 1816 + 203: { 1817 + [key: string]: unknown; 1818 + }; 1819 + }; 1820 + 1821 + export type TypesResponse = TypesResponses[keyof TypesResponses]; 1822 + 1823 + export type UploadFileData = { 1824 + body: Blob | File; 1825 + path: { 1826 + /** 1827 + * api-version should be required in standalone clients 1828 + */ 1829 + 'api-version': string | null; 1830 + }; 1831 + query?: never; 1832 + url: '/api/v{api-version}/upload'; 1833 + }; 1834 + 1835 + export type UploadFileResponses = { 1836 + 200: boolean; 1837 + }; 1838 + 1839 + export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; 1840 + 1841 + export type FileResponseData = { 1842 + body?: never; 1843 + path: { 1844 + id: string; 1845 + /** 1846 + * api-version should be required in standalone clients 1847 + */ 1848 + 'api-version': string; 1849 + }; 1850 + query?: never; 1851 + url: '/api/v{api-version}/file/{id}'; 1852 + }; 1853 + 1854 + export type FileResponseResponses = { 1855 + /** 1856 + * Success 1857 + */ 1858 + 200: Blob | File; 1859 + }; 1860 + 1861 + export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; 1862 + 1863 + export type ComplexTypesData = { 1864 + body?: never; 1865 + path?: never; 1866 + query: { 1867 + /** 1868 + * Parameter containing object 1869 + */ 1870 + parameterObject: { 1871 + first?: { 1872 + second?: { 1873 + third?: string; 1874 + }; 1875 + }; 1876 + }; 1877 + /** 1878 + * Parameter containing reference 1879 + */ 1880 + parameterReference: ModelWithString; 1881 + }; 1882 + url: '/api/v{api-version}/complex'; 1883 + }; 1884 + 1885 + export type ComplexTypesErrors = { 1886 + /** 1887 + * 400 `server` error 1888 + */ 1889 + 400: unknown; 1890 + /** 1891 + * 500 server error 1892 + */ 1893 + 500: unknown; 1894 + }; 1895 + 1896 + export type ComplexTypesResponses = { 1897 + /** 1898 + * Successful response 1899 + */ 1900 + 200: Array<ModelWithString>; 1901 + }; 1902 + 1903 + export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; 1904 + 1905 + export type MultipartResponseData = { 1906 + body?: never; 1907 + path?: never; 1908 + query?: never; 1909 + url: '/api/v{api-version}/multipart'; 1910 + }; 1911 + 1912 + export type MultipartResponseResponses = { 1913 + /** 1914 + * OK 1915 + */ 1916 + 200: { 1917 + file?: Blob | File; 1918 + metadata?: { 1919 + foo?: string; 1920 + bar?: string; 1921 + }; 1922 + }; 1923 + }; 1924 + 1925 + export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; 1926 + 1927 + export type MultipartRequestData = { 1928 + body?: { 1929 + content?: Blob | File; 1930 + data?: ModelWithString | null; 1931 + }; 1932 + path?: never; 1933 + query?: never; 1934 + url: '/api/v{api-version}/multipart'; 1935 + }; 1936 + 1937 + export type ComplexParamsData = { 1938 + body?: { 1939 + name: string | null; 1940 + enabled?: boolean; 1941 + type: 'Monkey' | 'Horse' | 'Bird'; 1942 + listOfModels?: Array<ModelWithString> | null; 1943 + listOfStrings?: Array<string> | null; 1944 + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; 1945 + }; 1946 + path: { 1947 + id: number; 1948 + /** 1949 + * api-version should be required in standalone clients 1950 + */ 1951 + 'api-version': string; 1952 + }; 1953 + query?: never; 1954 + url: '/api/v{api-version}/complex/{id}'; 1955 + }; 1956 + 1957 + export type ComplexParamsResponses = { 1958 + /** 1959 + * Success 1960 + */ 1961 + 200: ModelWithString; 1962 + }; 1963 + 1964 + export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; 1965 + 1966 + export type CallWithResultFromHeaderData = { 1967 + body?: never; 1968 + path?: never; 1969 + query?: never; 1970 + url: '/api/v{api-version}/header'; 1971 + }; 1972 + 1973 + export type CallWithResultFromHeaderErrors = { 1974 + /** 1975 + * 400 server error 1976 + */ 1977 + 400: unknown; 1978 + /** 1979 + * 500 server error 1980 + */ 1981 + 500: unknown; 1982 + }; 1983 + 1984 + export type CallWithResultFromHeaderResponses = { 1985 + /** 1986 + * Successful response 1987 + */ 1988 + 200: unknown; 1989 + }; 1990 + 1991 + export type TestErrorCodeData = { 1992 + body?: never; 1993 + path?: never; 1994 + query: { 1995 + /** 1996 + * Status code to return 1997 + */ 1998 + status: number; 1999 + }; 2000 + url: '/api/v{api-version}/error'; 2001 + }; 2002 + 2003 + export type TestErrorCodeErrors = { 2004 + /** 2005 + * Custom message: Internal Server Error 2006 + */ 2007 + 500: unknown; 2008 + /** 2009 + * Custom message: Not Implemented 2010 + */ 2011 + 501: unknown; 2012 + /** 2013 + * Custom message: Bad Gateway 2014 + */ 2015 + 502: unknown; 2016 + /** 2017 + * Custom message: Service Unavailable 2018 + */ 2019 + 503: unknown; 2020 + }; 2021 + 2022 + export type TestErrorCodeResponses = { 2023 + /** 2024 + * Custom message: Successful response 2025 + */ 2026 + 200: unknown; 2027 + }; 2028 + 2029 + export type NonAsciiæøåÆøÅöôêÊ字符串Data = { 2030 + body?: never; 2031 + path?: never; 2032 + query: { 2033 + /** 2034 + * Dummy input param 2035 + */ 2036 + nonAsciiParamæøåÆØÅöôêÊ: number; 2037 + }; 2038 + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; 2039 + }; 2040 + 2041 + export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { 2042 + /** 2043 + * Successful response 2044 + */ 2045 + 200: Array<NonAsciiStringæøåÆøÅöôêÊ字符串>; 2046 + }; 2047 + 2048 + export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; 2049 + 2050 + export type PutWithFormUrlEncodedData = { 2051 + body: ArrayWithStrings; 2052 + path?: never; 2053 + query?: never; 2054 + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; 2055 + }; 2056 + 2057 + export type ClientOptions = { 2058 + baseUrl: 'http://localhost:3000/base' | (string & {}); 2059 + };
-23
packages/openapi-ts-tests/test/__snapshots__/3.1.x/plugins/@tanstack/angular-query-experimental/asClass/sdk.gen.ts
··· 57 57 ...options 58 58 }); 59 59 } 60 - 61 60 } 62 61 63 62 export class SimpleService { ··· 116 115 ...options 117 116 }); 118 117 } 119 - 120 118 } 121 119 122 120 export class ParametersService { ··· 170 168 } 171 169 }); 172 170 } 173 - 174 171 } 175 172 176 173 export class DescriptionsService { ··· 180 177 ...options 181 178 }); 182 179 } 183 - 184 180 } 185 181 186 182 export class DeprecatedService { ··· 193 189 ...options 194 190 }); 195 191 } 196 - 197 192 } 198 193 199 194 export class RequestBodyService { ··· 207 202 } 208 203 }); 209 204 } 210 - 211 205 } 212 206 213 207 export class FormDataService { ··· 222 216 } 223 217 }); 224 218 } 225 - 226 219 } 227 220 228 221 export class DefaultsService { ··· 246 239 ...options 247 240 }); 248 241 } 249 - 250 242 } 251 243 252 244 export class DuplicateService { ··· 277 269 ...options 278 270 }); 279 271 } 280 - 281 272 } 282 273 283 274 export class NoContentService { ··· 294 285 ...options 295 286 }); 296 287 } 297 - 298 288 } 299 289 300 290 export class ResponseService { ··· 325 315 ...options 326 316 }); 327 317 } 328 - 329 318 } 330 319 331 320 export class MultipleTags1Service { ··· 342 331 ...options 343 332 }); 344 333 } 345 - 346 334 } 347 335 348 336 export class MultipleTags2Service { ··· 359 347 ...options 360 348 }); 361 349 } 362 - 363 350 } 364 351 365 352 export class MultipleTags3Service { ··· 369 356 ...options 370 357 }); 371 358 } 372 - 373 359 } 374 360 375 361 export class CollectionFormatService { ··· 379 365 ...options 380 366 }); 381 367 } 382 - 383 368 } 384 369 385 370 export class TypesService { ··· 389 374 ...options 390 375 }); 391 376 } 392 - 393 377 } 394 378 395 379 export class UploadService { ··· 404 388 } 405 389 }); 406 390 } 407 - 408 391 } 409 392 410 393 export class FileResponseService { ··· 414 397 ...options 415 398 }); 416 399 } 417 - 418 400 } 419 401 420 402 export class ComplexService { ··· 435 417 } 436 418 }); 437 419 } 438 - 439 420 } 440 421 441 422 export class MultipartService { ··· 457 438 } 458 439 }); 459 440 } 460 - 461 441 } 462 442 463 443 export class HeaderService { ··· 467 447 ...options 468 448 }); 469 449 } 470 - 471 450 } 472 451 473 452 export class ErrorService { ··· 477 456 ...options 478 457 }); 479 458 } 480 - 481 459 } 482 460 483 461 export class NonAsciiÆøåÆøÅöôêÊService { ··· 502 480 } 503 481 }); 504 482 } 505 - 506 483 }
-23
packages/openapi-ts-tests/test/__snapshots__/3.1.x/plugins/@tanstack/react-query/asClass/sdk.gen.ts
··· 57 57 ...options 58 58 }); 59 59 } 60 - 61 60 } 62 61 63 62 export class SimpleService { ··· 116 115 ...options 117 116 }); 118 117 } 119 - 120 118 } 121 119 122 120 export class ParametersService { ··· 170 168 } 171 169 }); 172 170 } 173 - 174 171 } 175 172 176 173 export class DescriptionsService { ··· 180 177 ...options 181 178 }); 182 179 } 183 - 184 180 } 185 181 186 182 export class DeprecatedService { ··· 193 189 ...options 194 190 }); 195 191 } 196 - 197 192 } 198 193 199 194 export class RequestBodyService { ··· 207 202 } 208 203 }); 209 204 } 210 - 211 205 } 212 206 213 207 export class FormDataService { ··· 222 216 } 223 217 }); 224 218 } 225 - 226 219 } 227 220 228 221 export class DefaultsService { ··· 246 239 ...options 247 240 }); 248 241 } 249 - 250 242 } 251 243 252 244 export class DuplicateService { ··· 277 269 ...options 278 270 }); 279 271 } 280 - 281 272 } 282 273 283 274 export class NoContentService { ··· 294 285 ...options 295 286 }); 296 287 } 297 - 298 288 } 299 289 300 290 export class ResponseService { ··· 325 315 ...options 326 316 }); 327 317 } 328 - 329 318 } 330 319 331 320 export class MultipleTags1Service { ··· 342 331 ...options 343 332 }); 344 333 } 345 - 346 334 } 347 335 348 336 export class MultipleTags2Service { ··· 359 347 ...options 360 348 }); 361 349 } 362 - 363 350 } 364 351 365 352 export class MultipleTags3Service { ··· 369 356 ...options 370 357 }); 371 358 } 372 - 373 359 } 374 360 375 361 export class CollectionFormatService { ··· 379 365 ...options 380 366 }); 381 367 } 382 - 383 368 } 384 369 385 370 export class TypesService { ··· 389 374 ...options 390 375 }); 391 376 } 392 - 393 377 } 394 378 395 379 export class UploadService { ··· 404 388 } 405 389 }); 406 390 } 407 - 408 391 } 409 392 410 393 export class FileResponseService { ··· 414 397 ...options 415 398 }); 416 399 } 417 - 418 400 } 419 401 420 402 export class ComplexService { ··· 435 417 } 436 418 }); 437 419 } 438 - 439 420 } 440 421 441 422 export class MultipartService { ··· 457 438 } 458 439 }); 459 440 } 460 - 461 441 } 462 442 463 443 export class HeaderService { ··· 467 447 ...options 468 448 }); 469 449 } 470 - 471 450 } 472 451 473 452 export class ErrorService { ··· 477 456 ...options 478 457 }); 479 458 } 480 - 481 459 } 482 460 483 461 export class NonAsciiÆøåÆøÅöôêÊService { ··· 502 480 } 503 481 }); 504 482 } 505 - 506 483 }
-23
packages/openapi-ts-tests/test/__snapshots__/3.1.x/plugins/@tanstack/solid-query/asClass/sdk.gen.ts
··· 57 57 ...options 58 58 }); 59 59 } 60 - 61 60 } 62 61 63 62 export class SimpleService { ··· 116 115 ...options 117 116 }); 118 117 } 119 - 120 118 } 121 119 122 120 export class ParametersService { ··· 170 168 } 171 169 }); 172 170 } 173 - 174 171 } 175 172 176 173 export class DescriptionsService { ··· 180 177 ...options 181 178 }); 182 179 } 183 - 184 180 } 185 181 186 182 export class DeprecatedService { ··· 193 189 ...options 194 190 }); 195 191 } 196 - 197 192 } 198 193 199 194 export class RequestBodyService { ··· 207 202 } 208 203 }); 209 204 } 210 - 211 205 } 212 206 213 207 export class FormDataService { ··· 222 216 } 223 217 }); 224 218 } 225 - 226 219 } 227 220 228 221 export class DefaultsService { ··· 246 239 ...options 247 240 }); 248 241 } 249 - 250 242 } 251 243 252 244 export class DuplicateService { ··· 277 269 ...options 278 270 }); 279 271 } 280 - 281 272 } 282 273 283 274 export class NoContentService { ··· 294 285 ...options 295 286 }); 296 287 } 297 - 298 288 } 299 289 300 290 export class ResponseService { ··· 325 315 ...options 326 316 }); 327 317 } 328 - 329 318 } 330 319 331 320 export class MultipleTags1Service { ··· 342 331 ...options 343 332 }); 344 333 } 345 - 346 334 } 347 335 348 336 export class MultipleTags2Service { ··· 359 347 ...options 360 348 }); 361 349 } 362 - 363 350 } 364 351 365 352 export class MultipleTags3Service { ··· 369 356 ...options 370 357 }); 371 358 } 372 - 373 359 } 374 360 375 361 export class CollectionFormatService { ··· 379 365 ...options 380 366 }); 381 367 } 382 - 383 368 } 384 369 385 370 export class TypesService { ··· 389 374 ...options 390 375 }); 391 376 } 392 - 393 377 } 394 378 395 379 export class UploadService { ··· 404 388 } 405 389 }); 406 390 } 407 - 408 391 } 409 392 410 393 export class FileResponseService { ··· 414 397 ...options 415 398 }); 416 399 } 417 - 418 400 } 419 401 420 402 export class ComplexService { ··· 435 417 } 436 418 }); 437 419 } 438 - 439 420 } 440 421 441 422 export class MultipartService { ··· 457 438 } 458 439 }); 459 440 } 460 - 461 441 } 462 442 463 443 export class HeaderService { ··· 467 447 ...options 468 448 }); 469 449 } 470 - 471 450 } 472 451 473 452 export class ErrorService { ··· 477 456 ...options 478 457 }); 479 458 } 480 - 481 459 } 482 460 483 461 export class NonAsciiÆøåÆøÅöôêÊService { ··· 502 480 } 503 481 }); 504 482 } 505 - 506 483 }
-23
packages/openapi-ts-tests/test/__snapshots__/3.1.x/plugins/@tanstack/svelte-query/asClass/sdk.gen.ts
··· 57 57 ...options 58 58 }); 59 59 } 60 - 61 60 } 62 61 63 62 export class SimpleService { ··· 116 115 ...options 117 116 }); 118 117 } 119 - 120 118 } 121 119 122 120 export class ParametersService { ··· 170 168 } 171 169 }); 172 170 } 173 - 174 171 } 175 172 176 173 export class DescriptionsService { ··· 180 177 ...options 181 178 }); 182 179 } 183 - 184 180 } 185 181 186 182 export class DeprecatedService { ··· 193 189 ...options 194 190 }); 195 191 } 196 - 197 192 } 198 193 199 194 export class RequestBodyService { ··· 207 202 } 208 203 }); 209 204 } 210 - 211 205 } 212 206 213 207 export class FormDataService { ··· 222 216 } 223 217 }); 224 218 } 225 - 226 219 } 227 220 228 221 export class DefaultsService { ··· 246 239 ...options 247 240 }); 248 241 } 249 - 250 242 } 251 243 252 244 export class DuplicateService { ··· 277 269 ...options 278 270 }); 279 271 } 280 - 281 272 } 282 273 283 274 export class NoContentService { ··· 294 285 ...options 295 286 }); 296 287 } 297 - 298 288 } 299 289 300 290 export class ResponseService { ··· 325 315 ...options 326 316 }); 327 317 } 328 - 329 318 } 330 319 331 320 export class MultipleTags1Service { ··· 342 331 ...options 343 332 }); 344 333 } 345 - 346 334 } 347 335 348 336 export class MultipleTags2Service { ··· 359 347 ...options 360 348 }); 361 349 } 362 - 363 350 } 364 351 365 352 export class MultipleTags3Service { ··· 369 356 ...options 370 357 }); 371 358 } 372 - 373 359 } 374 360 375 361 export class CollectionFormatService { ··· 379 365 ...options 380 366 }); 381 367 } 382 - 383 368 } 384 369 385 370 export class TypesService { ··· 389 374 ...options 390 375 }); 391 376 } 392 - 393 377 } 394 378 395 379 export class UploadService { ··· 404 388 } 405 389 }); 406 390 } 407 - 408 391 } 409 392 410 393 export class FileResponseService { ··· 414 397 ...options 415 398 }); 416 399 } 417 - 418 400 } 419 401 420 402 export class ComplexService { ··· 435 417 } 436 418 }); 437 419 } 438 - 439 420 } 440 421 441 422 export class MultipartService { ··· 457 438 } 458 439 }); 459 440 } 460 - 461 441 } 462 442 463 443 export class HeaderService { ··· 467 447 ...options 468 448 }); 469 449 } 470 - 471 450 } 472 451 473 452 export class ErrorService { ··· 477 456 ...options 478 457 }); 479 458 } 480 - 481 459 } 482 460 483 461 export class NonAsciiÆøåÆøÅöôêÊService { ··· 502 480 } 503 481 }); 504 482 } 505 - 506 483 }
-23
packages/openapi-ts-tests/test/__snapshots__/3.1.x/plugins/@tanstack/vue-query/asClass/sdk.gen.ts
··· 57 57 ...options 58 58 }); 59 59 } 60 - 61 60 } 62 61 63 62 export class SimpleService { ··· 116 115 ...options 117 116 }); 118 117 } 119 - 120 118 } 121 119 122 120 export class ParametersService { ··· 170 168 } 171 169 }); 172 170 } 173 - 174 171 } 175 172 176 173 export class DescriptionsService { ··· 180 177 ...options 181 178 }); 182 179 } 183 - 184 180 } 185 181 186 182 export class DeprecatedService { ··· 193 189 ...options 194 190 }); 195 191 } 196 - 197 192 } 198 193 199 194 export class RequestBodyService { ··· 207 202 } 208 203 }); 209 204 } 210 - 211 205 } 212 206 213 207 export class FormDataService { ··· 222 216 } 223 217 }); 224 218 } 225 - 226 219 } 227 220 228 221 export class DefaultsService { ··· 246 239 ...options 247 240 }); 248 241 } 249 - 250 242 } 251 243 252 244 export class DuplicateService { ··· 277 269 ...options 278 270 }); 279 271 } 280 - 281 272 } 282 273 283 274 export class NoContentService { ··· 294 285 ...options 295 286 }); 296 287 } 297 - 298 288 } 299 289 300 290 export class ResponseService { ··· 325 315 ...options 326 316 }); 327 317 } 328 - 329 318 } 330 319 331 320 export class MultipleTags1Service { ··· 342 331 ...options 343 332 }); 344 333 } 345 - 346 334 } 347 335 348 336 export class MultipleTags2Service { ··· 359 347 ...options 360 348 }); 361 349 } 362 - 363 350 } 364 351 365 352 export class MultipleTags3Service { ··· 369 356 ...options 370 357 }); 371 358 } 372 - 373 359 } 374 360 375 361 export class CollectionFormatService { ··· 379 365 ...options 380 366 }); 381 367 } 382 - 383 368 } 384 369 385 370 export class TypesService { ··· 389 374 ...options 390 375 }); 391 376 } 392 - 393 377 } 394 378 395 379 export class UploadService { ··· 404 388 } 405 389 }); 406 390 } 407 - 408 391 } 409 392 410 393 export class FileResponseService { ··· 414 397 ...options 415 398 }); 416 399 } 417 - 418 400 } 419 401 420 402 export class ComplexService { ··· 435 417 } 436 418 }); 437 419 } 438 - 439 420 } 440 421 441 422 export class MultipartService { ··· 457 438 } 458 439 }); 459 440 } 460 - 461 441 } 462 442 463 443 export class HeaderService { ··· 467 447 ...options 468 448 }); 469 449 } 470 - 471 450 } 472 451 473 452 export class ErrorService { ··· 477 456 ...options 478 457 }); 479 458 } 480 - 481 459 } 482 460 483 461 export class NonAsciiÆøåÆøÅöôêÊService { ··· 502 480 } 503 481 }); 504 482 } 505 - 506 483 }
+17 -34
packages/openapi-ts-tests/test/__snapshots__/test/generated/v2/sdk.gen.ts.snap
··· 5 5 import { request as __request } from './core/request'; 6 6 import type { CollectionFormatData, ComplexTypesData, ComplexTypesResponse, PatchApiNoTagResponse, FooWowResponse, PostApiBodyData, PostApiBodyResponse, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, CallWithDescriptionsData, TestErrorCodeData, TestErrorCodeResponse, CallWithResultFromHeaderResponse, DummyAResponse, DummyBResponse, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseResponse, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithResponseResponse, CallWithDuplicateResponsesResponse, CallWithResponsesResponse, TypesData, TypesResponse } from './types.gen'; 7 7 8 - export class CollectionFormatService { 8 + export class CollectionFormat { 9 9 /** 10 10 * @param data The data for the request. 11 11 * @param data.parameterArrayCsv This is an array parameter that is sent as csv format (comma-separated values) ··· 28 28 } 29 29 }); 30 30 } 31 - 32 31 } 33 32 34 - export class ComplexService { 33 + export class Complex { 35 34 /** 36 35 * @param data The data for the request. 37 36 * @param data.parameterObject Parameter containing object ··· 53 52 } 54 53 }); 55 54 } 56 - 57 55 } 58 56 59 - export class DefaultService { 57 + export class Default { 60 58 /** 61 59 * @throws ApiError 62 60 */ ··· 108 106 } 109 107 }); 110 108 } 111 - 112 109 } 113 110 114 - export class DefaultsService { 111 + export class Defaults { 115 112 /** 116 113 * @param data The data for the request. 117 114 * @param data.parameterString This is a simple string with default value ··· 186 183 } 187 184 }); 188 185 } 189 - 190 186 } 191 187 192 - export class DescriptionsService { 188 + export class Descriptions { 193 189 /** 194 190 * @param data The data for the request. 195 191 * @param data.parameterWithBreaks Testing multiline comments in string: First line ··· 217 213 } 218 214 }); 219 215 } 220 - 221 216 } 222 217 223 - export class DuplicateService { 218 + export class Duplicate { 224 219 /** 225 220 * @throws ApiError 226 221 */ ··· 260 255 url: '/api/v{api-version}/duplicate' 261 256 }); 262 257 } 263 - 264 258 } 265 259 266 - export class ErrorService { 260 + export class Error { 267 261 /** 268 262 * @param data The data for the request. 269 263 * @param data.status Status code to return ··· 285 279 } 286 280 }); 287 281 } 288 - 289 282 } 290 283 291 - export class HeaderService { 284 + export class Header { 292 285 /** 293 286 * @returns string Successful response 294 287 * @throws ApiError ··· 304 297 } 305 298 }); 306 299 } 307 - 308 300 } 309 301 310 - export class MultipleTags1Service { 302 + export class MultipleTags1 { 311 303 /** 312 304 * @returns void Success 313 305 * @throws ApiError ··· 329 321 url: '/api/v{api-version}/multiple-tags/b' 330 322 }); 331 323 } 332 - 333 324 } 334 325 335 - export class MultipleTags2Service { 326 + export class MultipleTags2 { 336 327 /** 337 328 * @returns void Success 338 329 * @throws ApiError ··· 354 345 url: '/api/v{api-version}/multiple-tags/b' 355 346 }); 356 347 } 357 - 358 348 } 359 349 360 - export class MultipleTags3Service { 350 + export class MultipleTags3 { 361 351 /** 362 352 * @returns void Success 363 353 * @throws ApiError ··· 368 358 url: '/api/v{api-version}/multiple-tags/b' 369 359 }); 370 360 } 371 - 372 361 } 373 362 374 - export class NoContentService { 363 + export class NoContent { 375 364 /** 376 365 * @returns void Success 377 366 * @throws ApiError ··· 394 383 url: '/api/v{api-version}/multiple-tags/response-and-no-content' 395 384 }); 396 385 } 397 - 398 386 } 399 387 400 - export class NonAsciiÆøåÆøÅöôêÊService { 388 + export class NonAsciiÆøåÆøÅöôêÊ { 401 389 /** 402 390 * @param data The data for the request. 403 391 * @param data.nonAsciiParamæøåÆøÅöôêÊ Dummy input param ··· 413 401 } 414 402 }); 415 403 } 416 - 417 404 } 418 405 419 - export class ParametersService { 406 + export class Parameters { 420 407 /** 421 408 * @param data The data for the request. 422 409 * @param data.parameterHeader This is the parameter that goes into the header ··· 480 467 body: data.parameterBody 481 468 }); 482 469 } 483 - 484 470 } 485 471 486 - export class ResponseService { 472 + export class Response { 487 473 /** 488 474 * @returns unknown Response is a simple number 489 475 * @returns void Success ··· 543 529 } 544 530 }); 545 531 } 546 - 547 532 } 548 533 549 - export class SimpleService { 534 + export class Simple { 550 535 /** 551 536 * @throws ApiError 552 537 */ ··· 616 601 url: '/api/v{api-version}/simple' 617 602 }); 618 603 } 619 - 620 604 } 621 605 622 - export class TypesService { 606 + export class Types { 623 607 /** 624 608 * @param data The data for the request. 625 609 * @param data.parameterArray This is an array parameter ··· 654 638 } 655 639 }); 656 640 } 657 - 658 641 }
+23 -46
packages/openapi-ts-tests/test/__snapshots__/test/generated/v3/sdk.gen.ts.snap
··· 5 5 import { request as __request } from './core/request'; 6 6 import type { CollectionFormatData, ComplexTypesData, ComplexTypesResponse, ComplexParamsData, ComplexParamsResponse, PatchApiNoTagResponse, ImportData, ImportResponse, FooWowResponse, GetApiSimpleOperationData, GetApiSimpleOperationResponse, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DeprecatedCallData, CallWithDescriptionsData, TestErrorCodeData, TestErrorCodeResponse, FileResponseData, FileResponseResponse, PostApiFormDataData, CallWithResultFromHeaderResponse, MultipartRequestData, MultipartResponseResponse, DummyAResponse, DummyBResponse, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseResponse, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData, DeleteFooData3, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiRequestBodyData, CallWithResponseResponse, CallWithDuplicateResponsesResponse, CallWithResponsesResponse, ApiVVersionODataControllerCountResponse, TypesData, TypesResponse, UploadFileData, UploadFileResponse } from './types.gen'; 7 7 8 - export class CollectionFormatService { 8 + export class CollectionFormat { 9 9 /** 10 10 * @param data The data for the request. 11 11 * @param data.parameterArrayCsv This is an array parameter that is sent as csv format (comma-separated values) ··· 28 28 } 29 29 }); 30 30 } 31 - 32 31 } 33 32 34 - export class ComplexService { 33 + export class Complex { 35 34 /** 36 35 * @param data The data for the request. 37 36 * @param data.parameterObject Parameter containing object ··· 72 71 mediaType: 'application/json-patch+json' 73 72 }); 74 73 } 75 - 76 74 } 77 75 78 - export class DefaultService { 76 + export class Default { 79 77 /** 80 78 * @throws ApiError 81 79 */ ··· 142 140 } 143 141 }); 144 142 } 145 - 146 143 } 147 144 148 - export class DefaultsService { 145 + export class Defaults { 149 146 /** 150 147 * @param data The data for the request. 151 148 * @param data.parameterString This is a simple string with default value ··· 220 217 } 221 218 }); 222 219 } 223 - 224 220 } 225 221 226 - export class DeprecatedService { 222 + export class Deprecated { 227 223 /** 228 224 * @deprecated 229 225 * @param data The data for the request. ··· 239 235 } 240 236 }); 241 237 } 242 - 243 238 } 244 239 245 - export class DescriptionsService { 240 + export class Descriptions { 246 241 /** 247 242 * @param data The data for the request. 248 243 * @param data.parameterWithBreaks Testing multiline comments in string: First line ··· 270 265 } 271 266 }); 272 267 } 273 - 274 268 } 275 269 276 - export class DuplicateService { 270 + export class Duplicate { 277 271 /** 278 272 * @throws ApiError 279 273 */ ··· 313 307 url: '/api/v{api-version}/duplicate' 314 308 }); 315 309 } 316 - 317 310 } 318 311 319 - export class ErrorService { 312 + export class Error { 320 313 /** 321 314 * @param data The data for the request. 322 315 * @param data.status Status code to return ··· 338 331 } 339 332 }); 340 333 } 341 - 342 334 } 343 335 344 - export class FileResponseService { 336 + export class FileResponse { 345 337 /** 346 338 * @param data The data for the request. 347 339 * @param data.id ··· 357 349 } 358 350 }); 359 351 } 360 - 361 352 } 362 353 363 - export class FormDataService { 354 + export class FormData { 364 355 /** 365 356 * @param data The data for the request. 366 357 * @param data.parameter This is a reusable parameter ··· 378 369 mediaType: 'multipart/form-data' 379 370 }); 380 371 } 381 - 382 372 } 383 373 384 - export class HeaderService { 374 + export class Header { 385 375 /** 386 376 * @returns string Successful response 387 377 * @throws ApiError ··· 397 387 } 398 388 }); 399 389 } 400 - 401 390 } 402 391 403 - export class MultipartService { 392 + export class Multipart { 404 393 /** 405 394 * @param data The data for the request. 406 395 * @param data.formData ··· 425 414 url: '/api/v{api-version}/multipart' 426 415 }); 427 416 } 428 - 429 417 } 430 418 431 - export class MultipleTags1Service { 419 + export class MultipleTags1 { 432 420 /** 433 421 * @returns _400 434 422 * @throws ApiError ··· 450 438 url: '/api/v{api-version}/multiple-tags/b' 451 439 }); 452 440 } 453 - 454 441 } 455 442 456 - export class MultipleTags2Service { 443 + export class MultipleTags2 { 457 444 /** 458 445 * @returns _400 459 446 * @throws ApiError ··· 475 462 url: '/api/v{api-version}/multiple-tags/b' 476 463 }); 477 464 } 478 - 479 465 } 480 466 481 - export class MultipleTags3Service { 467 + export class MultipleTags3 { 482 468 /** 483 469 * @returns void Success 484 470 * @throws ApiError ··· 489 475 url: '/api/v{api-version}/multiple-tags/b' 490 476 }); 491 477 } 492 - 493 478 } 494 479 495 - export class NoContentService { 480 + export class NoContent { 496 481 /** 497 482 * @returns void Success 498 483 * @throws ApiError ··· 515 500 url: '/api/v{api-version}/multiple-tags/response-and-no-content' 516 501 }); 517 502 } 518 - 519 503 } 520 504 521 - export class NonAsciiÆøåÆøÅöôêÊService { 505 + export class NonAsciiÆøåÆøÅöôêÊ { 522 506 /** 523 507 * @param data The data for the request. 524 508 * @param data.nonAsciiParamæøåÆøÅöôêÊ Dummy input param ··· 549 533 mediaType: 'application/x-www-form-urlencoded' 550 534 }); 551 535 } 552 - 553 536 } 554 537 555 - export class ParametersService { 538 + export class Parameters { 556 539 /** 557 540 * @param data The data for the request. 558 541 * @param data.fooParam foo in method ··· 681 664 mediaType: 'application/json' 682 665 }); 683 666 } 684 - 685 667 } 686 668 687 - export class RequestBodyService { 669 + export class RequestBody { 688 670 /** 689 671 * @param data The data for the request. 690 672 * @param data.parameter This is a reusable parameter ··· 702 684 mediaType: 'application/json' 703 685 }); 704 686 } 705 - 706 687 } 707 688 708 - export class ResponseService { 689 + export class Response { 709 690 /** 710 691 * @returns number Response is a simple number 711 692 * @returns void Success ··· 767 748 } 768 749 }); 769 750 } 770 - 771 751 } 772 752 773 - export class SimpleService { 753 + export class Simple { 774 754 /** 775 755 * @returns Model_From_Zendesk Success 776 756 * @throws ApiError ··· 851 831 url: '/api/v{api-version}/simple' 852 832 }); 853 833 } 854 - 855 834 } 856 835 857 - export class TypesService { 836 + export class Types { 858 837 /** 859 838 * @param data The data for the request. 860 839 * @param data.parameterArray This is an array parameter ··· 891 870 } 892 871 }); 893 872 } 894 - 895 873 } 896 874 897 - export class UploadService { 875 + export class Upload { 898 876 /** 899 877 * @param data The data for the request. 900 878 * @param data.formData ··· 909 887 mediaType: 'application/x-www-form-urlencoded' 910 888 }); 911 889 } 912 - 913 890 }
+23 -46
packages/openapi-ts-tests/test/__snapshots__/test/generated/v3_angular/sdk.gen.ts.snap
··· 10 10 @Injectable({ 11 11 providedIn: 'root' 12 12 }) 13 - export class CollectionFormatService { 13 + export class CollectionFormat { 14 14 constructor(public readonly http: HttpClient) { } 15 15 16 16 /** ··· 35 35 } 36 36 }); 37 37 } 38 - 39 38 } 40 39 41 40 @Injectable({ 42 41 providedIn: 'root' 43 42 }) 44 - export class ComplexService { 43 + export class Complex { 45 44 constructor(public readonly http: HttpClient) { } 46 45 47 46 /** ··· 84 83 mediaType: 'application/json-patch+json' 85 84 }); 86 85 } 87 - 88 86 } 89 87 90 88 @Injectable({ 91 89 providedIn: 'root' 92 90 }) 93 - export class DefaultService { 91 + export class Default { 94 92 constructor(public readonly http: HttpClient) { } 95 93 96 94 /** ··· 159 157 } 160 158 }); 161 159 } 162 - 163 160 } 164 161 165 162 @Injectable({ 166 163 providedIn: 'root' 167 164 }) 168 - export class DefaultsService { 165 + export class Defaults { 169 166 constructor(public readonly http: HttpClient) { } 170 167 171 168 /** ··· 242 239 } 243 240 }); 244 241 } 245 - 246 242 } 247 243 248 244 @Injectable({ 249 245 providedIn: 'root' 250 246 }) 251 - export class DeprecatedService { 247 + export class Deprecated { 252 248 constructor(public readonly http: HttpClient) { } 253 249 254 250 /** ··· 266 262 } 267 263 }); 268 264 } 269 - 270 265 } 271 266 272 267 @Injectable({ 273 268 providedIn: 'root' 274 269 }) 275 - export class DescriptionsService { 270 + export class Descriptions { 276 271 constructor(public readonly http: HttpClient) { } 277 272 278 273 /** ··· 302 297 } 303 298 }); 304 299 } 305 - 306 300 } 307 301 308 302 @Injectable({ 309 303 providedIn: 'root' 310 304 }) 311 - export class DuplicateService { 305 + export class Duplicate { 312 306 constructor(public readonly http: HttpClient) { } 313 307 314 308 /** ··· 350 344 url: '/api/v{api-version}/duplicate' 351 345 }); 352 346 } 353 - 354 347 } 355 348 356 349 @Injectable({ 357 350 providedIn: 'root' 358 351 }) 359 - export class ErrorService { 352 + export class Error { 360 353 constructor(public readonly http: HttpClient) { } 361 354 362 355 /** ··· 380 373 } 381 374 }); 382 375 } 383 - 384 376 } 385 377 386 378 @Injectable({ 387 379 providedIn: 'root' 388 380 }) 389 - export class FileResponseService { 381 + export class FileResponse { 390 382 constructor(public readonly http: HttpClient) { } 391 383 392 384 /** ··· 404 396 } 405 397 }); 406 398 } 407 - 408 399 } 409 400 410 401 @Injectable({ 411 402 providedIn: 'root' 412 403 }) 413 - export class FormDataService { 404 + export class FormData { 414 405 constructor(public readonly http: HttpClient) { } 415 406 416 407 /** ··· 430 421 mediaType: 'multipart/form-data' 431 422 }); 432 423 } 433 - 434 424 } 435 425 436 426 @Injectable({ 437 427 providedIn: 'root' 438 428 }) 439 - export class HeaderService { 429 + export class Header { 440 430 constructor(public readonly http: HttpClient) { } 441 431 442 432 /** ··· 454 444 } 455 445 }); 456 446 } 457 - 458 447 } 459 448 460 449 @Injectable({ 461 450 providedIn: 'root' 462 451 }) 463 - export class MultipartService { 452 + export class Multipart { 464 453 constructor(public readonly http: HttpClient) { } 465 454 466 455 /** ··· 487 476 url: '/api/v{api-version}/multipart' 488 477 }); 489 478 } 490 - 491 479 } 492 480 493 481 @Injectable({ 494 482 providedIn: 'root' 495 483 }) 496 - export class MultipleTags1Service { 484 + export class MultipleTags1 { 497 485 constructor(public readonly http: HttpClient) { } 498 486 499 487 /** ··· 517 505 url: '/api/v{api-version}/multiple-tags/b' 518 506 }); 519 507 } 520 - 521 508 } 522 509 523 510 @Injectable({ 524 511 providedIn: 'root' 525 512 }) 526 - export class MultipleTags2Service { 513 + export class MultipleTags2 { 527 514 constructor(public readonly http: HttpClient) { } 528 515 529 516 /** ··· 547 534 url: '/api/v{api-version}/multiple-tags/b' 548 535 }); 549 536 } 550 - 551 537 } 552 538 553 539 @Injectable({ 554 540 providedIn: 'root' 555 541 }) 556 - export class MultipleTags3Service { 542 + export class MultipleTags3 { 557 543 constructor(public readonly http: HttpClient) { } 558 544 559 545 /** ··· 566 552 url: '/api/v{api-version}/multiple-tags/b' 567 553 }); 568 554 } 569 - 570 555 } 571 556 572 557 @Injectable({ 573 558 providedIn: 'root' 574 559 }) 575 - export class NoContentService { 560 + export class NoContent { 576 561 constructor(public readonly http: HttpClient) { } 577 562 578 563 /** ··· 597 582 url: '/api/v{api-version}/multiple-tags/response-and-no-content' 598 583 }); 599 584 } 600 - 601 585 } 602 586 603 587 @Injectable({ 604 588 providedIn: 'root' 605 589 }) 606 - export class NonAsciiÆøåÆøÅöôêÊService { 590 + export class NonAsciiÆøåÆøÅöôêÊ { 607 591 constructor(public readonly http: HttpClient) { } 608 592 609 593 /** ··· 636 620 mediaType: 'application/x-www-form-urlencoded' 637 621 }); 638 622 } 639 - 640 623 } 641 624 642 625 @Injectable({ 643 626 providedIn: 'root' 644 627 }) 645 - export class ParametersService { 628 + export class Parameters { 646 629 constructor(public readonly http: HttpClient) { } 647 630 648 631 /** ··· 773 756 mediaType: 'application/json' 774 757 }); 775 758 } 776 - 777 759 } 778 760 779 761 @Injectable({ 780 762 providedIn: 'root' 781 763 }) 782 - export class RequestBodyService { 764 + export class RequestBody { 783 765 constructor(public readonly http: HttpClient) { } 784 766 785 767 /** ··· 799 781 mediaType: 'application/json' 800 782 }); 801 783 } 802 - 803 784 } 804 785 805 786 @Injectable({ 806 787 providedIn: 'root' 807 788 }) 808 - export class ResponseService { 789 + export class Response { 809 790 constructor(public readonly http: HttpClient) { } 810 791 811 792 /** ··· 869 850 } 870 851 }); 871 852 } 872 - 873 853 } 874 854 875 855 @Injectable({ 876 856 providedIn: 'root' 877 857 }) 878 - export class SimpleService { 858 + export class Simple { 879 859 constructor(public readonly http: HttpClient) { } 880 860 881 861 /** ··· 958 938 url: '/api/v{api-version}/simple' 959 939 }); 960 940 } 961 - 962 941 } 963 942 964 943 @Injectable({ 965 944 providedIn: 'root' 966 945 }) 967 - export class TypesService { 946 + export class Types { 968 947 constructor(public readonly http: HttpClient) { } 969 948 970 949 /** ··· 1003 982 } 1004 983 }); 1005 984 } 1006 - 1007 985 } 1008 986 1009 987 @Injectable({ 1010 988 providedIn: 'root' 1011 989 }) 1012 - export class UploadService { 990 + export class Upload { 1013 991 constructor(public readonly http: HttpClient) { } 1014 992 1015 993 /** ··· 1026 1004 mediaType: 'application/x-www-form-urlencoded' 1027 1005 }); 1028 1006 } 1029 - 1030 1007 }
+1 -2
packages/openapi-ts-tests/test/__snapshots__/test/generated/v3_angular_transform/sdk.gen.ts.snap
··· 10 10 @Injectable({ 11 11 providedIn: 'root' 12 12 }) 13 - export class DefaultService { 13 + export class Default { 14 14 constructor(public readonly http: HttpClient) { } 15 15 16 16 /** ··· 83 83 url: '/api/multiple-responses' 84 84 }); 85 85 } 86 - 87 86 }
+23 -46
packages/openapi-ts-tests/test/__snapshots__/test/generated/v3_axios/sdk.gen.ts.snap
··· 5 5 import { request as __request } from './core/request'; 6 6 import type { CollectionFormatData, ComplexTypesData, ComplexTypesResponse, ComplexParamsData, ComplexParamsResponse, PatchApiNoTagResponse, ImportData, ImportResponse, FooWowResponse, GetApiSimpleOperationData, GetApiSimpleOperationResponse, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DeprecatedCallData, CallWithDescriptionsData, TestErrorCodeData, TestErrorCodeResponse, FileResponseData, FileResponseResponse, PostApiFormDataData, CallWithResultFromHeaderResponse, MultipartRequestData, MultipartResponseResponse, DummyAResponse, DummyBResponse, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseResponse, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData, DeleteFooData3, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiRequestBodyData, CallWithResponseResponse, CallWithDuplicateResponsesResponse, CallWithResponsesResponse, ApiVVersionODataControllerCountResponse, TypesData, TypesResponse, UploadFileData, UploadFileResponse } from './types.gen'; 7 7 8 - export class CollectionFormatService { 8 + export class CollectionFormat { 9 9 /** 10 10 * @param data The data for the request. 11 11 * @param data.parameterArrayCsv This is an array parameter that is sent as csv format (comma-separated values) ··· 28 28 } 29 29 }); 30 30 } 31 - 32 31 } 33 32 34 - export class ComplexService { 33 + export class Complex { 35 34 /** 36 35 * @param data The data for the request. 37 36 * @param data.parameterObject Parameter containing object ··· 72 71 mediaType: 'application/json-patch+json' 73 72 }); 74 73 } 75 - 76 74 } 77 75 78 - export class DefaultService { 76 + export class Default { 79 77 /** 80 78 * @throws ApiError 81 79 */ ··· 142 140 } 143 141 }); 144 142 } 145 - 146 143 } 147 144 148 - export class DefaultsService { 145 + export class Defaults { 149 146 /** 150 147 * @param data The data for the request. 151 148 * @param data.parameterString This is a simple string with default value ··· 220 217 } 221 218 }); 222 219 } 223 - 224 220 } 225 221 226 - export class DeprecatedService { 222 + export class Deprecated { 227 223 /** 228 224 * @deprecated 229 225 * @param data The data for the request. ··· 239 235 } 240 236 }); 241 237 } 242 - 243 238 } 244 239 245 - export class DescriptionsService { 240 + export class Descriptions { 246 241 /** 247 242 * @param data The data for the request. 248 243 * @param data.parameterWithBreaks Testing multiline comments in string: First line ··· 270 265 } 271 266 }); 272 267 } 273 - 274 268 } 275 269 276 - export class DuplicateService { 270 + export class Duplicate { 277 271 /** 278 272 * @throws ApiError 279 273 */ ··· 313 307 url: '/api/v{api-version}/duplicate' 314 308 }); 315 309 } 316 - 317 310 } 318 311 319 - export class ErrorService { 312 + export class Error { 320 313 /** 321 314 * @param data The data for the request. 322 315 * @param data.status Status code to return ··· 338 331 } 339 332 }); 340 333 } 341 - 342 334 } 343 335 344 - export class FileResponseService { 336 + export class FileResponse { 345 337 /** 346 338 * @param data The data for the request. 347 339 * @param data.id ··· 357 349 } 358 350 }); 359 351 } 360 - 361 352 } 362 353 363 - export class FormDataService { 354 + export class FormData { 364 355 /** 365 356 * @param data The data for the request. 366 357 * @param data.parameter This is a reusable parameter ··· 378 369 mediaType: 'multipart/form-data' 379 370 }); 380 371 } 381 - 382 372 } 383 373 384 - export class HeaderService { 374 + export class Header { 385 375 /** 386 376 * @returns string Successful response 387 377 * @throws ApiError ··· 397 387 } 398 388 }); 399 389 } 400 - 401 390 } 402 391 403 - export class MultipartService { 392 + export class Multipart { 404 393 /** 405 394 * @param data The data for the request. 406 395 * @param data.formData ··· 425 414 url: '/api/v{api-version}/multipart' 426 415 }); 427 416 } 428 - 429 417 } 430 418 431 - export class MultipleTags1Service { 419 + export class MultipleTags1 { 432 420 /** 433 421 * @returns _400 434 422 * @throws ApiError ··· 450 438 url: '/api/v{api-version}/multiple-tags/b' 451 439 }); 452 440 } 453 - 454 441 } 455 442 456 - export class MultipleTags2Service { 443 + export class MultipleTags2 { 457 444 /** 458 445 * @returns _400 459 446 * @throws ApiError ··· 475 462 url: '/api/v{api-version}/multiple-tags/b' 476 463 }); 477 464 } 478 - 479 465 } 480 466 481 - export class MultipleTags3Service { 467 + export class MultipleTags3 { 482 468 /** 483 469 * @returns void Success 484 470 * @throws ApiError ··· 489 475 url: '/api/v{api-version}/multiple-tags/b' 490 476 }); 491 477 } 492 - 493 478 } 494 479 495 - export class NoContentService { 480 + export class NoContent { 496 481 /** 497 482 * @returns void Success 498 483 * @throws ApiError ··· 515 500 url: '/api/v{api-version}/multiple-tags/response-and-no-content' 516 501 }); 517 502 } 518 - 519 503 } 520 504 521 - export class NonAsciiÆøåÆøÅöôêÊService { 505 + export class NonAsciiÆøåÆøÅöôêÊ { 522 506 /** 523 507 * @param data The data for the request. 524 508 * @param data.nonAsciiParamæøåÆøÅöôêÊ Dummy input param ··· 549 533 mediaType: 'application/x-www-form-urlencoded' 550 534 }); 551 535 } 552 - 553 536 } 554 537 555 - export class ParametersService { 538 + export class Parameters { 556 539 /** 557 540 * @param data The data for the request. 558 541 * @param data.fooParam foo in method ··· 681 664 mediaType: 'application/json' 682 665 }); 683 666 } 684 - 685 667 } 686 668 687 - export class RequestBodyService { 669 + export class RequestBody { 688 670 /** 689 671 * @param data The data for the request. 690 672 * @param data.parameter This is a reusable parameter ··· 702 684 mediaType: 'application/json' 703 685 }); 704 686 } 705 - 706 687 } 707 688 708 - export class ResponseService { 689 + export class Response { 709 690 /** 710 691 * @returns number Response is a simple number 711 692 * @returns void Success ··· 767 748 } 768 749 }); 769 750 } 770 - 771 751 } 772 752 773 - export class SimpleService { 753 + export class Simple { 774 754 /** 775 755 * @returns Model_From_Zendesk Success 776 756 * @throws ApiError ··· 851 831 url: '/api/v{api-version}/simple' 852 832 }); 853 833 } 854 - 855 834 } 856 835 857 - export class TypesService { 836 + export class Types { 858 837 /** 859 838 * @param data The data for the request. 860 839 * @param data.parameterArray This is an array parameter ··· 891 870 } 892 871 }); 893 872 } 894 - 895 873 } 896 874 897 - export class UploadService { 875 + export class Upload { 898 876 /** 899 877 * @param data The data for the request. 900 878 * @param data.formData ··· 909 887 mediaType: 'application/x-www-form-urlencoded' 910 888 }); 911 889 } 912 - 913 890 }
+1 -2
packages/openapi-ts-tests/test/__snapshots__/test/generated/v3_axios_transform/sdk.gen.ts.snap
··· 5 5 import { request as __request } from './core/request'; 6 6 import { type ParentModelWithDatesResponse, type ModelWithDatesResponse, type ModelWithDatesArrayResponse, type ArrayOfDatesResponse, type DateResponse, type MultipleResponsesResponse, ParentModelWithDatesResponseTransformer, ModelWithDatesResponseTransformer, ModelWithDatesArrayResponseTransformer } from './types.gen'; 7 7 8 - export class DefaultService { 8 + export class Default { 9 9 /** 10 10 * @returns ParentModelWithDates Success 11 11 * @returns unknown Success ··· 76 76 url: '/api/multiple-responses' 77 77 }); 78 78 } 79 - 80 79 }
+69 -69
packages/openapi-ts-tests/test/__snapshots__/test/generated/v3_client/ApiClient.ts.snap
··· 3 3 import { Interceptors } from './core/OpenAPI'; 4 4 import { FetchHttpRequest } from './core/FetchHttpRequest'; 5 5 6 - import { CollectionFormatService } from './sdk.gen'; 7 - import { ComplexService } from './sdk.gen'; 8 - import { DefaultService } from './sdk.gen'; 9 - import { DefaultsService } from './sdk.gen'; 10 - import { DeprecatedService } from './sdk.gen'; 11 - import { DescriptionsService } from './sdk.gen'; 12 - import { DuplicateService } from './sdk.gen'; 13 - import { ErrorService } from './sdk.gen'; 14 - import { FileResponseService } from './sdk.gen'; 15 - import { FormDataService } from './sdk.gen'; 16 - import { HeaderService } from './sdk.gen'; 17 - import { MultipartService } from './sdk.gen'; 18 - import { MultipleTags1Service } from './sdk.gen'; 19 - import { MultipleTags2Service } from './sdk.gen'; 20 - import { MultipleTags3Service } from './sdk.gen'; 21 - import { NoContentService } from './sdk.gen'; 22 - import { NonAsciiÆøåÆøÅöôêÊService } from './sdk.gen'; 23 - import { ParametersService } from './sdk.gen'; 24 - import { RequestBodyService } from './sdk.gen'; 25 - import { ResponseService } from './sdk.gen'; 26 - import { SimpleService } from './sdk.gen'; 27 - import { TypesService } from './sdk.gen'; 28 - import { UploadService } from './sdk.gen'; 6 + import { CollectionFormat } from './sdk.gen'; 7 + import { Complex } from './sdk.gen'; 8 + import { Default } from './sdk.gen'; 9 + import { Defaults } from './sdk.gen'; 10 + import { Deprecated } from './sdk.gen'; 11 + import { Descriptions } from './sdk.gen'; 12 + import { Duplicate } from './sdk.gen'; 13 + import { Error } from './sdk.gen'; 14 + import { FileResponse } from './sdk.gen'; 15 + import { FormData } from './sdk.gen'; 16 + import { Header } from './sdk.gen'; 17 + import { Multipart } from './sdk.gen'; 18 + import { MultipleTags1 } from './sdk.gen'; 19 + import { MultipleTags2 } from './sdk.gen'; 20 + import { MultipleTags3 } from './sdk.gen'; 21 + import { NoContent } from './sdk.gen'; 22 + import { NonAsciiÆøåÆøÅöôêÊ } from './sdk.gen'; 23 + import { Parameters } from './sdk.gen'; 24 + import { RequestBody } from './sdk.gen'; 25 + import { Response } from './sdk.gen'; 26 + import { Simple } from './sdk.gen'; 27 + import { Types } from './sdk.gen'; 28 + import { Upload } from './sdk.gen'; 29 29 30 30 type HttpRequestConstructor = new (config: OpenAPIConfig) => BaseHttpRequest; 31 31 32 32 export class ApiClient { 33 33 34 - public readonly collectionFormat: CollectionFormatService; 35 - public readonly complex: ComplexService; 36 - public readonly default: DefaultService; 37 - public readonly defaults: DefaultsService; 38 - public readonly deprecated: DeprecatedService; 39 - public readonly descriptions: DescriptionsService; 40 - public readonly duplicate: DuplicateService; 41 - public readonly error: ErrorService; 42 - public readonly fileResponse: FileResponseService; 43 - public readonly formData: FormDataService; 44 - public readonly header: HeaderService; 45 - public readonly multipart: MultipartService; 46 - public readonly multipleTags1: MultipleTags1Service; 47 - public readonly multipleTags2: MultipleTags2Service; 48 - public readonly multipleTags3: MultipleTags3Service; 49 - public readonly noContent: NoContentService; 50 - public readonly nonAsciiÆøåÆøÅöôêÊ: NonAsciiÆøåÆøÅöôêÊService; 51 - public readonly parameters: ParametersService; 52 - public readonly requestBody: RequestBodyService; 53 - public readonly response: ResponseService; 54 - public readonly simple: SimpleService; 55 - public readonly types: TypesService; 56 - public readonly upload: UploadService; 34 + public readonly collectionFormat: CollectionFormat; 35 + public readonly complex: Complex; 36 + public readonly default: Default; 37 + public readonly defaults: Defaults; 38 + public readonly deprecated: Deprecated; 39 + public readonly descriptions: Descriptions; 40 + public readonly duplicate: Duplicate; 41 + public readonly error: Error; 42 + public readonly fileResponse: FileResponse; 43 + public readonly formData: FormData; 44 + public readonly header: Header; 45 + public readonly multipart: Multipart; 46 + public readonly multipleTags1: MultipleTags1; 47 + public readonly multipleTags2: MultipleTags2; 48 + public readonly multipleTags3: MultipleTags3; 49 + public readonly noContent: NoContent; 50 + public readonly nonAsciiÆøåÆøÅöôêÊ: NonAsciiÆøåÆøÅöôêÊ; 51 + public readonly parameters: Parameters; 52 + public readonly requestBody: RequestBody; 53 + public readonly response: Response; 54 + public readonly simple: Simple; 55 + public readonly types: Types; 56 + public readonly upload: Upload; 57 57 58 58 public readonly request: BaseHttpRequest; 59 59 ··· 74 74 }, 75 75 }); 76 76 77 - this.collectionFormat = new CollectionFormatService(this.request); 78 - this.complex = new ComplexService(this.request); 79 - this.default = new DefaultService(this.request); 80 - this.defaults = new DefaultsService(this.request); 81 - this.deprecated = new DeprecatedService(this.request); 82 - this.descriptions = new DescriptionsService(this.request); 83 - this.duplicate = new DuplicateService(this.request); 84 - this.error = new ErrorService(this.request); 85 - this.fileResponse = new FileResponseService(this.request); 86 - this.formData = new FormDataService(this.request); 87 - this.header = new HeaderService(this.request); 88 - this.multipart = new MultipartService(this.request); 89 - this.multipleTags1 = new MultipleTags1Service(this.request); 90 - this.multipleTags2 = new MultipleTags2Service(this.request); 91 - this.multipleTags3 = new MultipleTags3Service(this.request); 92 - this.noContent = new NoContentService(this.request); 93 - this.nonAsciiÆøåÆøÅöôêÊ = new NonAsciiÆøåÆøÅöôêÊService(this.request); 94 - this.parameters = new ParametersService(this.request); 95 - this.requestBody = new RequestBodyService(this.request); 96 - this.response = new ResponseService(this.request); 97 - this.simple = new SimpleService(this.request); 98 - this.types = new TypesService(this.request); 99 - this.upload = new UploadService(this.request); 77 + this.collectionFormat = new CollectionFormat(this.request); 78 + this.complex = new Complex(this.request); 79 + this.default = new Default(this.request); 80 + this.defaults = new Defaults(this.request); 81 + this.deprecated = new Deprecated(this.request); 82 + this.descriptions = new Descriptions(this.request); 83 + this.duplicate = new Duplicate(this.request); 84 + this.error = new Error(this.request); 85 + this.fileResponse = new FileResponse(this.request); 86 + this.formData = new FormData(this.request); 87 + this.header = new Header(this.request); 88 + this.multipart = new Multipart(this.request); 89 + this.multipleTags1 = new MultipleTags1(this.request); 90 + this.multipleTags2 = new MultipleTags2(this.request); 91 + this.multipleTags3 = new MultipleTags3(this.request); 92 + this.noContent = new NoContent(this.request); 93 + this.nonAsciiÆøåÆøÅöôêÊ = new NonAsciiÆøåÆøÅöôêÊ(this.request); 94 + this.parameters = new Parameters(this.request); 95 + this.requestBody = new RequestBody(this.request); 96 + this.response = new Response(this.request); 97 + this.simple = new Simple(this.request); 98 + this.types = new Types(this.request); 99 + this.upload = new Upload(this.request); 100 100 } 101 101 }
+23 -46
packages/openapi-ts-tests/test/__snapshots__/test/generated/v3_client/sdk.gen.ts.snap
··· 4 4 import type { BaseHttpRequest } from './core/BaseHttpRequest'; 5 5 import type { CollectionFormatData, ComplexTypesData, ComplexTypesResponse, ComplexParamsData, ComplexParamsResponse, PatchApiNoTagResponse, ImportData, ImportResponse, FooWowResponse, GetApiSimpleOperationData, GetApiSimpleOperationResponse, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DeprecatedCallData, CallWithDescriptionsData, TestErrorCodeData, TestErrorCodeResponse, FileResponseData, FileResponseResponse, PostApiFormDataData, CallWithResultFromHeaderResponse, MultipartRequestData, MultipartResponseResponse, DummyAResponse, DummyBResponse, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseResponse, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData, DeleteFooData3, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiRequestBodyData, CallWithResponseResponse, CallWithDuplicateResponsesResponse, CallWithResponsesResponse, ApiVVersionODataControllerCountResponse, TypesData, TypesResponse, UploadFileData, UploadFileResponse } from './types.gen'; 6 6 7 - export class CollectionFormatService { 7 + export class CollectionFormat { 8 8 constructor(public readonly httpRequest: BaseHttpRequest) { } 9 9 10 10 /** ··· 29 29 } 30 30 }); 31 31 } 32 - 33 32 } 34 33 35 - export class ComplexService { 34 + export class Complex { 36 35 constructor(public readonly httpRequest: BaseHttpRequest) { } 37 36 38 37 /** ··· 75 74 mediaType: 'application/json-patch+json' 76 75 }); 77 76 } 78 - 79 77 } 80 78 81 - export class DefaultService { 79 + export class Default { 82 80 constructor(public readonly httpRequest: BaseHttpRequest) { } 83 81 84 82 /** ··· 147 145 } 148 146 }); 149 147 } 150 - 151 148 } 152 149 153 - export class DefaultsService { 150 + export class Defaults { 154 151 constructor(public readonly httpRequest: BaseHttpRequest) { } 155 152 156 153 /** ··· 227 224 } 228 225 }); 229 226 } 230 - 231 227 } 232 228 233 - export class DeprecatedService { 229 + export class Deprecated { 234 230 constructor(public readonly httpRequest: BaseHttpRequest) { } 235 231 236 232 /** ··· 248 244 } 249 245 }); 250 246 } 251 - 252 247 } 253 248 254 - export class DescriptionsService { 249 + export class Descriptions { 255 250 constructor(public readonly httpRequest: BaseHttpRequest) { } 256 251 257 252 /** ··· 281 276 } 282 277 }); 283 278 } 284 - 285 279 } 286 280 287 - export class DuplicateService { 281 + export class Duplicate { 288 282 constructor(public readonly httpRequest: BaseHttpRequest) { } 289 283 290 284 /** ··· 326 320 url: '/api/v{api-version}/duplicate' 327 321 }); 328 322 } 329 - 330 323 } 331 324 332 - export class ErrorService { 325 + export class Error { 333 326 constructor(public readonly httpRequest: BaseHttpRequest) { } 334 327 335 328 /** ··· 353 346 } 354 347 }); 355 348 } 356 - 357 349 } 358 350 359 - export class FileResponseService { 351 + export class FileResponse { 360 352 constructor(public readonly httpRequest: BaseHttpRequest) { } 361 353 362 354 /** ··· 374 366 } 375 367 }); 376 368 } 377 - 378 369 } 379 370 380 - export class FormDataService { 371 + export class FormData { 381 372 constructor(public readonly httpRequest: BaseHttpRequest) { } 382 373 383 374 /** ··· 397 388 mediaType: 'multipart/form-data' 398 389 }); 399 390 } 400 - 401 391 } 402 392 403 - export class HeaderService { 393 + export class Header { 404 394 constructor(public readonly httpRequest: BaseHttpRequest) { } 405 395 406 396 /** ··· 418 408 } 419 409 }); 420 410 } 421 - 422 411 } 423 412 424 - export class MultipartService { 413 + export class Multipart { 425 414 constructor(public readonly httpRequest: BaseHttpRequest) { } 426 415 427 416 /** ··· 448 437 url: '/api/v{api-version}/multipart' 449 438 }); 450 439 } 451 - 452 440 } 453 441 454 - export class MultipleTags1Service { 442 + export class MultipleTags1 { 455 443 constructor(public readonly httpRequest: BaseHttpRequest) { } 456 444 457 445 /** ··· 475 463 url: '/api/v{api-version}/multiple-tags/b' 476 464 }); 477 465 } 478 - 479 466 } 480 467 481 - export class MultipleTags2Service { 468 + export class MultipleTags2 { 482 469 constructor(public readonly httpRequest: BaseHttpRequest) { } 483 470 484 471 /** ··· 502 489 url: '/api/v{api-version}/multiple-tags/b' 503 490 }); 504 491 } 505 - 506 492 } 507 493 508 - export class MultipleTags3Service { 494 + export class MultipleTags3 { 509 495 constructor(public readonly httpRequest: BaseHttpRequest) { } 510 496 511 497 /** ··· 518 504 url: '/api/v{api-version}/multiple-tags/b' 519 505 }); 520 506 } 521 - 522 507 } 523 508 524 - export class NoContentService { 509 + export class NoContent { 525 510 constructor(public readonly httpRequest: BaseHttpRequest) { } 526 511 527 512 /** ··· 546 531 url: '/api/v{api-version}/multiple-tags/response-and-no-content' 547 532 }); 548 533 } 549 - 550 534 } 551 535 552 - export class NonAsciiÆøåÆøÅöôêÊService { 536 + export class NonAsciiÆøåÆøÅöôêÊ { 553 537 constructor(public readonly httpRequest: BaseHttpRequest) { } 554 538 555 539 /** ··· 582 566 mediaType: 'application/x-www-form-urlencoded' 583 567 }); 584 568 } 585 - 586 569 } 587 570 588 - export class ParametersService { 571 + export class Parameters { 589 572 constructor(public readonly httpRequest: BaseHttpRequest) { } 590 573 591 574 /** ··· 716 699 mediaType: 'application/json' 717 700 }); 718 701 } 719 - 720 702 } 721 703 722 - export class RequestBodyService { 704 + export class RequestBody { 723 705 constructor(public readonly httpRequest: BaseHttpRequest) { } 724 706 725 707 /** ··· 739 721 mediaType: 'application/json' 740 722 }); 741 723 } 742 - 743 724 } 744 725 745 - export class ResponseService { 726 + export class Response { 746 727 constructor(public readonly httpRequest: BaseHttpRequest) { } 747 728 748 729 /** ··· 806 787 } 807 788 }); 808 789 } 809 - 810 790 } 811 791 812 - export class SimpleService { 792 + export class Simple { 813 793 constructor(public readonly httpRequest: BaseHttpRequest) { } 814 794 815 795 /** ··· 892 872 url: '/api/v{api-version}/simple' 893 873 }); 894 874 } 895 - 896 875 } 897 876 898 - export class TypesService { 877 + export class Types { 899 878 constructor(public readonly httpRequest: BaseHttpRequest) { } 900 879 901 880 /** ··· 934 913 } 935 914 }); 936 915 } 937 - 938 916 } 939 917 940 - export class UploadService { 918 + export class Upload { 941 919 constructor(public readonly httpRequest: BaseHttpRequest) { } 942 920 943 921 /** ··· 954 932 mediaType: 'application/x-www-form-urlencoded' 955 933 }); 956 934 } 957 - 958 935 }
+3 -3
packages/openapi-ts-tests/test/__snapshots__/test/generated/v3_client_transform/ApiClient.ts.snap
··· 3 3 import { Interceptors } from './core/OpenAPI'; 4 4 import { FetchHttpRequest } from './core/FetchHttpRequest'; 5 5 6 - import { DefaultService } from './sdk.gen'; 6 + import { Default } from './sdk.gen'; 7 7 8 8 type HttpRequestConstructor = new (config: OpenAPIConfig) => BaseHttpRequest; 9 9 10 10 export class ApiClient { 11 11 12 - public readonly default: DefaultService; 12 + public readonly default: Default; 13 13 14 14 public readonly request: BaseHttpRequest; 15 15 ··· 30 30 }, 31 31 }); 32 32 33 - this.default = new DefaultService(this.request); 33 + this.default = new Default(this.request); 34 34 } 35 35 }
+1 -2
packages/openapi-ts-tests/test/__snapshots__/test/generated/v3_client_transform/sdk.gen.ts.snap
··· 4 4 import type { BaseHttpRequest } from './core/BaseHttpRequest'; 5 5 import { type ParentModelWithDatesResponse, type ModelWithDatesResponse, type ModelWithDatesArrayResponse, type ArrayOfDatesResponse, type DateResponse, type MultipleResponsesResponse, ParentModelWithDatesResponseTransformer, ModelWithDatesResponseTransformer, ModelWithDatesArrayResponseTransformer } from './types.gen'; 6 6 7 - export class DefaultService { 7 + export class Default { 8 8 constructor(public readonly httpRequest: BaseHttpRequest) { } 9 9 10 10 /** ··· 77 77 url: '/api/multiple-responses' 78 78 }); 79 79 } 80 - 81 80 }
+23 -46
packages/openapi-ts-tests/test/__snapshots__/test/generated/v3_enums_typescript/sdk.gen.ts.snap
··· 5 5 import { request as __request } from './core/request'; 6 6 import type { CollectionFormatData, ComplexTypesData, ComplexTypesResponse, ComplexParamsData, ComplexParamsResponse, PatchApiNoTagResponse, ImportData, ImportResponse, FooWowResponse, GetApiSimpleOperationData, GetApiSimpleOperationResponse, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DeprecatedCallData, CallWithDescriptionsData, TestErrorCodeData, TestErrorCodeResponse, FileResponseData, FileResponseResponse, PostApiFormDataData, CallWithResultFromHeaderResponse, MultipartRequestData, MultipartResponseResponse, DummyAResponse, DummyBResponse, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseResponse, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData, DeleteFooData3, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiRequestBodyData, CallWithResponseResponse, CallWithDuplicateResponsesResponse, CallWithResponsesResponse, ApiVVersionODataControllerCountResponse, TypesData, TypesResponse, UploadFileData, UploadFileResponse } from './types.gen'; 7 7 8 - export class CollectionFormatService { 8 + export class CollectionFormat { 9 9 /** 10 10 * @param data The data for the request. 11 11 * @param data.parameterArrayCsv This is an array parameter that is sent as csv format (comma-separated values) ··· 28 28 } 29 29 }); 30 30 } 31 - 32 31 } 33 32 34 - export class ComplexService { 33 + export class Complex { 35 34 /** 36 35 * @param data The data for the request. 37 36 * @param data.parameterObject Parameter containing object ··· 72 71 mediaType: 'application/json-patch+json' 73 72 }); 74 73 } 75 - 76 74 } 77 75 78 - export class DefaultService { 76 + export class Default { 79 77 /** 80 78 * @throws ApiError 81 79 */ ··· 142 140 } 143 141 }); 144 142 } 145 - 146 143 } 147 144 148 - export class DefaultsService { 145 + export class Defaults { 149 146 /** 150 147 * @param data The data for the request. 151 148 * @param data.parameterString This is a simple string with default value ··· 220 217 } 221 218 }); 222 219 } 223 - 224 220 } 225 221 226 - export class DeprecatedService { 222 + export class Deprecated { 227 223 /** 228 224 * @deprecated 229 225 * @param data The data for the request. ··· 239 235 } 240 236 }); 241 237 } 242 - 243 238 } 244 239 245 - export class DescriptionsService { 240 + export class Descriptions { 246 241 /** 247 242 * @param data The data for the request. 248 243 * @param data.parameterWithBreaks Testing multiline comments in string: First line ··· 270 265 } 271 266 }); 272 267 } 273 - 274 268 } 275 269 276 - export class DuplicateService { 270 + export class Duplicate { 277 271 /** 278 272 * @throws ApiError 279 273 */ ··· 313 307 url: '/api/v{api-version}/duplicate' 314 308 }); 315 309 } 316 - 317 310 } 318 311 319 - export class ErrorService { 312 + export class Error { 320 313 /** 321 314 * @param data The data for the request. 322 315 * @param data.status Status code to return ··· 338 331 } 339 332 }); 340 333 } 341 - 342 334 } 343 335 344 - export class FileResponseService { 336 + export class FileResponse { 345 337 /** 346 338 * @param data The data for the request. 347 339 * @param data.id ··· 357 349 } 358 350 }); 359 351 } 360 - 361 352 } 362 353 363 - export class FormDataService { 354 + export class FormData { 364 355 /** 365 356 * @param data The data for the request. 366 357 * @param data.parameter This is a reusable parameter ··· 378 369 mediaType: 'multipart/form-data' 379 370 }); 380 371 } 381 - 382 372 } 383 373 384 - export class HeaderService { 374 + export class Header { 385 375 /** 386 376 * @returns string Successful response 387 377 * @throws ApiError ··· 397 387 } 398 388 }); 399 389 } 400 - 401 390 } 402 391 403 - export class MultipartService { 392 + export class Multipart { 404 393 /** 405 394 * @param data The data for the request. 406 395 * @param data.formData ··· 425 414 url: '/api/v{api-version}/multipart' 426 415 }); 427 416 } 428 - 429 417 } 430 418 431 - export class MultipleTags1Service { 419 + export class MultipleTags1 { 432 420 /** 433 421 * @returns _400 434 422 * @throws ApiError ··· 450 438 url: '/api/v{api-version}/multiple-tags/b' 451 439 }); 452 440 } 453 - 454 441 } 455 442 456 - export class MultipleTags2Service { 443 + export class MultipleTags2 { 457 444 /** 458 445 * @returns _400 459 446 * @throws ApiError ··· 475 462 url: '/api/v{api-version}/multiple-tags/b' 476 463 }); 477 464 } 478 - 479 465 } 480 466 481 - export class MultipleTags3Service { 467 + export class MultipleTags3 { 482 468 /** 483 469 * @returns void Success 484 470 * @throws ApiError ··· 489 475 url: '/api/v{api-version}/multiple-tags/b' 490 476 }); 491 477 } 492 - 493 478 } 494 479 495 - export class NoContentService { 480 + export class NoContent { 496 481 /** 497 482 * @returns void Success 498 483 * @throws ApiError ··· 515 500 url: '/api/v{api-version}/multiple-tags/response-and-no-content' 516 501 }); 517 502 } 518 - 519 503 } 520 504 521 - export class NonAsciiÆøåÆøÅöôêÊService { 505 + export class NonAsciiÆøåÆøÅöôêÊ { 522 506 /** 523 507 * @param data The data for the request. 524 508 * @param data.nonAsciiParamæøåÆøÅöôêÊ Dummy input param ··· 549 533 mediaType: 'application/x-www-form-urlencoded' 550 534 }); 551 535 } 552 - 553 536 } 554 537 555 - export class ParametersService { 538 + export class Parameters { 556 539 /** 557 540 * @param data The data for the request. 558 541 * @param data.fooParam foo in method ··· 681 664 mediaType: 'application/json' 682 665 }); 683 666 } 684 - 685 667 } 686 668 687 - export class RequestBodyService { 669 + export class RequestBody { 688 670 /** 689 671 * @param data The data for the request. 690 672 * @param data.parameter This is a reusable parameter ··· 702 684 mediaType: 'application/json' 703 685 }); 704 686 } 705 - 706 687 } 707 688 708 - export class ResponseService { 689 + export class Response { 709 690 /** 710 691 * @returns number Response is a simple number 711 692 * @returns void Success ··· 767 748 } 768 749 }); 769 750 } 770 - 771 751 } 772 752 773 - export class SimpleService { 753 + export class Simple { 774 754 /** 775 755 * @returns Model_From_Zendesk Success 776 756 * @throws ApiError ··· 851 831 url: '/api/v{api-version}/simple' 852 832 }); 853 833 } 854 - 855 834 } 856 835 857 - export class TypesService { 836 + export class Types { 858 837 /** 859 838 * @param data The data for the request. 860 839 * @param data.parameterArray This is an array parameter ··· 891 870 } 892 871 }); 893 872 } 894 - 895 873 } 896 874 897 - export class UploadService { 875 + export class Upload { 898 876 /** 899 877 * @param data The data for the request. 900 878 * @param data.formData ··· 909 887 mediaType: 'application/x-www-form-urlencoded' 910 888 }); 911 889 } 912 - 913 890 }
+23 -46
packages/openapi-ts-tests/test/__snapshots__/test/generated/v3_enums_typescript_namespace/sdk.gen.ts.snap
··· 5 5 import { request as __request } from './core/request'; 6 6 import type { CollectionFormatData, ComplexTypesData, ComplexTypesResponse, ComplexParamsData, ComplexParamsResponse, PatchApiNoTagResponse, ImportData, ImportResponse, FooWowResponse, GetApiSimpleOperationData, GetApiSimpleOperationResponse, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DeprecatedCallData, CallWithDescriptionsData, TestErrorCodeData, TestErrorCodeResponse, FileResponseData, FileResponseResponse, PostApiFormDataData, CallWithResultFromHeaderResponse, MultipartRequestData, MultipartResponseResponse, DummyAResponse, DummyBResponse, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseResponse, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData, DeleteFooData3, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiRequestBodyData, CallWithResponseResponse, CallWithDuplicateResponsesResponse, CallWithResponsesResponse, ApiVVersionODataControllerCountResponse, TypesData, TypesResponse, UploadFileData, UploadFileResponse } from './types.gen'; 7 7 8 - export class CollectionFormatService { 8 + export class CollectionFormat { 9 9 /** 10 10 * @param data The data for the request. 11 11 * @param data.parameterArrayCsv This is an array parameter that is sent as csv format (comma-separated values) ··· 28 28 } 29 29 }); 30 30 } 31 - 32 31 } 33 32 34 - export class ComplexService { 33 + export class Complex { 35 34 /** 36 35 * @param data The data for the request. 37 36 * @param data.parameterObject Parameter containing object ··· 72 71 mediaType: 'application/json-patch+json' 73 72 }); 74 73 } 75 - 76 74 } 77 75 78 - export class DefaultService { 76 + export class Default { 79 77 /** 80 78 * @throws ApiError 81 79 */ ··· 142 140 } 143 141 }); 144 142 } 145 - 146 143 } 147 144 148 - export class DefaultsService { 145 + export class Defaults { 149 146 /** 150 147 * @param data The data for the request. 151 148 * @param data.parameterString This is a simple string with default value ··· 220 217 } 221 218 }); 222 219 } 223 - 224 220 } 225 221 226 - export class DeprecatedService { 222 + export class Deprecated { 227 223 /** 228 224 * @deprecated 229 225 * @param data The data for the request. ··· 239 235 } 240 236 }); 241 237 } 242 - 243 238 } 244 239 245 - export class DescriptionsService { 240 + export class Descriptions { 246 241 /** 247 242 * @param data The data for the request. 248 243 * @param data.parameterWithBreaks Testing multiline comments in string: First line ··· 270 265 } 271 266 }); 272 267 } 273 - 274 268 } 275 269 276 - export class DuplicateService { 270 + export class Duplicate { 277 271 /** 278 272 * @throws ApiError 279 273 */ ··· 313 307 url: '/api/v{api-version}/duplicate' 314 308 }); 315 309 } 316 - 317 310 } 318 311 319 - export class ErrorService { 312 + export class Error { 320 313 /** 321 314 * @param data The data for the request. 322 315 * @param data.status Status code to return ··· 338 331 } 339 332 }); 340 333 } 341 - 342 334 } 343 335 344 - export class FileResponseService { 336 + export class FileResponse { 345 337 /** 346 338 * @param data The data for the request. 347 339 * @param data.id ··· 357 349 } 358 350 }); 359 351 } 360 - 361 352 } 362 353 363 - export class FormDataService { 354 + export class FormData { 364 355 /** 365 356 * @param data The data for the request. 366 357 * @param data.parameter This is a reusable parameter ··· 378 369 mediaType: 'multipart/form-data' 379 370 }); 380 371 } 381 - 382 372 } 383 373 384 - export class HeaderService { 374 + export class Header { 385 375 /** 386 376 * @returns string Successful response 387 377 * @throws ApiError ··· 397 387 } 398 388 }); 399 389 } 400 - 401 390 } 402 391 403 - export class MultipartService { 392 + export class Multipart { 404 393 /** 405 394 * @param data The data for the request. 406 395 * @param data.formData ··· 425 414 url: '/api/v{api-version}/multipart' 426 415 }); 427 416 } 428 - 429 417 } 430 418 431 - export class MultipleTags1Service { 419 + export class MultipleTags1 { 432 420 /** 433 421 * @returns _400 434 422 * @throws ApiError ··· 450 438 url: '/api/v{api-version}/multiple-tags/b' 451 439 }); 452 440 } 453 - 454 441 } 455 442 456 - export class MultipleTags2Service { 443 + export class MultipleTags2 { 457 444 /** 458 445 * @returns _400 459 446 * @throws ApiError ··· 475 462 url: '/api/v{api-version}/multiple-tags/b' 476 463 }); 477 464 } 478 - 479 465 } 480 466 481 - export class MultipleTags3Service { 467 + export class MultipleTags3 { 482 468 /** 483 469 * @returns void Success 484 470 * @throws ApiError ··· 489 475 url: '/api/v{api-version}/multiple-tags/b' 490 476 }); 491 477 } 492 - 493 478 } 494 479 495 - export class NoContentService { 480 + export class NoContent { 496 481 /** 497 482 * @returns void Success 498 483 * @throws ApiError ··· 515 500 url: '/api/v{api-version}/multiple-tags/response-and-no-content' 516 501 }); 517 502 } 518 - 519 503 } 520 504 521 - export class NonAsciiÆøåÆøÅöôêÊService { 505 + export class NonAsciiÆøåÆøÅöôêÊ { 522 506 /** 523 507 * @param data The data for the request. 524 508 * @param data.nonAsciiParamæøåÆøÅöôêÊ Dummy input param ··· 549 533 mediaType: 'application/x-www-form-urlencoded' 550 534 }); 551 535 } 552 - 553 536 } 554 537 555 - export class ParametersService { 538 + export class Parameters { 556 539 /** 557 540 * @param data The data for the request. 558 541 * @param data.fooParam foo in method ··· 681 664 mediaType: 'application/json' 682 665 }); 683 666 } 684 - 685 667 } 686 668 687 - export class RequestBodyService { 669 + export class RequestBody { 688 670 /** 689 671 * @param data The data for the request. 690 672 * @param data.parameter This is a reusable parameter ··· 702 684 mediaType: 'application/json' 703 685 }); 704 686 } 705 - 706 687 } 707 688 708 - export class ResponseService { 689 + export class Response { 709 690 /** 710 691 * @returns number Response is a simple number 711 692 * @returns void Success ··· 767 748 } 768 749 }); 769 750 } 770 - 771 751 } 772 752 773 - export class SimpleService { 753 + export class Simple { 774 754 /** 775 755 * @returns Model_From_Zendesk Success 776 756 * @throws ApiError ··· 851 831 url: '/api/v{api-version}/simple' 852 832 }); 853 833 } 854 - 855 834 } 856 835 857 - export class TypesService { 836 + export class Types { 858 837 /** 859 838 * @param data The data for the request. 860 839 * @param data.parameterArray This is an array parameter ··· 891 870 } 892 871 }); 893 872 } 894 - 895 873 } 896 874 897 - export class UploadService { 875 + export class Upload { 898 876 /** 899 877 * @param data The data for the request. 900 878 * @param data.formData ··· 909 887 mediaType: 'application/x-www-form-urlencoded' 910 888 }); 911 889 } 912 - 913 890 }
+1 -2
packages/openapi-ts-tests/test/__snapshots__/test/generated/v3_legacy_positional_args/sdk.gen.ts.snap
··· 5 5 import { request as __request } from './core/request'; 6 6 import type { CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData } from './types.gen'; 7 7 8 - export class DefaultsService { 8 + export class Defaults { 9 9 /** 10 10 * @param parameterString This is a simple string with default value 11 11 * @param parameterNumber This is a simple number with default value ··· 81 81 } 82 82 }); 83 83 } 84 - 85 84 }
+23 -46
packages/openapi-ts-tests/test/__snapshots__/test/generated/v3_node/sdk.gen.ts.snap
··· 5 5 import { request as __request } from './core/request'; 6 6 import type { CollectionFormatData, ComplexTypesData, ComplexTypesResponse, ComplexParamsData, ComplexParamsResponse, PatchApiNoTagResponse, ImportData, ImportResponse, FooWowResponse, GetApiSimpleOperationData, GetApiSimpleOperationResponse, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DeprecatedCallData, CallWithDescriptionsData, TestErrorCodeData, TestErrorCodeResponse, FileResponseData, FileResponseResponse, PostApiFormDataData, CallWithResultFromHeaderResponse, MultipartRequestData, MultipartResponseResponse, DummyAResponse, DummyBResponse, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseResponse, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData, DeleteFooData3, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiRequestBodyData, CallWithResponseResponse, CallWithDuplicateResponsesResponse, CallWithResponsesResponse, ApiVVersionODataControllerCountResponse, TypesData, TypesResponse, UploadFileData, UploadFileResponse } from './types.gen'; 7 7 8 - export class CollectionFormatService { 8 + export class CollectionFormat { 9 9 /** 10 10 * @param data The data for the request. 11 11 * @param data.parameterArrayCsv This is an array parameter that is sent as csv format (comma-separated values) ··· 28 28 } 29 29 }); 30 30 } 31 - 32 31 } 33 32 34 - export class ComplexService { 33 + export class Complex { 35 34 /** 36 35 * @param data The data for the request. 37 36 * @param data.parameterObject Parameter containing object ··· 72 71 mediaType: 'application/json-patch+json' 73 72 }); 74 73 } 75 - 76 74 } 77 75 78 - export class DefaultService { 76 + export class Default { 79 77 /** 80 78 * @throws ApiError 81 79 */ ··· 142 140 } 143 141 }); 144 142 } 145 - 146 143 } 147 144 148 - export class DefaultsService { 145 + export class Defaults { 149 146 /** 150 147 * @param data The data for the request. 151 148 * @param data.parameterString This is a simple string with default value ··· 220 217 } 221 218 }); 222 219 } 223 - 224 220 } 225 221 226 - export class DeprecatedService { 222 + export class Deprecated { 227 223 /** 228 224 * @deprecated 229 225 * @param data The data for the request. ··· 239 235 } 240 236 }); 241 237 } 242 - 243 238 } 244 239 245 - export class DescriptionsService { 240 + export class Descriptions { 246 241 /** 247 242 * @param data The data for the request. 248 243 * @param data.parameterWithBreaks Testing multiline comments in string: First line ··· 270 265 } 271 266 }); 272 267 } 273 - 274 268 } 275 269 276 - export class DuplicateService { 270 + export class Duplicate { 277 271 /** 278 272 * @throws ApiError 279 273 */ ··· 313 307 url: '/api/v{api-version}/duplicate' 314 308 }); 315 309 } 316 - 317 310 } 318 311 319 - export class ErrorService { 312 + export class Error { 320 313 /** 321 314 * @param data The data for the request. 322 315 * @param data.status Status code to return ··· 338 331 } 339 332 }); 340 333 } 341 - 342 334 } 343 335 344 - export class FileResponseService { 336 + export class FileResponse { 345 337 /** 346 338 * @param data The data for the request. 347 339 * @param data.id ··· 357 349 } 358 350 }); 359 351 } 360 - 361 352 } 362 353 363 - export class FormDataService { 354 + export class FormData { 364 355 /** 365 356 * @param data The data for the request. 366 357 * @param data.parameter This is a reusable parameter ··· 378 369 mediaType: 'multipart/form-data' 379 370 }); 380 371 } 381 - 382 372 } 383 373 384 - export class HeaderService { 374 + export class Header { 385 375 /** 386 376 * @returns string Successful response 387 377 * @throws ApiError ··· 397 387 } 398 388 }); 399 389 } 400 - 401 390 } 402 391 403 - export class MultipartService { 392 + export class Multipart { 404 393 /** 405 394 * @param data The data for the request. 406 395 * @param data.formData ··· 425 414 url: '/api/v{api-version}/multipart' 426 415 }); 427 416 } 428 - 429 417 } 430 418 431 - export class MultipleTags1Service { 419 + export class MultipleTags1 { 432 420 /** 433 421 * @returns _400 434 422 * @throws ApiError ··· 450 438 url: '/api/v{api-version}/multiple-tags/b' 451 439 }); 452 440 } 453 - 454 441 } 455 442 456 - export class MultipleTags2Service { 443 + export class MultipleTags2 { 457 444 /** 458 445 * @returns _400 459 446 * @throws ApiError ··· 475 462 url: '/api/v{api-version}/multiple-tags/b' 476 463 }); 477 464 } 478 - 479 465 } 480 466 481 - export class MultipleTags3Service { 467 + export class MultipleTags3 { 482 468 /** 483 469 * @returns void Success 484 470 * @throws ApiError ··· 489 475 url: '/api/v{api-version}/multiple-tags/b' 490 476 }); 491 477 } 492 - 493 478 } 494 479 495 - export class NoContentService { 480 + export class NoContent { 496 481 /** 497 482 * @returns void Success 498 483 * @throws ApiError ··· 515 500 url: '/api/v{api-version}/multiple-tags/response-and-no-content' 516 501 }); 517 502 } 518 - 519 503 } 520 504 521 - export class NonAsciiÆøåÆøÅöôêÊService { 505 + export class NonAsciiÆøåÆøÅöôêÊ { 522 506 /** 523 507 * @param data The data for the request. 524 508 * @param data.nonAsciiParamæøåÆøÅöôêÊ Dummy input param ··· 549 533 mediaType: 'application/x-www-form-urlencoded' 550 534 }); 551 535 } 552 - 553 536 } 554 537 555 - export class ParametersService { 538 + export class Parameters { 556 539 /** 557 540 * @param data The data for the request. 558 541 * @param data.fooParam foo in method ··· 681 664 mediaType: 'application/json' 682 665 }); 683 666 } 684 - 685 667 } 686 668 687 - export class RequestBodyService { 669 + export class RequestBody { 688 670 /** 689 671 * @param data The data for the request. 690 672 * @param data.parameter This is a reusable parameter ··· 702 684 mediaType: 'application/json' 703 685 }); 704 686 } 705 - 706 687 } 707 688 708 - export class ResponseService { 689 + export class Response { 709 690 /** 710 691 * @returns number Response is a simple number 711 692 * @returns void Success ··· 767 748 } 768 749 }); 769 750 } 770 - 771 751 } 772 752 773 - export class SimpleService { 753 + export class Simple { 774 754 /** 775 755 * @returns Model_From_Zendesk Success 776 756 * @throws ApiError ··· 851 831 url: '/api/v{api-version}/simple' 852 832 }); 853 833 } 854 - 855 834 } 856 835 857 - export class TypesService { 836 + export class Types { 858 837 /** 859 838 * @param data The data for the request. 860 839 * @param data.parameterArray This is an array parameter ··· 891 870 } 892 871 }); 893 872 } 894 - 895 873 } 896 874 897 - export class UploadService { 875 + export class Upload { 898 876 /** 899 877 * @param data The data for the request. 900 878 * @param data.formData ··· 909 887 mediaType: 'application/x-www-form-urlencoded' 910 888 }); 911 889 } 912 - 913 890 }
+1 -2
packages/openapi-ts-tests/test/__snapshots__/test/generated/v3_node_transform/sdk.gen.ts.snap
··· 5 5 import { request as __request } from './core/request'; 6 6 import { type ParentModelWithDatesResponse, type ModelWithDatesResponse, type ModelWithDatesArrayResponse, type ArrayOfDatesResponse, type DateResponse, type MultipleResponsesResponse, ParentModelWithDatesResponseTransformer, ModelWithDatesResponseTransformer, ModelWithDatesArrayResponseTransformer } from './types.gen'; 7 7 8 - export class DefaultService { 8 + export class Default { 9 9 /** 10 10 * @returns ParentModelWithDates Success 11 11 * @returns unknown Success ··· 76 76 url: '/api/multiple-responses' 77 77 }); 78 78 } 79 - 80 79 }
+1 -2
packages/openapi-ts-tests/test/__snapshots__/test/generated/v3_options/sdk.gen.ts.snap
··· 5 5 import { request as __request } from './core/request'; 6 6 import type { CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData } from './types.gen'; 7 7 8 - export class DefaultsService { 8 + export class Defaults { 9 9 /** 10 10 * @param data The data for the request. 11 11 * @param data.parameterString This is a simple string with default value ··· 80 80 } 81 81 }); 82 82 } 83 - 84 83 }
-2
packages/openapi-ts-tests/test/__snapshots__/test/generated/v3_services_name/sdk.gen.ts.snap
··· 134 134 mediaType: 'application/json' 135 135 }); 136 136 } 137 - 138 137 } 139 138 140 139 export class myAwesomeSimpleApi { ··· 218 217 url: '/api/v{api-version}/simple' 219 218 }); 220 219 } 221 - 222 220 }
+1 -2
packages/openapi-ts-tests/test/__snapshots__/test/generated/v3_transform/sdk.gen.ts.snap
··· 5 5 import { request as __request } from './core/request'; 6 6 import { type ParentModelWithDatesResponse, type ModelWithDatesResponse, type ModelWithDatesArrayResponse, type ArrayOfDatesResponse, type DateResponse, type MultipleResponsesResponse, ParentModelWithDatesResponseTransformer, ModelWithDatesResponseTransformer, ModelWithDatesArrayResponseTransformer } from './types.gen'; 7 7 8 - export class DefaultService { 8 + export class Default { 9 9 /** 10 10 * @returns ParentModelWithDates Success 11 11 * @returns unknown Success ··· 76 76 url: '/api/multiple-responses' 77 77 }); 78 78 } 79 - 80 79 }
+23 -46
packages/openapi-ts-tests/test/__snapshots__/test/generated/v3_xhr/sdk.gen.ts.snap
··· 5 5 import { request as __request } from './core/request'; 6 6 import type { CollectionFormatData, ComplexTypesData, ComplexTypesResponse, ComplexParamsData, ComplexParamsResponse, PatchApiNoTagResponse, ImportData, ImportResponse, FooWowResponse, GetApiSimpleOperationData, GetApiSimpleOperationResponse, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DeprecatedCallData, CallWithDescriptionsData, TestErrorCodeData, TestErrorCodeResponse, FileResponseData, FileResponseResponse, PostApiFormDataData, CallWithResultFromHeaderResponse, MultipartRequestData, MultipartResponseResponse, DummyAResponse, DummyBResponse, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseResponse, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData, DeleteFooData3, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiRequestBodyData, CallWithResponseResponse, CallWithDuplicateResponsesResponse, CallWithResponsesResponse, ApiVVersionODataControllerCountResponse, TypesData, TypesResponse, UploadFileData, UploadFileResponse } from './types.gen'; 7 7 8 - export class CollectionFormatService { 8 + export class CollectionFormat { 9 9 /** 10 10 * @param data The data for the request. 11 11 * @param data.parameterArrayCsv This is an array parameter that is sent as csv format (comma-separated values) ··· 28 28 } 29 29 }); 30 30 } 31 - 32 31 } 33 32 34 - export class ComplexService { 33 + export class Complex { 35 34 /** 36 35 * @param data The data for the request. 37 36 * @param data.parameterObject Parameter containing object ··· 72 71 mediaType: 'application/json-patch+json' 73 72 }); 74 73 } 75 - 76 74 } 77 75 78 - export class DefaultService { 76 + export class Default { 79 77 /** 80 78 * @throws ApiError 81 79 */ ··· 142 140 } 143 141 }); 144 142 } 145 - 146 143 } 147 144 148 - export class DefaultsService { 145 + export class Defaults { 149 146 /** 150 147 * @param data The data for the request. 151 148 * @param data.parameterString This is a simple string with default value ··· 220 217 } 221 218 }); 222 219 } 223 - 224 220 } 225 221 226 - export class DeprecatedService { 222 + export class Deprecated { 227 223 /** 228 224 * @deprecated 229 225 * @param data The data for the request. ··· 239 235 } 240 236 }); 241 237 } 242 - 243 238 } 244 239 245 - export class DescriptionsService { 240 + export class Descriptions { 246 241 /** 247 242 * @param data The data for the request. 248 243 * @param data.parameterWithBreaks Testing multiline comments in string: First line ··· 270 265 } 271 266 }); 272 267 } 273 - 274 268 } 275 269 276 - export class DuplicateService { 270 + export class Duplicate { 277 271 /** 278 272 * @throws ApiError 279 273 */ ··· 313 307 url: '/api/v{api-version}/duplicate' 314 308 }); 315 309 } 316 - 317 310 } 318 311 319 - export class ErrorService { 312 + export class Error { 320 313 /** 321 314 * @param data The data for the request. 322 315 * @param data.status Status code to return ··· 338 331 } 339 332 }); 340 333 } 341 - 342 334 } 343 335 344 - export class FileResponseService { 336 + export class FileResponse { 345 337 /** 346 338 * @param data The data for the request. 347 339 * @param data.id ··· 357 349 } 358 350 }); 359 351 } 360 - 361 352 } 362 353 363 - export class FormDataService { 354 + export class FormData { 364 355 /** 365 356 * @param data The data for the request. 366 357 * @param data.parameter This is a reusable parameter ··· 378 369 mediaType: 'multipart/form-data' 379 370 }); 380 371 } 381 - 382 372 } 383 373 384 - export class HeaderService { 374 + export class Header { 385 375 /** 386 376 * @returns string Successful response 387 377 * @throws ApiError ··· 397 387 } 398 388 }); 399 389 } 400 - 401 390 } 402 391 403 - export class MultipartService { 392 + export class Multipart { 404 393 /** 405 394 * @param data The data for the request. 406 395 * @param data.formData ··· 425 414 url: '/api/v{api-version}/multipart' 426 415 }); 427 416 } 428 - 429 417 } 430 418 431 - export class MultipleTags1Service { 419 + export class MultipleTags1 { 432 420 /** 433 421 * @returns _400 434 422 * @throws ApiError ··· 450 438 url: '/api/v{api-version}/multiple-tags/b' 451 439 }); 452 440 } 453 - 454 441 } 455 442 456 - export class MultipleTags2Service { 443 + export class MultipleTags2 { 457 444 /** 458 445 * @returns _400 459 446 * @throws ApiError ··· 475 462 url: '/api/v{api-version}/multiple-tags/b' 476 463 }); 477 464 } 478 - 479 465 } 480 466 481 - export class MultipleTags3Service { 467 + export class MultipleTags3 { 482 468 /** 483 469 * @returns void Success 484 470 * @throws ApiError ··· 489 475 url: '/api/v{api-version}/multiple-tags/b' 490 476 }); 491 477 } 492 - 493 478 } 494 479 495 - export class NoContentService { 480 + export class NoContent { 496 481 /** 497 482 * @returns void Success 498 483 * @throws ApiError ··· 515 500 url: '/api/v{api-version}/multiple-tags/response-and-no-content' 516 501 }); 517 502 } 518 - 519 503 } 520 504 521 - export class NonAsciiÆøåÆøÅöôêÊService { 505 + export class NonAsciiÆøåÆøÅöôêÊ { 522 506 /** 523 507 * @param data The data for the request. 524 508 * @param data.nonAsciiParamæøåÆøÅöôêÊ Dummy input param ··· 549 533 mediaType: 'application/x-www-form-urlencoded' 550 534 }); 551 535 } 552 - 553 536 } 554 537 555 - export class ParametersService { 538 + export class Parameters { 556 539 /** 557 540 * @param data The data for the request. 558 541 * @param data.fooParam foo in method ··· 681 664 mediaType: 'application/json' 682 665 }); 683 666 } 684 - 685 667 } 686 668 687 - export class RequestBodyService { 669 + export class RequestBody { 688 670 /** 689 671 * @param data The data for the request. 690 672 * @param data.parameter This is a reusable parameter ··· 702 684 mediaType: 'application/json' 703 685 }); 704 686 } 705 - 706 687 } 707 688 708 - export class ResponseService { 689 + export class Response { 709 690 /** 710 691 * @returns number Response is a simple number 711 692 * @returns void Success ··· 767 748 } 768 749 }); 769 750 } 770 - 771 751 } 772 752 773 - export class SimpleService { 753 + export class Simple { 774 754 /** 775 755 * @returns Model_From_Zendesk Success 776 756 * @throws ApiError ··· 851 831 url: '/api/v{api-version}/simple' 852 832 }); 853 833 } 854 - 855 834 } 856 835 857 - export class TypesService { 836 + export class Types { 858 837 /** 859 838 * @param data The data for the request. 860 839 * @param data.parameterArray This is an array parameter ··· 891 870 } 892 871 }); 893 872 } 894 - 895 873 } 896 874 897 - export class UploadService { 875 + export class Upload { 898 876 /** 899 877 * @param data The data for the request. 900 878 * @param data.formData ··· 909 887 mediaType: 'application/x-www-form-urlencoded' 910 888 }); 911 889 } 912 - 913 890 }
+1 -2
packages/openapi-ts-tests/test/__snapshots__/test/generated/v3_xhr_transform/sdk.gen.ts.snap
··· 5 5 import { request as __request } from './core/request'; 6 6 import { type ParentModelWithDatesResponse, type ModelWithDatesResponse, type ModelWithDatesArrayResponse, type ArrayOfDatesResponse, type DateResponse, type MultipleResponsesResponse, ParentModelWithDatesResponseTransformer, ModelWithDatesResponseTransformer, ModelWithDatesArrayResponseTransformer } from './types.gen'; 7 7 8 - export class DefaultService { 8 + export class Default { 9 9 /** 10 10 * @returns ParentModelWithDates Success 11 11 * @returns unknown Success ··· 76 76 url: '/api/multiple-responses' 77 77 }); 78 78 } 79 - 80 79 }
+1 -1
packages/openapi-ts-tests/test/index.test.ts
··· 373 373 }, 374 374 { 375 375 asClass: true, 376 + classNameBuilder: 'myAwesome{{name}}Api', 376 377 include: '^(Simple|Parameters)', 377 378 name: '@hey-api/sdk', 378 - serviceNameBuilder: 'myAwesome{{name}}Api', 379 379 }, 380 380 ], 381 381 }),
+6 -6
packages/openapi-ts-tests/test/openapi-ts.config.ts
··· 93 93 // bundle: true, 94 94 // bundleSource_EXPERIMENTAL: true, 95 95 // exportFromIndex: true, 96 - name: '@hey-api/client-axios', 97 - // name: '@hey-api/client-fetch', 96 + name: '@hey-api/client-fetch', 98 97 // strictBaseUrl: true, 99 98 }, 100 99 { ··· 102 101 // type: 'json', 103 102 }, 104 103 { 105 - // asClass: true, 104 + asClass: true, 106 105 // auth: false, 106 + // classNameBuilder: '{{name}}', 107 107 // client: false, 108 108 // include... 109 + // instance: true, 109 110 name: '@hey-api/sdk', 110 111 // operationId: false, 111 - responseStyle: 'data', 112 - // serviceNameBuilder: '{{name}}', 112 + // responseStyle: 'data', 113 113 // throwOnError: true, 114 114 // transformer: '@hey-api/transformers', 115 115 // transformer: true, 116 - validator: 'zod', 116 + // validator: 'zod', 117 117 }, 118 118 { 119 119 // bigInt: true,
+18
packages/openapi-ts-tests/test/plugins.test.ts
··· 137 137 '@hey-api/client-fetch', 138 138 { 139 139 asClass: true, 140 + classNameBuilder: '{{name}}Service', 140 141 name: '@hey-api/sdk', 141 142 }, 142 143 ], ··· 152 153 '@hey-api/client-fetch', 153 154 { 154 155 asClass: true, 156 + classNameBuilder: '{{name}}Service', 155 157 name: '@hey-api/sdk', 156 158 }, 157 159 ], ··· 167 169 '@hey-api/client-fetch', 168 170 { 169 171 asClass: true, 172 + classNameBuilder: '{{name}}Service', 170 173 name: '@hey-api/sdk', 171 174 }, 172 175 ], ··· 182 185 '@hey-api/client-fetch', 183 186 { 184 187 asClass: true, 188 + classNameBuilder: '{{name}}Service', 185 189 name: '@hey-api/sdk', 186 190 }, 187 191 ], ··· 197 201 '@hey-api/client-fetch', 198 202 { 199 203 asClass: true, 204 + classNameBuilder: '{{name}}Service', 200 205 name: '@hey-api/sdk', 201 206 }, 202 207 ], ··· 230 235 ], 231 236 }), 232 237 description: 'generate SDK that throws on error', 238 + }, 239 + { 240 + config: createConfig({ 241 + output: 'instance', 242 + plugins: [ 243 + { 244 + instance: true, 245 + name: '@hey-api/sdk', 246 + }, 247 + '@hey-api/client-fetch', 248 + ], 249 + }), 250 + description: 'generate SDK instance', 233 251 }, 234 252 { 235 253 config: createConfig({
+29 -28
packages/openapi-ts/src/compiler/classes.ts
··· 84 84 statements?: ts.Statement[]; 85 85 types?: FunctionTypeParameter[]; 86 86 }) => { 87 - let modifiers = toAccessLevelModifiers(accessLevel); 87 + const modifiers = toAccessLevelModifiers(accessLevel); 88 88 89 89 if (isStatic) { 90 - modifiers = [ 91 - ...modifiers, 92 - ts.factory.createModifier(ts.SyntaxKind.StaticKeyword), 93 - ]; 90 + modifiers.push(ts.factory.createModifier(ts.SyntaxKind.StaticKeyword)); 94 91 } 95 92 96 93 const node = ts.factory.createMethodDeclaration( ··· 119 116 120 117 /** 121 118 * Create a class declaration. 122 - * @param decorator - the class decorator 123 - * @param members - elements in the class. 124 - * @param name - name of the class. 125 - * @returns ts.ClassDeclaration 126 119 */ 127 120 export const createClassDeclaration = ({ 128 121 decorator, 129 - members = [], 122 + exportClass, 130 123 name, 124 + nodes, 131 125 }: { 126 + /** 127 + * Class decorator. 128 + */ 132 129 decorator?: ClassDecorator; 133 - members?: ts.ClassElement[]; 130 + /** 131 + * @default false 132 + */ 133 + exportClass?: boolean; 134 + /** 135 + * Class name. 136 + */ 134 137 name: string; 135 - }) => { 136 - let modifiers: ts.ModifierLike[] = [ 137 - ts.factory.createModifier(ts.SyntaxKind.ExportKeyword), 138 - ]; 138 + /** 139 + * Class elements. 140 + */ 141 + nodes: ReadonlyArray<ts.ClassElement>; 142 + }): ts.ClassDeclaration => { 143 + const modifiers: Array<ts.ModifierLike> = []; 144 + 145 + if (exportClass) { 146 + modifiers.push(ts.factory.createModifier(ts.SyntaxKind.ExportKeyword)); 147 + } 139 148 140 149 if (decorator) { 141 - modifiers = [ 150 + modifiers.unshift( 142 151 ts.factory.createDecorator( 143 152 createCallExpression({ 144 153 functionName: decorator.name, ··· 147 156 .filter(isType<ts.Expression>), 148 157 }), 149 158 ), 150 - ...modifiers, 151 - ]; 159 + ); 152 160 } 153 161 154 - // Add newline between each class member. 155 - let m: ts.ClassElement[] = []; 156 - members.forEach((member) => { 157 - // @ts-expect-error 158 - m = [...m, member, createIdentifier({ text: '\n' })]; 159 - }); 160 - 161 162 return ts.factory.createClassDeclaration( 162 163 modifiers, 163 164 createIdentifier({ text: name }), 164 - [], 165 - [], 166 - m, 165 + undefined, 166 + undefined, 167 + nodes, 167 168 ); 168 169 };
+2
packages/openapi-ts/src/compiler/index.ts
··· 50 50 propertyAccessExpression: types.createPropertyAccessExpression, 51 51 propertyAccessExpressions: transform.createPropertyAccessExpressions, 52 52 propertyAssignment: types.createPropertyAssignment, 53 + propertyDeclaration: utils.createPropertyDeclaration, 53 54 regularExpressionLiteral: types.createRegularExpressionLiteral, 54 55 returnFunctionCall: _return.createReturnFunctionCall, 55 56 returnStatement: _return.createReturnStatement, ··· 58 59 stringLiteral: types.createStringLiteral, 59 60 stringToTsNodes: utils.stringToTsNodes, 60 61 templateLiteralType: types.createTemplateLiteralType, 62 + this: utils.createThis, 61 63 transformArrayMap: transform.createArrayMapTransform, 62 64 transformArrayMutation: transform.createArrayTransformMutation, 63 65 transformDateMutation: transform.createDateTransformMutation,
+5
packages/openapi-ts/src/compiler/types.ts
··· 24 24 } 25 25 | { 26 26 destructure: ReadonlyArray<FunctionParameter>; 27 + type?: any | ts.TypeNode; 27 28 }; 28 29 29 30 export interface FunctionTypeParameter { ··· 225 226 }) 226 227 .filter(Boolean) as ts.BindingElement[], 227 228 ), 229 + type: 230 + parameter.type !== undefined 231 + ? createTypeNode(parameter.type) 232 + : undefined, 228 233 }); 229 234 } 230 235
+21
packages/openapi-ts/src/compiler/utils.ts
··· 83 83 return identifier; 84 84 }; 85 85 86 + export const createThis = () => ts.factory.createThis(); 87 + 88 + export const createPropertyDeclaration = ({ 89 + initializer, 90 + name, 91 + type, 92 + }: { 93 + initializer?: ts.Expression; 94 + name: string | ts.PropertyName; 95 + type?: ts.TypeNode; 96 + }) => { 97 + const node = ts.factory.createPropertyDeclaration( 98 + undefined, 99 + name, 100 + undefined, 101 + type, 102 + initializer, 103 + ); 104 + return node; 105 + }; 106 + 86 107 /** 87 108 * ots for @hey-api/openapi-ts are helpers to reduce repetition of basic TypeScript 88 109 * factory functions.
+115
packages/openapi-ts/src/plugins/@hey-api/sdk/auth.ts
··· 1 + import type { IR } from '../../../ir/types'; 2 + import type { Plugin } from '../../types'; 3 + import type { Config } from './types'; 4 + 5 + // copy-pasted from @hey-api/client-core, minus export statement 6 + interface Auth { 7 + /** 8 + * Which part of the request do we use to send the auth? 9 + * 10 + * @default 'header' 11 + */ 12 + in?: 'header' | 'query' | 'cookie'; 13 + /** 14 + * Header or query parameter name. 15 + * 16 + * @default 'Authorization' 17 + */ 18 + name?: string; 19 + scheme?: 'basic' | 'bearer'; 20 + type: 'apiKey' | 'http'; 21 + } 22 + 23 + // TODO: parser - handle more security types 24 + const securitySchemeObjectToAuthObject = ({ 25 + securitySchemeObject, 26 + }: { 27 + securitySchemeObject: IR.SecurityObject; 28 + }): Auth | undefined => { 29 + if (securitySchemeObject.type === 'openIdConnect') { 30 + return { 31 + scheme: 'bearer', 32 + type: 'http', 33 + }; 34 + } 35 + 36 + if (securitySchemeObject.type === 'oauth2') { 37 + if ( 38 + securitySchemeObject.flows.password || 39 + securitySchemeObject.flows.authorizationCode || 40 + securitySchemeObject.flows.clientCredentials || 41 + securitySchemeObject.flows.implicit 42 + ) { 43 + return { 44 + scheme: 'bearer', 45 + type: 'http', 46 + }; 47 + } 48 + 49 + return; 50 + } 51 + 52 + if (securitySchemeObject.type === 'apiKey') { 53 + if (securitySchemeObject.in === 'header') { 54 + return { 55 + name: securitySchemeObject.name, 56 + type: 'apiKey', 57 + }; 58 + } 59 + 60 + if ( 61 + securitySchemeObject.in === 'query' || 62 + securitySchemeObject.in == 'cookie' 63 + ) { 64 + return { 65 + in: securitySchemeObject.in, 66 + name: securitySchemeObject.name, 67 + type: 'apiKey', 68 + }; 69 + } 70 + 71 + return; 72 + } 73 + 74 + if (securitySchemeObject.type === 'http') { 75 + const scheme = securitySchemeObject.scheme.toLowerCase(); 76 + if (scheme === 'bearer' || scheme === 'basic') { 77 + return { 78 + scheme: scheme as 'bearer' | 'basic', 79 + type: 'http', 80 + }; 81 + } 82 + 83 + return; 84 + } 85 + }; 86 + 87 + export const operationAuth = ({ 88 + operation, 89 + plugin, 90 + }: { 91 + context: IR.Context; 92 + operation: IR.OperationObject; 93 + plugin: Plugin.Instance<Config>; 94 + }): Array<Auth> => { 95 + if (!operation.security || !plugin.auth) { 96 + return []; 97 + } 98 + 99 + const auth: Array<Auth> = []; 100 + 101 + for (const securitySchemeObject of operation.security) { 102 + const authObject = securitySchemeObjectToAuthObject({ 103 + securitySchemeObject, 104 + }); 105 + if (authObject) { 106 + auth.push(authObject); 107 + } else { 108 + console.warn( 109 + `❗️ SDK warning: unsupported security scheme. Please open an issue if you'd like it added https://github.com/hey-api/openapi-ts/issues\n${JSON.stringify(securitySchemeObject, null, 2)}`, 110 + ); 111 + } 112 + } 113 + 114 + return auth; 115 + };
+9 -1
packages/openapi-ts/src/plugins/@hey-api/sdk/config.ts
··· 39 39 context.ensureDependency(config.validator); 40 40 } 41 41 42 + if (config.instance) { 43 + if (typeof config.instance !== 'string') { 44 + config.instance = 'Sdk'; 45 + } 46 + 47 + config.asClass = true; 48 + } 49 + 42 50 // TODO: add responseStyle field to all clients 43 51 if (config.client !== '@hey-api/client-fetch') { 44 52 config.responseStyle = 'fields'; ··· 48 56 auth: true, 49 57 client: true, 50 58 exportFromIndex: true, 59 + instance: false, 51 60 name: '@hey-api/sdk', 52 61 operationId: true, 53 62 output: 'sdk', 54 63 response: 'body', 55 64 responseStyle: 'fields', 56 - serviceNameBuilder: '{{name}}Service', 57 65 }; 58 66 59 67 /**
+435
packages/openapi-ts/src/plugins/@hey-api/sdk/operation.ts
··· 1 + import type ts from 'typescript'; 2 + 3 + import { compiler } from '../../../compiler'; 4 + import type { ObjectValue } from '../../../compiler/types'; 5 + import { clientApi, clientModulePath } from '../../../generate/client'; 6 + import type { TypeScriptFile } from '../../../generate/files'; 7 + import { statusCodeToGroup } from '../../../ir/operation'; 8 + import type { IR } from '../../../ir/types'; 9 + import type { Plugin } from '../../types'; 10 + import { clientId, getClientPlugin } from '../client-core/utils'; 11 + import { 12 + operationTransformerIrRef, 13 + transformersId, 14 + } from '../transformers/plugin'; 15 + import { importIdentifier } from '../typescript/ref'; 16 + import { operationAuth } from './auth'; 17 + import { nuxtTypeComposable, nuxtTypeDefault, sdkId } from './constants'; 18 + import type { Config } from './types'; 19 + import { createResponseValidator } from './validator'; 20 + 21 + /** 22 + * Returns unique operation tags. If there are no tags, we return 'default' 23 + * as a placeholder tag. If SDK instance is enabled, we return its name. 24 + */ 25 + export const getOperationTags = ({ 26 + operation, 27 + plugin, 28 + }: { 29 + operation: IR.OperationObject; 30 + plugin: Pick<Plugin.Instance<Config>, 'instance'>; 31 + }): Set<string> => { 32 + const tags = new Set( 33 + plugin.instance ? [plugin.instance as string] : operation.tags, 34 + ); 35 + if (!tags.size) { 36 + tags.add('default'); 37 + } 38 + return tags; 39 + }; 40 + 41 + export const operationOptionsType = ({ 42 + context, 43 + file, 44 + operation, 45 + throwOnError, 46 + }: { 47 + context: IR.Context; 48 + file: TypeScriptFile; 49 + operation: IR.OperationObject; 50 + throwOnError?: string; 51 + }) => { 52 + const client = getClientPlugin(context.config); 53 + const isNuxtClient = client.name === '@hey-api/client-nuxt'; 54 + 55 + const identifierData = importIdentifier({ 56 + context, 57 + file, 58 + operation, 59 + type: 'data', 60 + }); 61 + const identifierResponse = importIdentifier({ 62 + context, 63 + file, 64 + operation, 65 + type: isNuxtClient ? 'response' : 'responses', 66 + }); 67 + 68 + const optionsName = clientApi.Options.name; 69 + 70 + if (isNuxtClient) { 71 + return `${optionsName}<${nuxtTypeComposable}, ${identifierData.name || 'unknown'}, ${identifierResponse.name || 'unknown'}, ${nuxtTypeDefault}>`; 72 + } 73 + 74 + // TODO: refactor this to be more generic, works for now 75 + if (throwOnError) { 76 + return `${optionsName}<${identifierData.name || 'unknown'}, ${throwOnError}>`; 77 + } 78 + return identifierData.name 79 + ? `${optionsName}<${identifierData.name}>` 80 + : optionsName; 81 + }; 82 + 83 + /** 84 + * Infers `responseType` value from provided response content type. This is 85 + * an adapted version of `getParseAs()` from the Fetch API client. 86 + * 87 + * From Axios documentation: 88 + * `responseType` indicates the type of data that the server will respond with 89 + * options are: 'arraybuffer', 'document', 'json', 'text', 'stream' 90 + * browser only: 'blob' 91 + */ 92 + const getResponseType = ( 93 + contentType: string | null | undefined, 94 + ): 95 + | 'arraybuffer' 96 + | 'blob' 97 + | 'document' 98 + | 'json' 99 + | 'stream' 100 + | 'text' 101 + | undefined => { 102 + if (!contentType) { 103 + return; 104 + } 105 + 106 + const cleanContent = contentType.split(';')[0]?.trim(); 107 + 108 + if (!cleanContent) { 109 + return; 110 + } 111 + 112 + if ( 113 + cleanContent.startsWith('application/json') || 114 + cleanContent.endsWith('+json') 115 + ) { 116 + return 'json'; 117 + } 118 + 119 + // Axios does not handle form data out of the box 120 + // if (cleanContent === 'multipart/form-data') { 121 + // return 'formData'; 122 + // } 123 + 124 + if ( 125 + ['application/', 'audio/', 'image/', 'video/'].some((type) => 126 + cleanContent.startsWith(type), 127 + ) 128 + ) { 129 + return 'blob'; 130 + } 131 + 132 + if (cleanContent.startsWith('text/')) { 133 + return 'text'; 134 + } 135 + }; 136 + 137 + export const operationStatements = ({ 138 + context, 139 + isRequiredOptions, 140 + operation, 141 + plugin, 142 + }: { 143 + context: IR.Context; 144 + isRequiredOptions: boolean; 145 + operation: IR.OperationObject; 146 + plugin: Plugin.Instance<Config>; 147 + }): Array<ts.Statement> => { 148 + const file = context.file({ id: sdkId })!; 149 + const sdkOutput = file.nameWithoutExtension(); 150 + 151 + const client = getClientPlugin(context.config); 152 + const isNuxtClient = client.name === '@hey-api/client-nuxt'; 153 + 154 + const identifierError = importIdentifier({ 155 + context, 156 + file, 157 + operation, 158 + type: isNuxtClient ? 'error' : 'errors', 159 + }); 160 + const identifierResponse = importIdentifier({ 161 + context, 162 + file, 163 + operation, 164 + type: isNuxtClient ? 'response' : 'responses', 165 + }); 166 + 167 + // TODO: transform parameters 168 + // const query = { 169 + // BarBaz: options.query.bar_baz, 170 + // qux_quux: options.query.qux_quux, 171 + // fooBar: options.query.foo_bar, 172 + // }; 173 + 174 + // if (operation.parameters) { 175 + // for (const name in operation.parameters.query) { 176 + // const parameter = operation.parameters.query[name] 177 + // if (parameter.name !== fieldName({ context, name: parameter.name })) { 178 + // console.warn(parameter.name) 179 + // } 180 + // } 181 + // } 182 + 183 + const requestOptions: ObjectValue[] = []; 184 + 185 + if (operation.body) { 186 + switch (operation.body.type) { 187 + case 'form-data': 188 + requestOptions.push({ spread: 'formDataBodySerializer' }); 189 + file.import({ 190 + module: clientModulePath({ 191 + config: context.config, 192 + sourceOutput: sdkOutput, 193 + }), 194 + name: 'formDataBodySerializer', 195 + }); 196 + break; 197 + case 'json': 198 + // jsonBodySerializer is the default, no need to specify 199 + break; 200 + case 'text': 201 + case 'octet-stream': 202 + // ensure we don't use any serializer by default 203 + requestOptions.push({ 204 + key: 'bodySerializer', 205 + value: null, 206 + }); 207 + break; 208 + case 'url-search-params': 209 + requestOptions.push({ spread: 'urlSearchParamsBodySerializer' }); 210 + file.import({ 211 + module: clientModulePath({ 212 + config: context.config, 213 + sourceOutput: sdkOutput, 214 + }), 215 + name: 'urlSearchParamsBodySerializer', 216 + }); 217 + break; 218 + } 219 + } 220 + 221 + if (client.name === '@hey-api/client-axios') { 222 + // try to infer `responseType` option for Axios. We don't need this in 223 + // Fetch API client because it automatically detects the correct response 224 + // during runtime. 225 + for (const statusCode in operation.responses) { 226 + // this doesn't handle default status code for now 227 + if (statusCodeToGroup({ statusCode }) === '2XX') { 228 + const response = operation.responses[statusCode]; 229 + const responseType = getResponseType(response?.mediaType); 230 + if (responseType) { 231 + requestOptions.push({ 232 + key: 'responseType', 233 + value: responseType, 234 + }); 235 + break; 236 + } 237 + } 238 + } 239 + } 240 + 241 + // TODO: parser - set parseAs to skip inference if every response has the same 242 + // content type. currently impossible because successes do not contain 243 + // header information 244 + 245 + const auth = operationAuth({ context, operation, plugin }); 246 + if (auth.length) { 247 + requestOptions.push({ 248 + key: 'security', 249 + value: compiler.arrayLiteralExpression({ elements: auth }), 250 + }); 251 + } 252 + 253 + for (const name in operation.parameters?.query) { 254 + const parameter = operation.parameters.query[name]!; 255 + if ( 256 + (parameter.schema.type === 'array' || 257 + parameter.schema.type === 'tuple') && 258 + (parameter.style !== 'form' || !parameter.explode) 259 + ) { 260 + // override the default settings for `querySerializer` 261 + requestOptions.push({ 262 + key: 'querySerializer', 263 + value: [ 264 + { 265 + key: 'array', 266 + value: [ 267 + { 268 + key: 'explode', 269 + value: false, 270 + }, 271 + { 272 + key: 'style', 273 + value: 'form', 274 + }, 275 + ], 276 + }, 277 + ], 278 + }); 279 + break; 280 + } 281 + } 282 + 283 + if (plugin.transformer === '@hey-api/transformers') { 284 + const identifierTransformer = context 285 + .file({ id: transformersId })! 286 + .identifier({ 287 + $ref: operationTransformerIrRef({ id: operation.id, type: 'response' }), 288 + namespace: 'value', 289 + }); 290 + 291 + if (identifierTransformer.name) { 292 + file.import({ 293 + module: file.relativePathToFile({ 294 + context, 295 + id: transformersId, 296 + }), 297 + name: identifierTransformer.name, 298 + }); 299 + 300 + requestOptions.push({ 301 + key: 'responseTransformer', 302 + value: identifierTransformer.name, 303 + }); 304 + } 305 + } 306 + 307 + const responseValidator = createResponseValidator({ 308 + context, 309 + operation, 310 + plugin, 311 + }); 312 + if (responseValidator) { 313 + requestOptions.push({ 314 + key: 'responseValidator', 315 + value: responseValidator, 316 + }); 317 + } 318 + 319 + if (plugin.responseStyle === 'data') { 320 + requestOptions.push({ 321 + key: 'responseStyle', 322 + value: plugin.responseStyle, 323 + }); 324 + } 325 + 326 + requestOptions.push({ 327 + key: 'url', 328 + value: operation.path, 329 + }); 330 + 331 + // options must go last to allow overriding parameters above 332 + requestOptions.push({ spread: 'options' }); 333 + 334 + if (operation.body) { 335 + const parameterContentType = operation.parameters?.header?.['content-type']; 336 + const hasRequiredContentType = Boolean(parameterContentType?.required); 337 + // spreading required Content-Type on generated header would throw a TypeScript error 338 + if (!hasRequiredContentType) { 339 + const spread = compiler.propertyAccessExpression({ 340 + expression: compiler.identifier({ text: 'options' }), 341 + isOptional: !isRequiredOptions, 342 + name: 'headers', 343 + }); 344 + requestOptions.push({ 345 + key: 'headers', 346 + value: [ 347 + { 348 + key: parameterContentType?.name ?? 'Content-Type', 349 + // form-data does not need Content-Type header, browser will set it automatically 350 + value: 351 + operation.body.type === 'form-data' 352 + ? null 353 + : operation.body.mediaType, 354 + }, 355 + { 356 + spread, 357 + }, 358 + ], 359 + }); 360 + } 361 + } 362 + 363 + const responseType = identifierResponse.name || 'unknown'; 364 + const errorType = identifierError.name || 'unknown'; 365 + 366 + const heyApiClient = plugin.client 367 + ? file.import({ 368 + alias: '_heyApiClient', 369 + module: file.relativePathToFile({ 370 + context, 371 + id: clientId, 372 + }), 373 + name: 'client', 374 + }) 375 + : undefined; 376 + 377 + const optionsClient = compiler.propertyAccessExpression({ 378 + expression: compiler.identifier({ text: 'options' }), 379 + isOptional: !isRequiredOptions, 380 + name: 'client', 381 + }); 382 + 383 + let clientExpression: ts.Expression; 384 + 385 + if (plugin.instance) { 386 + clientExpression = compiler.binaryExpression({ 387 + left: optionsClient, 388 + operator: '??', 389 + right: compiler.propertyAccessExpression({ 390 + expression: compiler.this(), 391 + name: 'client', 392 + }), 393 + }); 394 + } else if (heyApiClient?.name) { 395 + clientExpression = compiler.binaryExpression({ 396 + left: optionsClient, 397 + operator: '??', 398 + right: compiler.identifier({ text: heyApiClient.name }), 399 + }); 400 + } else { 401 + clientExpression = optionsClient; 402 + } 403 + 404 + const types: Array<string | ts.StringLiteral> = []; 405 + if (isNuxtClient) { 406 + types.push( 407 + nuxtTypeComposable, 408 + `${responseType} | ${nuxtTypeDefault}`, 409 + errorType, 410 + nuxtTypeDefault, 411 + ); 412 + } else { 413 + types.push(responseType, errorType, 'ThrowOnError'); 414 + } 415 + 416 + if (plugin.responseStyle === 'data') { 417 + types.push(compiler.stringLiteral({ text: plugin.responseStyle })); 418 + } 419 + 420 + return [ 421 + compiler.returnFunctionCall({ 422 + args: [ 423 + compiler.objectExpression({ 424 + identifiers: ['responseTransformer'], 425 + obj: requestOptions, 426 + }), 427 + ], 428 + name: compiler.propertyAccessExpression({ 429 + expression: clientExpression, 430 + name: compiler.identifier({ text: operation.method }), 431 + }), 432 + types, 433 + }), 434 + ]; 435 + };
+15 -3
packages/openapi-ts/src/plugins/@hey-api/sdk/plugin-legacy.ts
··· 26 26 import { escapeComment, escapeName } from '../../../utils/escape'; 27 27 import { reservedJavaScriptKeywordsRegExp } from '../../../utils/regexp'; 28 28 import { stringCase } from '../../../utils/stringCase'; 29 - import { transformServiceName } from '../../../utils/transform'; 29 + import { transformClassName } from '../../../utils/transform'; 30 30 import { setUniqueTypeName } from '../../../utils/type'; 31 31 import { unique } from '../../../utils/unique'; 32 32 import type { Plugin } from '../../types'; ··· 773 773 ]; 774 774 } 775 775 776 + const _members: Array<ts.ClassElement> = []; 777 + members.forEach((member, index) => { 778 + // add newline between each class member 779 + if (index) { 780 + // @ts-expect-error 781 + _members.push(compiler.identifier({ text: '\n' })); 782 + } 783 + 784 + _members.push(member); 785 + }); 786 + 776 787 const statement = compiler.classDeclaration({ 777 788 decorator: 778 789 clientPlugin.name === 'legacy/angular' 779 790 ? { args: [{ providedIn: 'root' }], name: 'Injectable' } 780 791 : undefined, 781 - members, 782 - name: transformServiceName({ 792 + exportClass: true, 793 + name: transformClassName({ 783 794 config, 784 795 name: service.name, 785 796 }), 797 + nodes: _members, 786 798 }); 787 799 onNode(statement); 788 800 };
+83 -520
packages/openapi-ts/src/plugins/@hey-api/sdk/plugin.ts
··· 1 - import type ts from 'typescript'; 1 + import ts from 'typescript'; 2 2 3 3 import { compiler } from '../../../compiler'; 4 - import type { ObjectValue } from '../../../compiler/types'; 5 4 import { clientApi, clientModulePath } from '../../../generate/client'; 6 - import type { TypeScriptFile } from '../../../generate/files'; 7 - import { statusCodeToGroup } from '../../../ir/operation'; 8 5 import type { IR } from '../../../ir/types'; 9 - import { getServiceName } from '../../../utils/postprocess'; 10 - import { transformServiceName } from '../../../utils/transform'; 6 + import { sanitizeNamespaceIdentifier } from '../../../openApi'; 7 + import { stringCase } from '../../../utils/stringCase'; 8 + import { transformClassName } from '../../../utils/transform'; 11 9 import { 12 10 createOperationComment, 13 11 isOperationOptionsRequired, 14 12 } from '../../shared/utils/operation'; 15 13 import type { Plugin } from '../../types'; 16 - import { clientId, getClientPlugin } from '../client-core/utils'; 14 + import { getClientPlugin } from '../client-core/utils'; 15 + import { importIdentifier } from '../typescript/ref'; 16 + import { nuxtTypeComposable, nuxtTypeDefault, sdkId } from './constants'; 17 17 import { 18 - operationTransformerIrRef, 19 - transformersId, 20 - } from '../transformers/plugin'; 21 - import { importIdentifier } from '../typescript/ref'; 22 - import { nuxtTypeComposable, nuxtTypeDefault } from './constants'; 18 + getOperationTags, 19 + operationOptionsType, 20 + operationStatements, 21 + } from './operation'; 23 22 import { serviceFunctionIdentifier } from './plugin-legacy'; 24 23 import { createTypeOptions } from './typeOptions'; 25 24 import type { Config } from './types'; 26 - import { createResponseValidator } from './validator'; 27 - 28 - // copy-pasted from @hey-api/client-core 29 - export interface Auth { 30 - /** 31 - * Which part of the request do we use to send the auth? 32 - * 33 - * @default 'header' 34 - */ 35 - in?: 'header' | 'query' | 'cookie'; 36 - /** 37 - * Header or query parameter name. 38 - * 39 - * @default 'Authorization' 40 - */ 41 - name?: string; 42 - scheme?: 'basic' | 'bearer'; 43 - type: 'apiKey' | 'http'; 44 - } 45 - 46 - export const operationOptionsType = ({ 47 - context, 48 - file, 49 - operation, 50 - throwOnError, 51 - }: { 52 - context: IR.Context; 53 - file: TypeScriptFile; 54 - operation: IR.OperationObject; 55 - throwOnError?: string; 56 - }) => { 57 - const client = getClientPlugin(context.config); 58 - const isNuxtClient = client.name === '@hey-api/client-nuxt'; 59 - 60 - const identifierData = importIdentifier({ 61 - context, 62 - file, 63 - operation, 64 - type: 'data', 65 - }); 66 - const identifierResponse = importIdentifier({ 67 - context, 68 - file, 69 - operation, 70 - type: isNuxtClient ? 'response' : 'responses', 71 - }); 72 - 73 - const optionsName = clientApi.Options.name; 74 - 75 - if (isNuxtClient) { 76 - return `${optionsName}<${nuxtTypeComposable}, ${identifierData.name || 'unknown'}, ${identifierResponse.name || 'unknown'}, ${nuxtTypeDefault}>`; 77 - } 78 - 79 - // TODO: refactor this to be more generic, works for now 80 - if (throwOnError) { 81 - return `${optionsName}<${identifierData.name || 'unknown'}, ${throwOnError}>`; 82 - } 83 - return identifierData.name 84 - ? `${optionsName}<${identifierData.name}>` 85 - : optionsName; 86 - }; 87 - 88 - export const sdkId = 'sdk'; 89 - 90 - /** 91 - * Infers `responseType` value from provided response content type. This is 92 - * an adapted version of `getParseAs()` from the Fetch API client. 93 - * 94 - * From Axios documentation: 95 - * `responseType` indicates the type of data that the server will respond with 96 - * options are: 'arraybuffer', 'document', 'json', 'text', 'stream' 97 - * browser only: 'blob' 98 - */ 99 - export const getResponseType = ( 100 - contentType: string | null | undefined, 101 - ): 102 - | 'arraybuffer' 103 - | 'blob' 104 - | 'document' 105 - | 'json' 106 - | 'stream' 107 - | 'text' 108 - | undefined => { 109 - if (!contentType) { 110 - return; 111 - } 112 - 113 - const cleanContent = contentType.split(';')[0]?.trim(); 114 - 115 - if (!cleanContent) { 116 - return; 117 - } 118 - 119 - if ( 120 - cleanContent.startsWith('application/json') || 121 - cleanContent.endsWith('+json') 122 - ) { 123 - return 'json'; 124 - } 125 - 126 - // Axios does not handle form data out of the box 127 - // if (cleanContent === 'multipart/form-data') { 128 - // return 'formData'; 129 - // } 130 - 131 - if ( 132 - ['application/', 'audio/', 'image/', 'video/'].some((type) => 133 - cleanContent.startsWith(type), 134 - ) 135 - ) { 136 - return 'blob'; 137 - } 138 - 139 - if (cleanContent.startsWith('text/')) { 140 - return 'text'; 141 - } 142 - }; 143 - 144 - // TODO: parser - handle more security types 145 - const securitySchemeObjectToAuthObject = ({ 146 - securitySchemeObject, 147 - }: { 148 - securitySchemeObject: IR.SecurityObject; 149 - }): Auth | undefined => { 150 - if (securitySchemeObject.type === 'openIdConnect') { 151 - return { 152 - scheme: 'bearer', 153 - type: 'http', 154 - }; 155 - } 156 - 157 - if (securitySchemeObject.type === 'oauth2') { 158 - if ( 159 - securitySchemeObject.flows.password || 160 - securitySchemeObject.flows.authorizationCode || 161 - securitySchemeObject.flows.clientCredentials || 162 - securitySchemeObject.flows.implicit 163 - ) { 164 - return { 165 - scheme: 'bearer', 166 - type: 'http', 167 - }; 168 - } 169 - 170 - return; 171 - } 172 - 173 - if (securitySchemeObject.type === 'apiKey') { 174 - if (securitySchemeObject.in === 'header') { 175 - return { 176 - name: securitySchemeObject.name, 177 - type: 'apiKey', 178 - }; 179 - } 180 - 181 - if ( 182 - securitySchemeObject.in === 'query' || 183 - securitySchemeObject.in == 'cookie' 184 - ) { 185 - return { 186 - in: securitySchemeObject.in, 187 - name: securitySchemeObject.name, 188 - type: 'apiKey', 189 - }; 190 - } 191 - 192 - return; 193 - } 194 - 195 - if (securitySchemeObject.type === 'http') { 196 - const scheme = securitySchemeObject.scheme.toLowerCase(); 197 - if (scheme === 'bearer' || scheme === 'basic') { 198 - return { 199 - scheme: scheme as 'bearer' | 'basic', 200 - type: 'http', 201 - }; 202 - } 203 - 204 - return; 205 - } 206 - }; 207 - 208 - const operationAuth = ({ 209 - operation, 210 - plugin, 211 - }: { 212 - context: IR.Context; 213 - operation: IR.OperationObject; 214 - plugin: Plugin.Instance<Config>; 215 - }): Array<Auth> => { 216 - if (!operation.security || !plugin.auth) { 217 - return []; 218 - } 219 - 220 - const auth: Array<Auth> = []; 221 - 222 - for (const securitySchemeObject of operation.security) { 223 - const authObject = securitySchemeObjectToAuthObject({ 224 - securitySchemeObject, 225 - }); 226 - if (authObject) { 227 - auth.push(authObject); 228 - } else { 229 - console.warn( 230 - `❗️ SDK warning: unsupported security scheme. Please open an issue if you'd like it added https://github.com/hey-api/openapi-ts/issues\n${JSON.stringify(securitySchemeObject, null, 2)}`, 231 - ); 232 - } 233 - } 234 - 235 - return auth; 236 - }; 237 - 238 - const operationStatements = ({ 239 - context, 240 - isRequiredOptions, 241 - operation, 242 - plugin, 243 - }: { 244 - context: IR.Context; 245 - isRequiredOptions: boolean; 246 - operation: IR.OperationObject; 247 - plugin: Plugin.Instance<Config>; 248 - }): Array<ts.Statement> => { 249 - const file = context.file({ id: sdkId })!; 250 - const sdkOutput = file.nameWithoutExtension(); 251 - 252 - const client = getClientPlugin(context.config); 253 - const isNuxtClient = client.name === '@hey-api/client-nuxt'; 254 - 255 - const identifierError = importIdentifier({ 256 - context, 257 - file, 258 - operation, 259 - type: isNuxtClient ? 'error' : 'errors', 260 - }); 261 - const identifierResponse = importIdentifier({ 262 - context, 263 - file, 264 - operation, 265 - type: isNuxtClient ? 'response' : 'responses', 266 - }); 267 - 268 - // TODO: transform parameters 269 - // const query = { 270 - // BarBaz: options.query.bar_baz, 271 - // qux_quux: options.query.qux_quux, 272 - // fooBar: options.query.foo_bar, 273 - // }; 274 - 275 - // if (operation.parameters) { 276 - // for (const name in operation.parameters.query) { 277 - // const parameter = operation.parameters.query[name] 278 - // if (parameter.name !== fieldName({ context, name: parameter.name })) { 279 - // console.warn(parameter.name) 280 - // } 281 - // } 282 - // } 283 - 284 - const requestOptions: ObjectValue[] = []; 285 - 286 - if (operation.body) { 287 - switch (operation.body.type) { 288 - case 'form-data': 289 - requestOptions.push({ spread: 'formDataBodySerializer' }); 290 - file.import({ 291 - module: clientModulePath({ 292 - config: context.config, 293 - sourceOutput: sdkOutput, 294 - }), 295 - name: 'formDataBodySerializer', 296 - }); 297 - break; 298 - case 'json': 299 - // jsonBodySerializer is the default, no need to specify 300 - break; 301 - case 'text': 302 - case 'octet-stream': 303 - // ensure we don't use any serializer by default 304 - requestOptions.push({ 305 - key: 'bodySerializer', 306 - value: null, 307 - }); 308 - break; 309 - case 'url-search-params': 310 - requestOptions.push({ spread: 'urlSearchParamsBodySerializer' }); 311 - file.import({ 312 - module: clientModulePath({ 313 - config: context.config, 314 - sourceOutput: sdkOutput, 315 - }), 316 - name: 'urlSearchParamsBodySerializer', 317 - }); 318 - break; 319 - } 320 - } 321 - 322 - if (client.name === '@hey-api/client-axios') { 323 - // try to infer `responseType` option for Axios. We don't need this in 324 - // Fetch API client because it automatically detects the correct response 325 - // during runtime. 326 - for (const statusCode in operation.responses) { 327 - // this doesn't handle default status code for now 328 - if (statusCodeToGroup({ statusCode }) === '2XX') { 329 - const response = operation.responses[statusCode]; 330 - const responseType = getResponseType(response?.mediaType); 331 - if (responseType) { 332 - requestOptions.push({ 333 - key: 'responseType', 334 - value: responseType, 335 - }); 336 - break; 337 - } 338 - } 339 - } 340 - } 341 - 342 - // TODO: parser - set parseAs to skip inference if every response has the same 343 - // content type. currently impossible because successes do not contain 344 - // header information 345 - 346 - const auth = operationAuth({ context, operation, plugin }); 347 - if (auth.length) { 348 - requestOptions.push({ 349 - key: 'security', 350 - value: compiler.arrayLiteralExpression({ elements: auth }), 351 - }); 352 - } 353 - 354 - for (const name in operation.parameters?.query) { 355 - const parameter = operation.parameters.query[name]!; 356 - if ( 357 - (parameter.schema.type === 'array' || 358 - parameter.schema.type === 'tuple') && 359 - (parameter.style !== 'form' || !parameter.explode) 360 - ) { 361 - // override the default settings for `querySerializer` 362 - requestOptions.push({ 363 - key: 'querySerializer', 364 - value: [ 365 - { 366 - key: 'array', 367 - value: [ 368 - { 369 - key: 'explode', 370 - value: false, 371 - }, 372 - { 373 - key: 'style', 374 - value: 'form', 375 - }, 376 - ], 377 - }, 378 - ], 379 - }); 380 - break; 381 - } 382 - } 383 - 384 - if (plugin.transformer === '@hey-api/transformers') { 385 - const identifierTransformer = context 386 - .file({ id: transformersId })! 387 - .identifier({ 388 - $ref: operationTransformerIrRef({ id: operation.id, type: 'response' }), 389 - namespace: 'value', 390 - }); 391 - 392 - if (identifierTransformer.name) { 393 - file.import({ 394 - module: file.relativePathToFile({ 395 - context, 396 - id: transformersId, 397 - }), 398 - name: identifierTransformer.name, 399 - }); 400 - 401 - requestOptions.push({ 402 - key: 'responseTransformer', 403 - value: identifierTransformer.name, 404 - }); 405 - } 406 - } 407 - 408 - const responseValidator = createResponseValidator({ 409 - context, 410 - operation, 411 - plugin, 412 - }); 413 - if (responseValidator) { 414 - requestOptions.push({ 415 - key: 'responseValidator', 416 - value: responseValidator, 417 - }); 418 - } 419 - 420 - if (plugin.responseStyle === 'data') { 421 - requestOptions.push({ 422 - key: 'responseStyle', 423 - value: plugin.responseStyle, 424 - }); 425 - } 426 - 427 - requestOptions.push({ 428 - key: 'url', 429 - value: operation.path, 430 - }); 431 - 432 - // options must go last to allow overriding parameters above 433 - requestOptions.push({ spread: 'options' }); 434 - 435 - if (operation.body) { 436 - const parameterContentType = operation.parameters?.header?.['content-type']; 437 - const hasRequiredContentType = Boolean(parameterContentType?.required); 438 - // spreading required Content-Type on generated header would throw a TypeScript error 439 - if (!hasRequiredContentType) { 440 - const spread = compiler.propertyAccessExpression({ 441 - expression: compiler.identifier({ text: 'options' }), 442 - isOptional: !isRequiredOptions, 443 - name: 'headers', 444 - }); 445 - requestOptions.push({ 446 - key: 'headers', 447 - value: [ 448 - { 449 - key: parameterContentType?.name ?? 'Content-Type', 450 - // form-data does not need Content-Type header, browser will set it automatically 451 - value: 452 - operation.body.type === 'form-data' 453 - ? null 454 - : operation.body.mediaType, 455 - }, 456 - { 457 - spread, 458 - }, 459 - ], 460 - }); 461 - } 462 - } 463 - 464 - const responseType = identifierResponse.name || 'unknown'; 465 - const errorType = identifierError.name || 'unknown'; 466 - 467 - const heyApiClient = plugin.client 468 - ? file.import({ 469 - alias: '_heyApiClient', 470 - module: file.relativePathToFile({ 471 - context, 472 - id: clientId, 473 - }), 474 - name: 'client', 475 - }) 476 - : undefined; 477 - 478 - const optionsClient = compiler.propertyAccessExpression({ 479 - expression: compiler.identifier({ text: 'options' }), 480 - isOptional: !isRequiredOptions, 481 - name: 'client', 482 - }); 483 - 484 - const types: Array<string | ts.StringLiteral> = []; 485 - if (isNuxtClient) { 486 - types.push( 487 - nuxtTypeComposable, 488 - `${responseType} | ${nuxtTypeDefault}`, 489 - errorType, 490 - nuxtTypeDefault, 491 - ); 492 - } else { 493 - types.push(responseType, errorType, 'ThrowOnError'); 494 - } 495 - 496 - if (plugin.responseStyle === 'data') { 497 - types.push(compiler.stringLiteral({ text: plugin.responseStyle })); 498 - } 499 - 500 - return [ 501 - compiler.returnFunctionCall({ 502 - args: [ 503 - compiler.objectExpression({ 504 - identifiers: ['responseTransformer'], 505 - obj: requestOptions, 506 - }), 507 - ], 508 - name: compiler.propertyAccessExpression({ 509 - expression: heyApiClient?.name 510 - ? compiler.binaryExpression({ 511 - left: optionsClient, 512 - operator: '??', 513 - right: compiler.identifier({ text: heyApiClient.name }), 514 - }) 515 - : optionsClient, 516 - name: compiler.identifier({ text: operation.method }), 517 - }), 518 - types, 519 - }), 520 - ]; 521 - }; 522 25 523 26 const generateClassSdk = ({ 524 27 context, ··· 530 33 const client = getClientPlugin(context.config); 531 34 const isNuxtClient = client.name === '@hey-api/client-nuxt'; 532 35 const file = context.file({ id: sdkId })!; 533 - const sdks = new Map<string, Array<ts.MethodDeclaration>>(); 36 + const sdks = new Map<string, Array<ts.ClassElement>>(); 534 37 535 38 context.subscribe('operation', ({ operation }) => { 536 39 const isRequiredOptions = isOperationOptionsRequired({ ··· 546 49 const node = compiler.methodDeclaration({ 547 50 accessLevel: 'public', 548 51 comment: createOperationComment({ operation }), 549 - isStatic: true, 52 + isStatic: !plugin.instance, 550 53 name: serviceFunctionIdentifier({ 551 54 config: context.config, 552 55 handleIllegal: false, ··· 604 107 ], 605 108 }); 606 109 607 - const uniqueTags = Array.from(new Set(operation.tags)); 608 - if (!uniqueTags.length) { 609 - uniqueTags.push('default'); 610 - } 611 - 612 - for (const tag of uniqueTags) { 613 - const name = getServiceName(tag); 110 + const tags = getOperationTags({ operation, plugin }); 111 + for (const tag of tags) { 112 + const name = stringCase({ 113 + case: 'PascalCase', 114 + value: sanitizeNamespaceIdentifier(tag), 115 + }); 614 116 const nodes = sdks.get(name) ?? []; 117 + if (nodes.length) { 118 + // @ts-expect-error 119 + nodes.push(compiler.identifier({ text: '\n' })); 120 + } 615 121 nodes.push(node); 616 122 sdks.set(name, nodes); 617 123 } ··· 619 125 620 126 context.subscribe('after', () => { 621 127 for (const [name, nodes] of sdks) { 128 + if (plugin.instance) { 129 + const clientAssignmentStatement = compiler.expressionToStatement({ 130 + expression: compiler.binaryExpression({ 131 + left: compiler.propertyAccessExpression({ 132 + expression: compiler.this(), 133 + name: 'client', 134 + }), 135 + operator: '=', 136 + right: compiler.identifier({ text: 'client' }), 137 + }), 138 + }); 139 + nodes.unshift( 140 + compiler.propertyDeclaration({ 141 + initializer: plugin.client 142 + ? compiler.identifier({ text: '_heyApiClient' }) 143 + : undefined, 144 + name: 'client', 145 + type: ts.factory.createTypeReferenceNode('Client'), 146 + }), 147 + // @ts-expect-error 148 + compiler.identifier({ text: '\n' }), 149 + compiler.constructorDeclaration({ 150 + multiLine: true, 151 + parameters: [ 152 + { 153 + destructure: [ 154 + { 155 + name: 'client', 156 + }, 157 + ], 158 + type: compiler.typeInterfaceNode({ 159 + properties: [ 160 + { 161 + isRequired: !plugin.client, 162 + name: 'client', 163 + type: 'Client', 164 + }, 165 + ], 166 + useLegacyResolution: false, 167 + }), 168 + }, 169 + ], 170 + statements: [ 171 + !plugin.client 172 + ? clientAssignmentStatement 173 + : compiler.ifStatement({ 174 + expression: compiler.identifier({ text: 'client' }), 175 + thenStatement: compiler.block({ 176 + statements: [clientAssignmentStatement], 177 + }), 178 + }), 179 + ], 180 + }), 181 + compiler.identifier({ text: '\n' }), 182 + ); 183 + } 184 + 622 185 const node = compiler.classDeclaration({ 623 - decorator: undefined, 624 - members: nodes, 625 - name: transformServiceName({ 186 + exportClass: true, 187 + name: transformClassName({ 626 188 config: context.config, 627 189 name, 628 190 }), 191 + nodes, 629 192 }); 630 193 file.add(node); 631 194 }
+18 -12
packages/openapi-ts/src/plugins/@hey-api/sdk/types.d.ts
··· 8 8 9 9 export interface Config extends Plugin.Name<'@hey-api/sdk'> { 10 10 /** 11 - * Group operation methods into classes? When enabled, you can 12 - * select which classes to export with `sdk.include` and/or 13 - * transform their names with `sdk.serviceNameBuilder`. 11 + * Group operation methods into classes? When enabled, you can select which 12 + * classes to export with `sdk.include` and/or transform their names with 13 + * `sdk.classNameBuilder`. 14 14 * 15 15 * Note that by enabling this option, your SDKs will **NOT** 16 16 * support {@link https://developer.mozilla.org/docs/Glossary/Tree_shaking tree-shaking}. ··· 28 28 */ 29 29 auth?: boolean; 30 30 /** 31 + * Customize the generated class names. The name variable is obtained from 32 + * your OpenAPI specification tags or `instance` value. 33 + * 34 + * This option has no effect if `sdk.asClass` is `false`. 35 + */ 36 + classNameBuilder?: string | ((name: string) => string); 37 + /** 31 38 * Use an internal client instance to send HTTP requests? This is useful if 32 39 * you don't want to manually pass the client to each SDK function. 33 40 * ··· 53 60 */ 54 61 include?: string; 55 62 /** 63 + * Set `instance` to create an instantiable SDK. Using `true` will use the 64 + * default instance name; in practice, you want to define your own by passing 65 + * a string value. 66 + * 67 + * @default false 68 + */ 69 + instance?: string | boolean; 70 + /** 56 71 * Customise the name of methods within the service. By default, {@link IR.OperationObject.id} or {@link Operation.name} is used. 57 72 */ 58 73 methodNameBuilder?: (operation: IR.OperationObject | Operation) => string; ··· 77 92 * @default 'fields' 78 93 */ 79 94 responseStyle?: 'data' | 'fields'; 80 - /** 81 - * Customize the generated service class names. The name variable is 82 - * obtained from your OpenAPI specification tags. 83 - * 84 - * This option has no effect if `sdk.asClass` is `false`. 85 - * 86 - * @default '{{name}}Service' 87 - */ 88 - serviceNameBuilder?: string | ((name: string) => string); 89 95 /** 90 96 * Transform response data before returning. This is useful if you want to 91 97 * convert for example ISO strings into Date objects. However, transformation
+2 -2
packages/openapi-ts/src/plugins/@tanstack/query-core/plugin-legacy.ts
··· 19 19 import type { Config } from '../../../types/config'; 20 20 import type { Files } from '../../../types/utils'; 21 21 import { getConfig, isLegacyClient } from '../../../utils/config'; 22 - import { transformServiceName } from '../../../utils/transform'; 22 + import { transformClassName } from '../../../utils/transform'; 23 23 import { 24 24 getClientBaseUrlKey, 25 25 getClientPlugin, ··· 720 720 721 721 const queryFn = [ 722 722 config.plugins['@hey-api/sdk']?.asClass && 723 - transformServiceName({ 723 + transformClassName({ 724 724 config, 725 725 name: service.name, 726 726 }),
+12 -6
packages/openapi-ts/src/plugins/@tanstack/query-core/plugin.ts
··· 1 1 import { clientApi } from '../../../generate/client'; 2 - import { getServiceName } from '../../../utils/postprocess'; 3 - import { transformServiceName } from '../../../utils/transform'; 2 + import { stringCase } from '../../../utils/stringCase'; 3 + import { transformClassName } from '../../../utils/transform'; 4 4 import { clientId } from '../../@hey-api/client-core/utils'; 5 5 import { sdkId } from '../../@hey-api/sdk/constants'; 6 + import { getOperationTags } from '../../@hey-api/sdk/operation'; 6 7 import { serviceFunctionIdentifier } from '../../@hey-api/sdk/plugin-legacy'; 7 8 import { createInfiniteQueryOptions } from './infiniteQueryOptions'; 8 9 import { createMutationOptions } from './mutationOptions'; ··· 36 37 context.subscribe('operation', ({ operation }) => { 37 38 state.hasUsedQueryFn = false; 38 39 40 + const sdk = context.config.plugins['@hey-api/sdk']; 39 41 const queryFn = [ 40 - context.config.plugins['@hey-api/sdk']?.asClass && 41 - transformServiceName({ 42 + sdk?.asClass && 43 + transformClassName({ 42 44 config: context.config, 43 - name: getServiceName(operation.tags?.[0] || 'default'), 45 + name: stringCase({ 46 + case: 'PascalCase', 47 + value: getOperationTags({ operation, plugin: sdk }).values().next() 48 + .value!, 49 + }), 44 50 }), 45 51 serviceFunctionIdentifier({ 46 52 config: context.config, 47 - handleIllegal: !context.config.plugins['@hey-api/sdk']?.asClass, 53 + handleIllegal: !sdk?.asClass, 48 54 id: operation.id, 49 55 operation, 50 56 }),
+1 -1
packages/openapi-ts/src/plugins/@tanstack/query-core/useType.ts
··· 1 1 import type { ImportExportItemObject } from '../../../compiler/utils'; 2 2 import type { IR } from '../../../ir/types'; 3 3 import { getClientPlugin } from '../../@hey-api/client-core/utils'; 4 - import { operationOptionsType } from '../../@hey-api/sdk/plugin'; 4 + import { operationOptionsType } from '../../@hey-api/sdk/operation'; 5 5 import { importIdentifier } from '../../@hey-api/typescript/ref'; 6 6 import type { PluginInstance } from './types'; 7 7
+1 -1
packages/openapi-ts/src/plugins/shared/utils/operation.ts
··· 37 37 const isNuxtClient = client.name === '@hey-api/client-nuxt'; 38 38 const plugin = context.config.plugins['@hey-api/sdk']; 39 39 return ( 40 - (plugin && !plugin.client) || 40 + (plugin && !plugin.client && !plugin.instance) || 41 41 isNuxtClient || 42 42 hasOperationDataRequired(operation) 43 43 );
+2 -2
packages/openapi-ts/src/utils/handlebars.ts
··· 90 90 import xhrSendRequest from '../legacy/handlebars/compiled/core/xhr/sendRequest.js'; 91 91 import { getConfig } from './config'; 92 92 import { stringCase } from './stringCase'; 93 - import { transformServiceName } from './transform'; 93 + import { transformClassName } from './transform'; 94 94 95 95 export const registerHandlebarHelpers = (): void => { 96 96 Handlebars.registerHelper( ··· 147 147 Handlebars.registerHelper( 148 148 'transformServiceName', 149 149 function (this: unknown, name: string) { 150 - return transformServiceName({ 150 + return transformClassName({ 151 151 config: getConfig(), 152 152 name, 153 153 });
+5 -5
packages/openapi-ts/src/utils/transform.ts
··· 4 4 import { reservedJavaScriptKeywordsRegExp } from './regexp'; 5 5 import { stringCase } from './stringCase'; 6 6 7 - export const transformServiceName = ({ 7 + export const transformClassName = ({ 8 8 config, 9 9 name, 10 10 }: { ··· 12 12 name: string; 13 13 }) => { 14 14 const plugin = config.plugins['@hey-api/sdk']; 15 - if (plugin?.serviceNameBuilder) { 15 + if (plugin?.classNameBuilder) { 16 16 let customName = ''; 17 17 18 - if (typeof plugin.serviceNameBuilder === 'function') { 19 - customName = plugin.serviceNameBuilder(name); 18 + if (typeof plugin.classNameBuilder === 'function') { 19 + customName = plugin.classNameBuilder(name); 20 20 } else { 21 - customName = plugin.serviceNameBuilder.replace('{{name}}', name); 21 + customName = plugin.classNameBuilder.replace('{{name}}', name); 22 22 } 23 23 24 24 return customName;