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

refactor: client plugin use dsl

Lubos f659b061 c01801f1

+2644 -2474
+4 -4
dev/openapi-ts.config.ts
··· 40 40 // 'circular.yaml', 41 41 // 'dutchie.json', 42 42 // 'invalid', 43 - 'full.yaml', 43 + // 'full.yaml', 44 44 // 'openai.yaml', 45 45 // 'opencode.yaml', 46 46 // 'pagination-ref.yaml', 47 47 // 'sdk-instance.yaml', 48 48 // 'string-with-format.yaml', 49 - // 'transformers.json', 49 + 'transformers.json', 50 50 // 'type-format.yaml', 51 51 // 'validators.yaml', 52 52 // 'validators-circular-ref.json', ··· 216 216 { 217 217 // baseUrl: false, 218 218 // exportFromIndex: true, 219 - name: '@hey-api/client-nuxt', 219 + name: '@hey-api/client-fetch', 220 220 // runtimeConfigPath: path.resolve(__dirname, 'hey-api.ts'), 221 221 // runtimeConfigPath: './src/hey-api.ts', 222 222 // strictBaseUrl: true, ··· 292 292 { 293 293 // bigInt: true, 294 294 dates: true, 295 - // name: '@hey-api/transformers', 295 + name: '@hey-api/transformers', 296 296 }, 297 297 { 298 298 // name: 'fastify',
+1 -3
examples/openapi-ts-fastify/src/client/client.gen.ts
··· 21 21 ) => Config<Required<ClientOptions> & T>; 22 22 23 23 export const client = createClient( 24 - createConfig<ClientOptions2>({ 25 - baseUrl: 'http://petstore.swagger.io/v1', 26 - }), 24 + createConfig<ClientOptions2>({ baseUrl: 'http://petstore.swagger.io/v1' }), 27 25 );
+1 -3
examples/openapi-ts-openai/src/client/client.gen.ts
··· 21 21 ) => Config<Required<ClientOptions> & T>; 22 22 23 23 export const client = createClient( 24 - createConfig<ClientOptions2>({ 25 - baseUrl: 'https://api.openai.com/v1', 26 - }), 24 + createConfig<ClientOptions2>({ baseUrl: 'https://api.openai.com/v1' }), 27 25 );
+1 -3
examples/openapi-ts-pinia-colada/src/client/client.gen.ts
··· 16 16 ) => Config<Required<ClientOptions> & T> 17 17 18 18 export const client = createClient( 19 - createConfig<ClientOptions2>({ 20 - baseUrl: 'https://petstore3.swagger.io/api/v3' 21 - }) 19 + createConfig<ClientOptions2>({ baseUrl: 'https://petstore3.swagger.io/api/v3' }) 22 20 )
+1 -3
examples/openapi-ts-tanstack-vue-query/src/client/client.gen.ts
··· 16 16 ) => Config<Required<ClientOptions> & T> 17 17 18 18 export const client = createClient( 19 - createConfig<ClientOptions2>({ 20 - baseUrl: 'https://petstore3.swagger.io/api/v3' 21 - }) 19 + createConfig<ClientOptions2>({ baseUrl: 'https://petstore3.swagger.io/api/v3' }) 22 20 )
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@angular/common/default-class/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@angular/common/default/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/client-fetch/sdk-nested-classes-instance/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'https://api.example.com/v1' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "https://api.example.com/v1" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/client-fetch/sdk-nested-classes/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'https://api.example.com/v1' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "https://api.example.com/v1" }));
+348 -273
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/schemas/default/schemas.gen.ts
··· 1 1 // This file is auto-generated by @hey-api/openapi-ts 2 2 3 3 export const ExternalRefASchema = { 4 - description: 'External ref to shared model (A)', 5 - '$ref': '#/definitions/external-shared_ExternalSharedModel' 4 + description: "External ref to shared model (A)", 5 + '$ref': "#/definitions/external-shared_ExternalSharedModel" 6 6 } as const; 7 7 8 8 export const ExternalRefBSchema = { 9 - description: 'External ref to shared model (B)', 10 - '$ref': '#/definitions/external-shared_ExternalSharedModel' 9 + description: "External ref to shared model (B)", 10 + '$ref': "#/definitions/external-shared_ExternalSharedModel" 11 11 } as const; 12 12 13 13 export const CommentWithBreaksSchema = { 14 - description: `Testing multiline comments in string: First line 15 - Second line 16 - 17 - Fourth line`, 18 - type: 'integer' 14 + description: "Testing multiline comments in string: First line\nSecond line\n\nFourth line", 15 + type: "integer" 19 16 } as const; 20 17 21 18 export const CommentWithBackticksSchema = { 22 - description: 'Testing backticks in string: `backticks` and ```multiple backticks``` should work', 23 - type: 'integer' 19 + description: "Testing backticks in string: `backticks` and ```multiple backticks``` should work", 20 + type: "integer" 24 21 } as const; 25 22 26 23 export const CommentWithBackticksAndQuotesSchema = { 27 - description: `Testing backticks and quotes in string: \`backticks\`, 'quotes', "double quotes" and \`\`\`multiple backticks\`\`\` should work`, 28 - type: 'integer' 24 + description: "Testing backticks and quotes in string: `backticks`, 'quotes', \"double quotes\" and ```multiple backticks``` should work", 25 + type: "integer" 29 26 } as const; 30 27 31 28 export const CommentWithSlashesSchema = { 32 - description: 'Testing slashes in string: \\backwards\\\\\\ and /forwards/// should work', 33 - type: 'integer' 29 + description: "Testing slashes in string: \\backwards\\\\\\ and /forwards/// should work", 30 + type: "integer" 34 31 } as const; 35 32 36 33 export const CommentWithExpressionPlaceholdersSchema = { 37 - description: 'Testing expression placeholders in string: ${expression} should work', 38 - type: 'integer' 34 + description: "Testing expression placeholders in string: ${expression} should work", 35 + type: "integer" 39 36 } as const; 40 37 41 38 export const CommentWithQuotesSchema = { 42 - description: `Testing quotes in string: 'single quote''' and "double quotes""" should work`, 43 - type: 'integer' 39 + description: "Testing quotes in string: 'single quote''' and \"double quotes\"\"\" should work", 40 + type: "integer" 44 41 } as const; 45 42 46 43 export const CommentWithReservedCharactersSchema = { 47 - description: 'Testing reserved characters in string: /* inline */ and /** inline **/ should work', 48 - type: 'integer' 44 + description: "Testing reserved characters in string: /* inline */ and /** inline **/ should work", 45 + type: "integer" 49 46 } as const; 50 47 51 48 export const SimpleIntegerSchema = { 52 - description: 'This is a simple number', 53 - type: 'integer' 49 + description: "This is a simple number", 50 + type: "integer" 54 51 } as const; 55 52 56 53 export const SimpleBooleanSchema = { 57 - description: 'This is a simple boolean', 58 - type: 'boolean' 54 + description: "This is a simple boolean", 55 + type: "boolean" 59 56 } as const; 60 57 61 58 export const SimpleStringSchema = { 62 - description: 'This is a simple string', 63 - type: 'string' 59 + description: "This is a simple string", 60 + type: "string" 64 61 } as const; 65 62 66 63 export const NonAsciiStringæøåÆØÅöôêÊ字符串Schema = { 67 - description: 'A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串)', 68 - type: 'string' 64 + description: "A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串)", 65 + type: "string" 69 66 } as const; 70 67 71 68 export const SimpleFileSchema = { 72 - description: 'This is a simple file', 73 - format: 'binary', 74 - type: 'string' 69 + description: "This is a simple file", 70 + format: "binary", 71 + type: "string" 75 72 } as const; 76 73 77 74 export const SimpleReferenceSchema = { 78 - description: 'This is a simple reference', 79 - '$ref': '#/definitions/ModelWithString' 75 + description: "This is a simple reference", 76 + '$ref': "#/definitions/ModelWithString" 80 77 } as const; 81 78 82 79 export const SimpleStringWithPatternSchema = { 83 - description: 'This is a simple string', 84 - type: 'string', 80 + description: "This is a simple string", 81 + type: "string", 85 82 maxLength: 64, 86 - pattern: '^[a-zA-Z0-9_]*$' 83 + pattern: "^[a-zA-Z0-9_]*$" 87 84 } as const; 88 85 89 86 export const EnumWithStringsSchema = { 90 - description: 'This is a simple enum with strings', 91 - enum: ['Success', 'Warning', 'Error', "'Single Quote'", '"Double Quotes"', 'Non-ascii: øæåôöØÆÅÔÖ字符串'] 87 + description: "This is a simple enum with strings", 88 + enum: [ 89 + "Success", 90 + "Warning", 91 + "Error", 92 + "'Single Quote'", 93 + "\"Double Quotes\"", 94 + "Non-ascii: øæåôöØÆÅÔÖ字符串" 95 + ] 92 96 } as const; 93 97 94 98 export const EnumWithNumbersSchema = { 95 - description: 'This is a simple enum with numbers', 96 - enum: [1, 2, 3, 1.1, 1.2, 1.3, 100, 200, 300, -100, -200, -300, -1.1, -1.2, -1.3] 99 + description: "This is a simple enum with numbers", 100 + enum: [ 101 + 1, 102 + 2, 103 + 3, 104 + 1.1, 105 + 1.2, 106 + 1.3, 107 + 100, 108 + 200, 109 + 300, 110 + -100, 111 + -200, 112 + -300, 113 + -1.1, 114 + -1.2, 115 + -1.3 116 + ] 97 117 } as const; 98 118 99 119 export const EnumFromDescriptionSchema = { 100 - description: 'Success=1,Warning=2,Error=3', 101 - type: 'number' 120 + description: "Success=1,Warning=2,Error=3", 121 + type: "number" 102 122 } as const; 103 123 104 124 export const EnumWithExtensionsSchema = { 105 - description: 'This is a simple enum with numbers', 106 - enum: [200, 400, 500], 107 - 'x-enum-varnames': ['CUSTOM_SUCCESS', 'CUSTOM_WARNING', 'CUSTOM_ERROR'], 108 - 'x-enum-descriptions': ['Used when the status of something is successful', 'Used when the status of something has a warning', 'Used when the status of something has an error'] 125 + description: "This is a simple enum with numbers", 126 + enum: [ 127 + 200, 128 + 400, 129 + 500 130 + ], 131 + 'x-enum-varnames': [ 132 + "CUSTOM_SUCCESS", 133 + "CUSTOM_WARNING", 134 + "CUSTOM_ERROR" 135 + ], 136 + 'x-enum-descriptions': [ 137 + "Used when the status of something is successful", 138 + "Used when the status of something has a warning", 139 + "Used when the status of something has an error" 140 + ] 109 141 } as const; 110 142 111 143 export const ArrayWithNumbersSchema = { 112 - description: 'This is a simple array with numbers', 113 - type: 'array', 144 + description: "This is a simple array with numbers", 145 + type: "array", 114 146 items: { 115 - type: 'integer' 147 + type: "integer" 116 148 } 117 149 } as const; 118 150 119 151 export const ArrayWithBooleansSchema = { 120 - description: 'This is a simple array with booleans', 121 - type: 'array', 152 + description: "This is a simple array with booleans", 153 + type: "array", 122 154 items: { 123 - type: 'boolean' 155 + type: "boolean" 124 156 } 125 157 } as const; 126 158 127 159 export const ArrayWithStringsSchema = { 128 - description: 'This is a simple array with strings', 129 - type: 'array', 160 + description: "This is a simple array with strings", 161 + type: "array", 130 162 items: { 131 - type: 'string' 163 + type: "string" 132 164 } 133 165 } as const; 134 166 135 167 export const ArrayWithReferencesSchema = { 136 - description: 'This is a simple array with references', 137 - type: 'array', 168 + description: "This is a simple array with references", 169 + type: "array", 138 170 items: { 139 - '$ref': '#/definitions/ModelWithString' 171 + '$ref': "#/definitions/ModelWithString" 140 172 } 141 173 } as const; 142 174 143 175 export const ArrayWithArraySchema = { 144 - description: 'This is a simple array containing an array', 145 - type: 'array', 176 + description: "This is a simple array containing an array", 177 + type: "array", 146 178 items: { 147 - type: 'array', 179 + type: "array", 148 180 items: { 149 - '$ref': '#/definitions/ModelWithString' 181 + '$ref': "#/definitions/ModelWithString" 150 182 } 151 183 } 152 184 } as const; 153 185 154 186 export const ArrayWithPropertiesSchema = { 155 - description: 'This is a simple array with properties', 156 - type: 'array', 187 + description: "This is a simple array with properties", 188 + type: "array", 157 189 items: { 158 - type: 'object', 190 + type: "object", 159 191 properties: { 160 192 foo: { 161 - type: 'string' 193 + type: "string" 162 194 }, 163 195 bar: { 164 - type: 'string' 196 + type: "string" 165 197 } 166 198 } 167 199 } 168 200 } as const; 169 201 170 202 export const DictionaryWithStringSchema = { 171 - description: 'This is a string dictionary', 172 - type: 'object', 203 + description: "This is a string dictionary", 204 + type: "object", 173 205 additionalProperties: { 174 - type: 'string' 206 + type: "string" 175 207 } 176 208 } as const; 177 209 178 210 export const DictionaryWithReferenceSchema = { 179 - description: 'This is a string reference', 180 - type: 'object', 211 + description: "This is a string reference", 212 + type: "object", 181 213 additionalProperties: { 182 - '$ref': '#/definitions/ModelWithString' 214 + '$ref': "#/definitions/ModelWithString" 183 215 } 184 216 } as const; 185 217 186 218 export const DictionaryWithArraySchema = { 187 - description: 'This is a complex dictionary', 188 - type: 'object', 219 + description: "This is a complex dictionary", 220 + type: "object", 189 221 additionalProperties: { 190 - type: 'array', 222 + type: "array", 191 223 items: { 192 - '$ref': '#/definitions/ModelWithString' 224 + '$ref': "#/definitions/ModelWithString" 193 225 } 194 226 } 195 227 } as const; 196 228 197 229 export const DictionaryWithDictionarySchema = { 198 - description: 'This is a string dictionary', 199 - type: 'object', 230 + description: "This is a string dictionary", 231 + type: "object", 200 232 additionalProperties: { 201 - type: 'object', 233 + type: "object", 202 234 additionalProperties: { 203 - type: 'string' 235 + type: "string" 204 236 } 205 237 } 206 238 } as const; 207 239 208 240 export const DictionaryWithPropertiesSchema = { 209 - description: 'This is a complex dictionary', 210 - type: 'object', 241 + description: "This is a complex dictionary", 242 + type: "object", 211 243 additionalProperties: { 212 - type: 'object', 244 + type: "object", 213 245 properties: { 214 246 foo: { 215 - type: 'string' 247 + type: "string" 216 248 }, 217 249 bar: { 218 - type: 'string' 250 + type: "string" 219 251 } 220 252 } 221 253 } 222 254 } as const; 223 255 224 256 export const DateSchema = { 225 - description: 'This is a type-only model that defines Date as a string', 226 - type: 'string' 257 + description: "This is a type-only model that defines Date as a string", 258 + type: "string" 227 259 } as const; 228 260 229 261 export const ModelWithIntegerSchema = { 230 - description: 'This is a model with one number property', 231 - type: 'object', 262 + description: "This is a model with one number property", 263 + type: "object", 232 264 properties: { 233 265 prop: { 234 - description: 'This is a simple number property', 235 - type: 'integer' 266 + description: "This is a simple number property", 267 + type: "integer" 236 268 } 237 269 } 238 270 } as const; 239 271 240 272 export const ModelWithBooleanSchema = { 241 - description: 'This is a model with one boolean property', 242 - type: 'object', 273 + description: "This is a model with one boolean property", 274 + type: "object", 243 275 properties: { 244 276 prop: { 245 - description: 'This is a simple boolean property', 246 - type: 'boolean' 277 + description: "This is a simple boolean property", 278 + type: "boolean" 247 279 } 248 280 } 249 281 } as const; 250 282 251 283 export const ModelWithStringSchema = { 252 - description: 'This is a model with one string property', 253 - type: 'object', 284 + description: "This is a model with one string property", 285 + type: "object", 254 286 properties: { 255 287 prop: { 256 - description: 'This is a simple string property', 257 - type: 'string' 288 + description: "This is a simple string property", 289 + type: "string" 258 290 } 259 291 } 260 292 } as const; 261 293 262 294 export const ModelWithStringErrorSchema = { 263 - description: 'This is a model with one string property', 264 - type: 'object', 295 + description: "This is a model with one string property", 296 + type: "object", 265 297 properties: { 266 298 prop: { 267 - description: 'This is a simple string property', 268 - type: 'string' 299 + description: "This is a simple string property", 300 + type: "string" 269 301 } 270 302 } 271 303 } as const; 272 304 273 305 export const ModelWithNullableStringSchema = { 274 - description: 'This is a model with one string property', 275 - type: 'object', 276 - required: ['nullableRequiredProp'], 306 + description: "This is a model with one string property", 307 + type: "object", 308 + required: [ 309 + "nullableRequiredProp" 310 + ], 277 311 properties: { 278 312 nullableProp: { 279 - description: 'This is a simple string property', 280 - type: 'string', 313 + description: "This is a simple string property", 314 + type: "string", 281 315 'x-nullable': true 282 316 }, 283 317 nullableRequiredProp: { 284 - description: 'This is a simple string property', 285 - type: 'string', 318 + description: "This is a simple string property", 319 + type: "string", 286 320 'x-nullable': true 287 321 } 288 322 } 289 323 } as const; 290 324 291 325 export const ModelWithEnumSchema = { 292 - description: 'This is a model with one enum', 293 - type: 'object', 326 + description: "This is a model with one enum", 327 + type: "object", 294 328 properties: { 295 329 test: { 296 - description: 'This is a simple enum with strings', 297 - enum: ['Success', 'Warning', 'Error', 'ØÆÅ字符串'] 330 + description: "This is a simple enum with strings", 331 + enum: [ 332 + "Success", 333 + "Warning", 334 + "Error", 335 + "ØÆÅ字符串" 336 + ] 298 337 }, 299 338 statusCode: { 300 - description: 'These are the HTTP error code enums', 301 - enum: ['100', '200 FOO', '300 FOO_BAR', '400 foo-bar', '500 foo.bar', '600 foo&bar'] 339 + description: "These are the HTTP error code enums", 340 + enum: [ 341 + "100", 342 + "200 FOO", 343 + "300 FOO_BAR", 344 + "400 foo-bar", 345 + "500 foo.bar", 346 + "600 foo&bar" 347 + ] 302 348 }, 303 349 bool: { 304 - description: 'Simple boolean enum', 305 - type: 'boolean', 306 - enum: [true] 350 + description: "Simple boolean enum", 351 + type: "boolean", 352 + enum: [ 353 + true 354 + ] 307 355 } 308 356 } 309 357 } as const; 310 358 311 359 export const ModelWithEnumFromDescriptionSchema = { 312 - description: 'This is a model with one enum', 313 - type: 'object', 360 + description: "This is a model with one enum", 361 + type: "object", 314 362 properties: { 315 363 test: { 316 - type: 'integer', 317 - description: 'Success=1,Warning=2,Error=3' 364 + type: "integer", 365 + description: "Success=1,Warning=2,Error=3" 318 366 } 319 367 } 320 368 } as const; 321 369 322 370 export const ModelWithNestedEnumsSchema = { 323 - description: 'This is a model with nested enums', 324 - type: 'object', 371 + description: "This is a model with nested enums", 372 + type: "object", 325 373 properties: { 326 374 dictionaryWithEnum: { 327 - type: 'object', 375 + type: "object", 328 376 additionalProperties: { 329 - enum: ['Success', 'Warning', 'Error'] 377 + enum: [ 378 + "Success", 379 + "Warning", 380 + "Error" 381 + ] 330 382 } 331 383 }, 332 384 dictionaryWithEnumFromDescription: { 333 - type: 'object', 385 + type: "object", 334 386 additionalProperties: { 335 - type: 'integer', 336 - description: 'Success=1,Warning=2,Error=3' 387 + type: "integer", 388 + description: "Success=1,Warning=2,Error=3" 337 389 } 338 390 }, 339 391 arrayWithEnum: { 340 - type: 'array', 392 + type: "array", 341 393 items: { 342 - enum: ['Success', 'Warning', 'Error'] 394 + enum: [ 395 + "Success", 396 + "Warning", 397 + "Error" 398 + ] 343 399 } 344 400 }, 345 401 arrayWithDescription: { 346 - type: 'array', 402 + type: "array", 347 403 items: { 348 - type: 'integer', 349 - description: 'Success=1,Warning=2,Error=3' 404 + type: "integer", 405 + description: "Success=1,Warning=2,Error=3" 350 406 } 351 407 } 352 408 } 353 409 } as const; 354 410 355 411 export const ModelWithReferenceSchema = { 356 - description: 'This is a model with one property containing a reference', 357 - type: 'object', 412 + description: "This is a model with one property containing a reference", 413 + type: "object", 358 414 properties: { 359 415 prop: { 360 - '$ref': '#/definitions/ModelWithProperties' 416 + '$ref': "#/definitions/ModelWithProperties" 361 417 } 362 418 } 363 419 } as const; 364 420 365 421 export const ModelWithArraySchema = { 366 - description: 'This is a model with one property containing an array', 367 - type: 'object', 422 + description: "This is a model with one property containing an array", 423 + type: "object", 368 424 properties: { 369 425 prop: { 370 - type: 'array', 426 + type: "array", 371 427 items: { 372 - '$ref': '#/definitions/ModelWithString' 428 + '$ref': "#/definitions/ModelWithString" 373 429 } 374 430 }, 375 431 propWithFile: { 376 - type: 'array', 432 + type: "array", 377 433 items: { 378 - format: 'binary', 379 - type: 'string' 434 + format: "binary", 435 + type: "string" 380 436 } 381 437 }, 382 438 propWithNumber: { 383 - type: 'array', 439 + type: "array", 384 440 items: { 385 - type: 'number' 441 + type: "number" 386 442 } 387 443 } 388 444 } 389 445 } as const; 390 446 391 447 export const ModelWithDictionarySchema = { 392 - description: 'This is a model with one property containing a dictionary', 393 - type: 'object', 448 + description: "This is a model with one property containing a dictionary", 449 + type: "object", 394 450 properties: { 395 451 prop: { 396 - type: 'object', 452 + type: "object", 397 453 additionalProperties: { 398 - type: 'string' 454 + type: "string" 399 455 } 400 456 } 401 457 } 402 458 } as const; 403 459 404 460 export const ModelWithCircularReferenceSchema = { 405 - description: 'This is a model with one property containing a circular reference', 406 - type: 'object', 461 + description: "This is a model with one property containing a circular reference", 462 + type: "object", 407 463 properties: { 408 464 prop: { 409 - '$ref': '#/definitions/ModelWithCircularReference' 465 + '$ref': "#/definitions/ModelWithCircularReference" 410 466 } 411 467 } 412 468 } as const; 413 469 414 470 export const ModelWithPropertiesSchema = { 415 - description: 'This is a model with one nested property', 416 - type: 'object', 417 - required: ['required', 'requiredAndReadOnly'], 471 + description: "This is a model with one nested property", 472 + type: "object", 473 + required: [ 474 + "required", 475 + "requiredAndReadOnly" 476 + ], 418 477 properties: { 419 478 required: { 420 - type: 'string' 479 + type: "string" 421 480 }, 422 481 requiredAndReadOnly: { 423 - type: 'string', 482 + type: "string", 424 483 readOnly: true 425 484 }, 426 485 string: { 427 - type: 'string' 486 + type: "string" 428 487 }, 429 488 number: { 430 - type: 'number' 489 + type: "number" 431 490 }, 432 491 boolean: { 433 - type: 'boolean' 492 + type: "boolean" 434 493 }, 435 494 reference: { 436 - '$ref': '#/definitions/ModelWithString' 495 + '$ref': "#/definitions/ModelWithString" 437 496 }, 438 497 'property with space': { 439 - type: 'string' 498 + type: "string" 440 499 }, 441 500 default: { 442 - type: 'string' 501 + type: "string" 443 502 }, 444 503 try: { 445 - type: 'string' 504 + type: "string" 446 505 }, 447 506 '@namespace.string': { 448 - type: 'string', 507 + type: "string", 449 508 readOnly: true 450 509 }, 451 510 '@namespace.integer': { 452 - type: 'integer', 511 + type: "integer", 453 512 readOnly: true 454 513 } 455 514 } 456 515 } as const; 457 516 458 517 export const ModelWithNestedPropertiesSchema = { 459 - description: 'This is a model with one nested property', 460 - type: 'object', 461 - required: ['first'], 518 + description: "This is a model with one nested property", 519 + type: "object", 520 + required: [ 521 + "first" 522 + ], 462 523 properties: { 463 524 first: { 464 - type: 'object', 465 - required: ['second'], 525 + type: "object", 526 + required: [ 527 + "second" 528 + ], 466 529 readOnly: true, 467 530 properties: { 468 531 second: { 469 - type: 'object', 470 - required: ['third'], 532 + type: "object", 533 + required: [ 534 + "third" 535 + ], 471 536 readOnly: true, 472 537 properties: { 473 538 third: { 474 - type: 'string', 539 + type: "string", 475 540 readOnly: true 476 541 } 477 542 } ··· 482 547 } as const; 483 548 484 549 export const ModelWithDuplicatePropertiesSchema = { 485 - description: 'This is a model with duplicated properties', 486 - type: 'object', 550 + description: "This is a model with duplicated properties", 551 + type: "object", 487 552 properties: { 488 553 prop: { 489 - '$ref': '#/definitions/ModelWithString' 554 + '$ref': "#/definitions/ModelWithString" 490 555 } 491 556 } 492 557 } as const; 493 558 494 559 export const ModelWithOrderedPropertiesSchema = { 495 - description: 'This is a model with ordered properties', 496 - type: 'object', 560 + description: "This is a model with ordered properties", 561 + type: "object", 497 562 properties: { 498 563 zebra: { 499 - type: 'string' 564 + type: "string" 500 565 }, 501 566 apple: { 502 - type: 'string' 567 + type: "string" 503 568 }, 504 569 hawaii: { 505 - type: 'string' 570 + type: "string" 506 571 } 507 572 } 508 573 } as const; 509 574 510 575 export const ModelWithDuplicateImportsSchema = { 511 - description: 'This is a model with duplicated imports', 512 - type: 'object', 576 + description: "This is a model with duplicated imports", 577 + type: "object", 513 578 properties: { 514 579 propA: { 515 - '$ref': '#/definitions/ModelWithString' 580 + '$ref': "#/definitions/ModelWithString" 516 581 }, 517 582 propB: { 518 - '$ref': '#/definitions/ModelWithString' 583 + '$ref': "#/definitions/ModelWithString" 519 584 }, 520 585 propC: { 521 - '$ref': '#/definitions/ModelWithString' 586 + '$ref': "#/definitions/ModelWithString" 522 587 } 523 588 } 524 589 } as const; 525 590 526 591 export const ModelThatExtendsSchema = { 527 - description: 'This is a model that extends another model', 528 - type: 'object', 592 + description: "This is a model that extends another model", 593 + type: "object", 529 594 allOf: [ 530 595 { 531 - '$ref': '#/definitions/ModelWithString' 596 + '$ref': "#/definitions/ModelWithString" 532 597 }, 533 598 { 534 - type: 'object', 599 + type: "object", 535 600 properties: { 536 601 propExtendsA: { 537 - type: 'string' 602 + type: "string" 538 603 }, 539 604 propExtendsB: { 540 - '$ref': '#/definitions/ModelWithString' 605 + '$ref': "#/definitions/ModelWithString" 541 606 } 542 607 } 543 608 } ··· 545 610 } as const; 546 611 547 612 export const ModelThatExtendsExtendsSchema = { 548 - description: 'This is a model that extends another model', 549 - type: 'object', 613 + description: "This is a model that extends another model", 614 + type: "object", 550 615 allOf: [ 551 616 { 552 - '$ref': '#/definitions/ModelWithString' 617 + '$ref': "#/definitions/ModelWithString" 553 618 }, 554 619 { 555 - '$ref': '#/definitions/ModelThatExtends' 620 + '$ref': "#/definitions/ModelThatExtends" 556 621 }, 557 622 { 558 - type: 'object', 623 + type: "object", 559 624 properties: { 560 625 propExtendsC: { 561 - type: 'string' 626 + type: "string" 562 627 }, 563 628 propExtendsD: { 564 - '$ref': '#/definitions/ModelWithString' 629 + '$ref': "#/definitions/ModelWithString" 565 630 } 566 631 } 567 632 } ··· 569 634 } as const; 570 635 571 636 export const defaultSchema = { 572 - type: 'object', 637 + type: "object", 573 638 properties: { 574 639 name: { 575 - type: 'string' 640 + type: "string" 576 641 } 577 642 } 578 643 } as const; 579 644 580 645 export const ModelWithPatternSchema = { 581 - description: 'This is a model that contains a some patterns', 582 - type: 'object', 583 - required: ['key', 'name'], 646 + description: "This is a model that contains a some patterns", 647 + type: "object", 648 + required: [ 649 + "key", 650 + "name" 651 + ], 584 652 properties: { 585 653 key: { 586 654 maxLength: 64, 587 - pattern: '^[a-zA-Z0-9_]*$', 588 - type: 'string' 655 + pattern: "^[a-zA-Z0-9_]*$", 656 + type: "string" 589 657 }, 590 658 name: { 591 659 maxLength: 255, 592 - type: 'string' 660 + type: "string" 593 661 }, 594 662 enabled: { 595 - type: 'boolean', 663 + type: "boolean", 596 664 readOnly: true 597 665 }, 598 666 modified: { 599 - type: 'string', 600 - format: 'date-time', 667 + type: "string", 668 + format: "date-time", 601 669 readOnly: true 602 670 }, 603 671 id: { 604 - type: 'string', 605 - pattern: '^\\d{2}-\\d{3}-\\d{4}$' 672 + type: "string", 673 + pattern: "^\\d{2}-\\d{3}-\\d{4}$" 606 674 }, 607 675 text: { 608 - type: 'string', 609 - pattern: '^\\w+$' 676 + type: "string", 677 + pattern: "^\\w+$" 610 678 }, 611 679 patternWithSingleQuotes: { 612 - type: 'string', 680 + type: "string", 613 681 pattern: "^[a-zA-Z0-9']*$" 614 682 }, 615 683 patternWithNewline: { 616 - type: 'string', 617 - pattern: 'aaa\\nbbb' 684 + type: "string", 685 + pattern: "aaa\\nbbb" 618 686 }, 619 687 patternWithBacktick: { 620 - type: 'string', 621 - pattern: 'aaa`bbb' 688 + type: "string", 689 + pattern: "aaa`bbb" 622 690 } 623 691 } 624 692 } as const; 625 693 626 694 export const parameter_ActivityParamsSchema = { 627 - type: 'object', 695 + type: "object", 628 696 properties: { 629 697 description: { 630 - type: 'string' 698 + type: "string" 631 699 }, 632 700 graduate_id: { 633 - type: 'integer' 701 + type: "integer" 634 702 }, 635 703 organization_id: { 636 - type: 'integer' 704 + type: "integer" 637 705 }, 638 706 parent_activity: { 639 - type: 'integer' 707 + type: "integer" 640 708 }, 641 709 post_id: { 642 - type: 'integer' 710 + type: "integer" 643 711 } 644 712 } 645 713 } as const; 646 714 647 715 export const response_PostActivityResponseSchema = { 648 - type: 'object', 716 + type: "object", 649 717 properties: { 650 718 description: { 651 - type: 'string' 719 + type: "string" 652 720 }, 653 721 graduate_id: { 654 - type: 'integer' 722 + type: "integer" 655 723 }, 656 724 organization_id: { 657 - type: 'integer' 725 + type: "integer" 658 726 }, 659 727 parent_activity_id: { 660 - type: 'integer' 728 + type: "integer" 661 729 }, 662 730 post_id: { 663 - type: 'integer' 731 + type: "integer" 664 732 } 665 733 } 666 734 } as const; 667 735 668 736 export const failure_FailureSchema = { 669 - type: 'object', 737 + type: "object", 670 738 properties: { 671 739 error: { 672 - type: 'string' 740 + type: "string" 673 741 }, 674 742 message: { 675 - type: 'string' 743 + type: "string" 676 744 }, 677 745 reference_code: { 678 - type: 'string' 746 + type: "string" 679 747 } 680 748 } 681 749 } as const; 682 750 683 751 export const external_shared_ExternalSharedModelSchema = { 684 - type: 'object', 752 + type: "object", 685 753 properties: { 686 754 id: { 687 - type: 'string' 755 + type: "string" 688 756 }, 689 757 name: { 690 - type: 'string' 758 + type: "string" 691 759 } 692 760 }, 693 - required: ['id'] 761 + required: [ 762 + "id" 763 + ] 694 764 } as const; 695 765 696 766 export const ModelWithReferenceWritableSchema = { 697 - description: 'This is a model with one property containing a reference', 698 - type: 'object', 767 + description: "This is a model with one property containing a reference", 768 + type: "object", 699 769 properties: { 700 770 prop: { 701 - '$ref': '#/definitions/ModelWithPropertiesWritable' 771 + '$ref': "#/definitions/ModelWithPropertiesWritable" 702 772 } 703 773 } 704 774 } as const; 705 775 706 776 export const ModelWithPropertiesWritableSchema = { 707 - description: 'This is a model with one nested property', 708 - type: 'object', 709 - required: ['required'], 777 + description: "This is a model with one nested property", 778 + type: "object", 779 + required: [ 780 + "required" 781 + ], 710 782 properties: { 711 783 required: { 712 - type: 'string' 784 + type: "string" 713 785 }, 714 786 string: { 715 - type: 'string' 787 + type: "string" 716 788 }, 717 789 number: { 718 - type: 'number' 790 + type: "number" 719 791 }, 720 792 boolean: { 721 - type: 'boolean' 793 + type: "boolean" 722 794 }, 723 795 reference: { 724 - '$ref': '#/definitions/ModelWithString' 796 + '$ref': "#/definitions/ModelWithString" 725 797 }, 726 798 'property with space': { 727 - type: 'string' 799 + type: "string" 728 800 }, 729 801 default: { 730 - type: 'string' 802 + type: "string" 731 803 }, 732 804 try: { 733 - type: 'string' 805 + type: "string" 734 806 } 735 807 } 736 808 } as const; 737 809 738 810 export const ModelWithPatternWritableSchema = { 739 - description: 'This is a model that contains a some patterns', 740 - type: 'object', 741 - required: ['key', 'name'], 811 + description: "This is a model that contains a some patterns", 812 + type: "object", 813 + required: [ 814 + "key", 815 + "name" 816 + ], 742 817 properties: { 743 818 key: { 744 819 maxLength: 64, 745 - pattern: '^[a-zA-Z0-9_]*$', 746 - type: 'string' 820 + pattern: "^[a-zA-Z0-9_]*$", 821 + type: "string" 747 822 }, 748 823 name: { 749 824 maxLength: 255, 750 - type: 'string' 825 + type: "string" 751 826 }, 752 827 id: { 753 - type: 'string', 754 - pattern: '^\\d{2}-\\d{3}-\\d{4}$' 828 + type: "string", 829 + pattern: "^\\d{2}-\\d{3}-\\d{4}$" 755 830 }, 756 831 text: { 757 - type: 'string', 758 - pattern: '^\\w+$' 832 + type: "string", 833 + pattern: "^\\w+$" 759 834 }, 760 835 patternWithSingleQuotes: { 761 - type: 'string', 836 + type: "string", 762 837 pattern: "^[a-zA-Z0-9']*$" 763 838 }, 764 839 patternWithNewline: { 765 - type: 'string', 766 - pattern: 'aaa\\nbbb' 840 + type: "string", 841 + pattern: "aaa\\nbbb" 767 842 }, 768 843 patternWithBacktick: { 769 - type: 'string', 770 - pattern: 'aaa`bbb' 844 + type: "string", 845 + pattern: "aaa`bbb" 771 846 } 772 847 } 773 848 } as const;
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/sdk/default/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -4
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/sdk/throwOnError/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base', 18 - throwOnError: true 19 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base", throwOnError: true }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@pinia/colada/fetch/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/angular-query-experimental/axios/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseURL: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseURL: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/angular-query-experimental/fetch/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/react-query/axios/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseURL: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseURL: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/react-query/fetch/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/solid-query/axios/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseURL: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseURL: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/solid-query/fetch/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/svelte-query/axios/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseURL: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseURL: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/svelte-query/fetch/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/vue-query/axios/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseURL: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseURL: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/vue-query/fetch/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/servers-base-path/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: '/v1' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "/v1" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/servers/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'https://foo.com/v1' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "https://foo.com/v1" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@angular/common/default-class/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@angular/common/default/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/client-fetch/sdk-nested-classes-instance/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'https://api.example.com/v1' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "https://api.example.com/v1" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/client-fetch/sdk-nested-classes/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'https://api.example.com/v1' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "https://api.example.com/v1" }));
+851 -695
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/schemas/default/schemas.gen.ts
··· 1 1 // This file is auto-generated by @hey-api/openapi-ts 2 2 3 3 export const _400Schema = { 4 - description: 'Model with number-only name', 5 - type: 'string' 4 + description: "Model with number-only name", 5 + type: "string" 6 6 } as const; 7 7 8 8 export const ExternalRefASchema = { 9 - description: 'External ref to shared model (A)', 10 - '$ref': '#/components/schemas/external-shared_ExternalSharedModel' 9 + description: "External ref to shared model (A)", 10 + '$ref': "#/components/schemas/external-shared_ExternalSharedModel" 11 11 } as const; 12 12 13 13 export const ExternalRefBSchema = { 14 - description: 'External ref to shared model (B)', 15 - '$ref': '#/components/schemas/external-shared_ExternalSharedModel' 14 + description: "External ref to shared model (B)", 15 + '$ref': "#/components/schemas/external-shared_ExternalSharedModel" 16 16 } as const; 17 17 18 18 export const camelCaseCommentWithBreaksSchema = { 19 - description: `Testing multiline comments in string: First line 20 - Second line 21 - 22 - Fourth line`, 23 - type: 'integer' 19 + description: "Testing multiline comments in string: First line\nSecond line\n\nFourth line", 20 + type: "integer" 24 21 } as const; 25 22 26 23 export const CommentWithBreaksSchema = { 27 - description: `Testing multiline comments in string: First line 28 - Second line 29 - 30 - Fourth line`, 31 - type: 'integer' 24 + description: "Testing multiline comments in string: First line\nSecond line\n\nFourth line", 25 + type: "integer" 32 26 } as const; 33 27 34 28 export const CommentWithBackticksSchema = { 35 - description: 'Testing backticks in string: `backticks` and ```multiple backticks``` should work', 36 - type: 'integer' 29 + description: "Testing backticks in string: `backticks` and ```multiple backticks``` should work", 30 + type: "integer" 37 31 } as const; 38 32 39 33 export const CommentWithBackticksAndQuotesSchema = { 40 - description: `Testing backticks and quotes in string: \`backticks\`, 'quotes', "double quotes" and \`\`\`multiple backticks\`\`\` should work`, 41 - type: 'integer' 34 + description: "Testing backticks and quotes in string: `backticks`, 'quotes', \"double quotes\" and ```multiple backticks``` should work", 35 + type: "integer" 42 36 } as const; 43 37 44 38 export const CommentWithSlashesSchema = { 45 - description: 'Testing slashes in string: \\backwards\\\\\\ and /forwards/// should work', 46 - type: 'integer' 39 + description: "Testing slashes in string: \\backwards\\\\\\ and /forwards/// should work", 40 + type: "integer" 47 41 } as const; 48 42 49 43 export const CommentWithExpressionPlaceholdersSchema = { 50 - description: 'Testing expression placeholders in string: ${expression} should work', 51 - type: 'integer' 44 + description: "Testing expression placeholders in string: ${expression} should work", 45 + type: "integer" 52 46 } as const; 53 47 54 48 export const CommentWithQuotesSchema = { 55 - description: `Testing quotes in string: 'single quote''' and "double quotes""" should work`, 56 - type: 'integer' 49 + description: "Testing quotes in string: 'single quote''' and \"double quotes\"\"\" should work", 50 + type: "integer" 57 51 } as const; 58 52 59 53 export const CommentWithReservedCharactersSchema = { 60 - description: 'Testing reserved characters in string: /* inline */ and /** inline **/ should work', 61 - type: 'integer' 54 + description: "Testing reserved characters in string: /* inline */ and /** inline **/ should work", 55 + type: "integer" 62 56 } as const; 63 57 64 58 export const SimpleIntegerSchema = { 65 - description: 'This is a simple number', 66 - type: 'integer' 59 + description: "This is a simple number", 60 + type: "integer" 67 61 } as const; 68 62 69 63 export const SimpleBooleanSchema = { 70 - description: 'This is a simple boolean', 71 - type: 'boolean' 64 + description: "This is a simple boolean", 65 + type: "boolean" 72 66 } as const; 73 67 74 68 export const SimpleStringSchema = { 75 - description: 'This is a simple string', 76 - type: 'string' 69 + description: "This is a simple string", 70 + type: "string" 77 71 } as const; 78 72 79 73 export const NonAsciiStringæøåÆØÅöôêÊ字符串Schema = { 80 - description: 'A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串)', 81 - type: 'string' 74 + description: "A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串)", 75 + type: "string" 82 76 } as const; 83 77 84 78 export const SimpleFileSchema = { 85 - description: 'This is a simple file', 86 - format: 'binary', 87 - type: 'string' 79 + description: "This is a simple file", 80 + format: "binary", 81 + type: "string" 88 82 } as const; 89 83 90 84 export const SimpleReferenceSchema = { 91 - description: 'This is a simple reference', 85 + description: "This is a simple reference", 92 86 allOf: [ 93 87 { 94 - '$ref': '#/components/schemas/ModelWithString' 88 + '$ref': "#/components/schemas/ModelWithString" 95 89 } 96 90 ] 97 91 } as const; 98 92 99 93 export const SimpleStringWithPatternSchema = { 100 - description: 'This is a simple string', 101 - type: 'string', 94 + description: "This is a simple string", 95 + type: "string", 102 96 nullable: true, 103 97 maxLength: 64, 104 - pattern: '^[a-zA-Z0-9_]*$' 98 + pattern: "^[a-zA-Z0-9_]*$" 105 99 } as const; 106 100 107 101 export const EnumWithStringsSchema = { 108 - description: 'This is a simple enum with strings', 109 - enum: ['Success', 'Warning', 'Error', "'Single Quote'", '"Double Quotes"', 'Non-ascii: øæåôöØÆÅÔÖ字符串'] 102 + description: "This is a simple enum with strings", 103 + enum: [ 104 + "Success", 105 + "Warning", 106 + "Error", 107 + "'Single Quote'", 108 + "\"Double Quotes\"", 109 + "Non-ascii: øæåôöØÆÅÔÖ字符串" 110 + ] 110 111 } as const; 111 112 112 113 export const EnumWithReplacedCharactersSchema = { 113 - enum: ["'Single Quote'", '"Double Quotes"', 'øæåôöØÆÅÔÖ字符串', 3.1, ''], 114 - type: 'string' 114 + enum: [ 115 + "'Single Quote'", 116 + "\"Double Quotes\"", 117 + "øæåôöØÆÅÔÖ字符串", 118 + 3.1, 119 + "" 120 + ], 121 + type: "string" 115 122 } as const; 116 123 117 124 export const EnumWithNumbersSchema = { 118 - description: 'This is a simple enum with numbers', 119 - enum: [1, 2, 3, 1.1, 1.2, 1.3, 100, 200, 300, -100, -200, -300, -1.1, -1.2, -1.3], 125 + description: "This is a simple enum with numbers", 126 + enum: [ 127 + 1, 128 + 2, 129 + 3, 130 + 1.1, 131 + 1.2, 132 + 1.3, 133 + 100, 134 + 200, 135 + 300, 136 + -100, 137 + -200, 138 + -300, 139 + -1.1, 140 + -1.2, 141 + -1.3 142 + ], 120 143 default: 200 121 144 } as const; 122 145 123 146 export const EnumFromDescriptionSchema = { 124 - description: 'Success=1,Warning=2,Error=3', 125 - type: 'number' 147 + description: "Success=1,Warning=2,Error=3", 148 + type: "number" 126 149 } as const; 127 150 128 151 export const EnumWithExtensionsSchema = { 129 - description: 'This is a simple enum with numbers', 130 - enum: [200, 400, 500], 131 - 'x-enum-varnames': ['CUSTOM_SUCCESS', 'CUSTOM_WARNING', 'CUSTOM_ERROR'], 132 - 'x-enum-descriptions': ['Used when the status of something is successful', 'Used when the status of something has a warning', 'Used when the status of something has an error'] 152 + description: "This is a simple enum with numbers", 153 + enum: [ 154 + 200, 155 + 400, 156 + 500 157 + ], 158 + 'x-enum-varnames': [ 159 + "CUSTOM_SUCCESS", 160 + "CUSTOM_WARNING", 161 + "CUSTOM_ERROR" 162 + ], 163 + 'x-enum-descriptions': [ 164 + "Used when the status of something is successful", 165 + "Used when the status of something has a warning", 166 + "Used when the status of something has an error" 167 + ] 133 168 } as const; 134 169 135 170 export const EnumWithXEnumNamesSchema = { 136 - enum: [0, 1, 2], 137 - 'x-enumNames': ['zero', 'one', 'two'] 171 + enum: [ 172 + 0, 173 + 1, 174 + 2 175 + ], 176 + 'x-enumNames': [ 177 + "zero", 178 + "one", 179 + "two" 180 + ] 138 181 } as const; 139 182 140 183 export const ArrayWithNumbersSchema = { 141 - description: 'This is a simple array with numbers', 142 - type: 'array', 184 + description: "This is a simple array with numbers", 185 + type: "array", 143 186 items: { 144 - type: 'integer' 187 + type: "integer" 145 188 } 146 189 } as const; 147 190 148 191 export const ArrayWithBooleansSchema = { 149 - description: 'This is a simple array with booleans', 150 - type: 'array', 192 + description: "This is a simple array with booleans", 193 + type: "array", 151 194 items: { 152 - type: 'boolean' 195 + type: "boolean" 153 196 } 154 197 } as const; 155 198 156 199 export const ArrayWithStringsSchema = { 157 - description: 'This is a simple array with strings', 158 - type: 'array', 200 + description: "This is a simple array with strings", 201 + type: "array", 159 202 items: { 160 - type: 'string' 203 + type: "string" 161 204 }, 162 - default: ['test'] 205 + default: [ 206 + "test" 207 + ] 163 208 } as const; 164 209 165 210 export const ArrayWithReferencesSchema = { 166 - description: 'This is a simple array with references', 167 - type: 'array', 211 + description: "This is a simple array with references", 212 + type: "array", 168 213 items: { 169 - '$ref': '#/components/schemas/ModelWithString' 214 + '$ref': "#/components/schemas/ModelWithString" 170 215 } 171 216 } as const; 172 217 173 218 export const ArrayWithArraySchema = { 174 - description: 'This is a simple array containing an array', 175 - type: 'array', 219 + description: "This is a simple array containing an array", 220 + type: "array", 176 221 items: { 177 - type: 'array', 222 + type: "array", 178 223 items: { 179 - '$ref': '#/components/schemas/ModelWithString' 224 + '$ref': "#/components/schemas/ModelWithString" 180 225 } 181 226 } 182 227 } as const; 183 228 184 229 export const ArrayWithPropertiesSchema = { 185 - description: 'This is a simple array with properties', 186 - type: 'array', 230 + description: "This is a simple array with properties", 231 + type: "array", 187 232 items: { 188 - type: 'object', 233 + type: "object", 189 234 properties: { 190 235 '16x16': { 191 - '$ref': '#/components/schemas/camelCaseCommentWithBreaks' 236 + '$ref': "#/components/schemas/camelCaseCommentWithBreaks" 192 237 }, 193 238 bar: { 194 - type: 'string' 239 + type: "string" 195 240 } 196 241 } 197 242 } 198 243 } as const; 199 244 200 245 export const ArrayWithAnyOfPropertiesSchema = { 201 - description: 'This is a simple array with any of properties', 202 - type: 'array', 246 + description: "This is a simple array with any of properties", 247 + type: "array", 203 248 items: { 204 249 anyOf: [ 205 250 { 206 - type: 'object', 251 + type: "object", 207 252 properties: { 208 253 foo: { 209 - type: 'string', 210 - default: 'test' 254 + type: "string", 255 + default: "test" 211 256 } 212 257 } 213 258 }, 214 259 { 215 - type: 'object', 260 + type: "object", 216 261 properties: { 217 262 bar: { 218 - type: 'string' 263 + type: "string" 219 264 } 220 265 } 221 266 } ··· 224 269 } as const; 225 270 226 271 export const AnyOfAnyAndNullSchema = { 227 - type: 'object', 272 + type: "object", 228 273 properties: { 229 274 data: { 230 275 anyOf: [ ··· 238 283 } as const; 239 284 240 285 export const AnyOfArraysSchema = { 241 - description: 'This is a simple array with any of properties', 242 - type: 'object', 286 + description: "This is a simple array with any of properties", 287 + type: "object", 243 288 properties: { 244 289 results: { 245 290 items: { 246 291 anyOf: [ 247 292 { 248 - type: 'object', 293 + type: "object", 249 294 properties: { 250 295 foo: { 251 - type: 'string' 296 + type: "string" 252 297 } 253 298 } 254 299 }, 255 300 { 256 - type: 'object', 301 + type: "object", 257 302 properties: { 258 303 bar: { 259 - type: 'string' 304 + type: "string" 260 305 } 261 306 } 262 307 } 263 308 ] 264 309 }, 265 - type: 'array' 310 + type: "array" 266 311 } 267 312 } 268 313 } as const; 269 314 270 315 export const DictionaryWithStringSchema = { 271 - description: 'This is a string dictionary', 272 - type: 'object', 316 + description: "This is a string dictionary", 317 + type: "object", 273 318 additionalProperties: { 274 - type: 'string' 319 + type: "string" 275 320 } 276 321 } as const; 277 322 278 323 export const DictionaryWithPropertiesAndAdditionalPropertiesSchema = { 279 - type: 'object', 324 + type: "object", 280 325 properties: { 281 326 foo: { 282 - type: 'number' 327 + type: "number" 283 328 }, 284 329 bar: { 285 - type: 'boolean' 330 + type: "boolean" 286 331 } 287 332 }, 288 333 additionalProperties: { 289 - type: 'string' 334 + type: "string" 290 335 } 291 336 } as const; 292 337 293 338 export const DictionaryWithReferenceSchema = { 294 - description: 'This is a string reference', 295 - type: 'object', 339 + description: "This is a string reference", 340 + type: "object", 296 341 additionalProperties: { 297 - '$ref': '#/components/schemas/ModelWithString' 342 + '$ref': "#/components/schemas/ModelWithString" 298 343 } 299 344 } as const; 300 345 301 346 export const DictionaryWithArraySchema = { 302 - description: 'This is a complex dictionary', 303 - type: 'object', 347 + description: "This is a complex dictionary", 348 + type: "object", 304 349 additionalProperties: { 305 - type: 'array', 350 + type: "array", 306 351 items: { 307 - '$ref': '#/components/schemas/ModelWithString' 352 + '$ref': "#/components/schemas/ModelWithString" 308 353 } 309 354 } 310 355 } as const; 311 356 312 357 export const DictionaryWithDictionarySchema = { 313 - description: 'This is a string dictionary', 314 - type: 'object', 358 + description: "This is a string dictionary", 359 + type: "object", 315 360 additionalProperties: { 316 - type: 'object', 361 + type: "object", 317 362 additionalProperties: { 318 - type: 'string' 363 + type: "string" 319 364 } 320 365 } 321 366 } as const; 322 367 323 368 export const DictionaryWithPropertiesSchema = { 324 - description: 'This is a complex dictionary', 325 - type: 'object', 369 + description: "This is a complex dictionary", 370 + type: "object", 326 371 additionalProperties: { 327 - type: 'object', 372 + type: "object", 328 373 properties: { 329 374 foo: { 330 - type: 'string' 375 + type: "string" 331 376 }, 332 377 bar: { 333 - type: 'string' 378 + type: "string" 334 379 } 335 380 } 336 381 } 337 382 } as const; 338 383 339 384 export const ModelWithIntegerSchema = { 340 - description: 'This is a model with one number property', 341 - type: 'object', 385 + description: "This is a model with one number property", 386 + type: "object", 342 387 properties: { 343 388 prop: { 344 - description: 'This is a simple number property', 345 - type: 'integer' 389 + description: "This is a simple number property", 390 + type: "integer" 346 391 } 347 392 } 348 393 } as const; 349 394 350 395 export const ModelWithBooleanSchema = { 351 - description: 'This is a model with one boolean property', 352 - type: 'object', 396 + description: "This is a model with one boolean property", 397 + type: "object", 353 398 properties: { 354 399 prop: { 355 - description: 'This is a simple boolean property', 356 - type: 'boolean' 400 + description: "This is a simple boolean property", 401 + type: "boolean" 357 402 } 358 403 } 359 404 } as const; 360 405 361 406 export const ModelWithStringSchema = { 362 - description: 'This is a model with one string property', 363 - type: 'object', 407 + description: "This is a model with one string property", 408 + type: "object", 364 409 properties: { 365 410 prop: { 366 - description: 'This is a simple string property', 367 - type: 'string' 411 + description: "This is a simple string property", 412 + type: "string" 368 413 } 369 414 } 370 415 } as const; 371 416 372 417 export const ModelWithStringErrorSchema = { 373 - description: 'This is a model with one string property', 374 - type: 'object', 418 + description: "This is a model with one string property", 419 + type: "object", 375 420 properties: { 376 421 prop: { 377 - description: 'This is a simple string property', 378 - type: 'string' 422 + description: "This is a simple string property", 423 + type: "string" 379 424 } 380 425 } 381 426 } as const; 382 427 383 428 export const Model_From_ZendeskSchema = { 384 - description: `\`Comment\` or \`VoiceComment\`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets)`, 385 - type: 'string' 429 + description: "`Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets)", 430 + type: "string" 386 431 } as const; 387 432 388 433 export const ModelWithNullableStringSchema = { 389 - description: 'This is a model with one string property', 390 - type: 'object', 391 - required: ['nullableRequiredProp1', 'nullableRequiredProp2'], 434 + description: "This is a model with one string property", 435 + type: "object", 436 + required: [ 437 + "nullableRequiredProp1", 438 + "nullableRequiredProp2" 439 + ], 392 440 properties: { 393 441 nullableProp1: { 394 - description: 'This is a simple string property', 395 - type: 'string', 442 + description: "This is a simple string property", 443 + type: "string", 396 444 nullable: true 397 445 }, 398 446 nullableRequiredProp1: { 399 - description: 'This is a simple string property', 400 - type: 'string', 447 + description: "This is a simple string property", 448 + type: "string", 401 449 nullable: true 402 450 }, 403 451 nullableProp2: { 404 - description: 'This is a simple string property', 452 + description: "This is a simple string property", 405 453 nullable: true, 406 - type: 'string' 454 + type: "string" 407 455 }, 408 456 nullableRequiredProp2: { 409 - description: 'This is a simple string property', 457 + description: "This is a simple string property", 410 458 nullable: true, 411 - type: 'string' 459 + type: "string" 412 460 }, 413 461 'foo_bar-enum': { 414 - description: 'This is a simple enum with strings', 415 - enum: ['Success', 'Warning', 'Error', 'ØÆÅ字符串'] 462 + description: "This is a simple enum with strings", 463 + enum: [ 464 + "Success", 465 + "Warning", 466 + "Error", 467 + "ØÆÅ字符串" 468 + ] 416 469 } 417 470 } 418 471 } as const; 419 472 420 473 export const ModelWithEnumSchema = { 421 - description: 'This is a model with one enum', 422 - type: 'object', 474 + description: "This is a model with one enum", 475 + type: "object", 423 476 properties: { 424 477 'foo_bar-enum': { 425 - description: 'This is a simple enum with strings', 426 - enum: ['Success', 'Warning', 'Error', 'ØÆÅ字符串'] 478 + description: "This is a simple enum with strings", 479 + enum: [ 480 + "Success", 481 + "Warning", 482 + "Error", 483 + "ØÆÅ字符串" 484 + ] 427 485 }, 428 486 statusCode: { 429 - description: 'These are the HTTP error code enums', 430 - enum: ['100', '200 FOO', '300 FOO_BAR', '400 foo-bar', '500 foo.bar', '600 foo&bar'] 487 + description: "These are the HTTP error code enums", 488 + enum: [ 489 + "100", 490 + "200 FOO", 491 + "300 FOO_BAR", 492 + "400 foo-bar", 493 + "500 foo.bar", 494 + "600 foo&bar" 495 + ] 431 496 }, 432 497 bool: { 433 - description: 'Simple boolean enum', 434 - type: 'boolean', 435 - enum: [true] 498 + description: "Simple boolean enum", 499 + type: "boolean", 500 + enum: [ 501 + true 502 + ] 436 503 } 437 504 } 438 505 } as const; 439 506 440 507 export const ModelWithEnumWithHyphenSchema = { 441 - description: 'This is a model with one enum with escaped name', 442 - type: 'object', 508 + description: "This is a model with one enum with escaped name", 509 + type: "object", 443 510 properties: { 444 511 'foo-bar-baz-qux': { 445 - type: 'string', 446 - enum: ['3.0'], 447 - title: 'Foo-Bar-Baz-Qux', 448 - default: '3.0' 512 + type: "string", 513 + enum: [ 514 + "3.0" 515 + ], 516 + title: "Foo-Bar-Baz-Qux", 517 + default: "3.0" 449 518 } 450 519 } 451 520 } as const; 452 521 453 522 export const ModelWithEnumFromDescriptionSchema = { 454 - description: 'This is a model with one enum', 455 - type: 'object', 523 + description: "This is a model with one enum", 524 + type: "object", 456 525 properties: { 457 526 test: { 458 - type: 'integer', 459 - description: 'Success=1,Warning=2,Error=3' 527 + type: "integer", 528 + description: "Success=1,Warning=2,Error=3" 460 529 } 461 530 } 462 531 } as const; 463 532 464 533 export const ModelWithNestedEnumsSchema = { 465 - description: 'This is a model with nested enums', 466 - type: 'object', 534 + description: "This is a model with nested enums", 535 + type: "object", 467 536 properties: { 468 537 dictionaryWithEnum: { 469 - type: 'object', 538 + type: "object", 470 539 additionalProperties: { 471 - enum: ['Success', 'Warning', 'Error'] 540 + enum: [ 541 + "Success", 542 + "Warning", 543 + "Error" 544 + ] 472 545 } 473 546 }, 474 547 dictionaryWithEnumFromDescription: { 475 - type: 'object', 548 + type: "object", 476 549 additionalProperties: { 477 - type: 'integer', 478 - description: 'Success=1,Warning=2,Error=3' 550 + type: "integer", 551 + description: "Success=1,Warning=2,Error=3" 479 552 } 480 553 }, 481 554 arrayWithEnum: { 482 - type: 'array', 555 + type: "array", 483 556 items: { 484 - enum: ['Success', 'Warning', 'Error'] 557 + enum: [ 558 + "Success", 559 + "Warning", 560 + "Error" 561 + ] 485 562 } 486 563 }, 487 564 arrayWithDescription: { 488 - type: 'array', 565 + type: "array", 489 566 items: { 490 - type: 'integer', 491 - description: 'Success=1,Warning=2,Error=3' 567 + type: "integer", 568 + description: "Success=1,Warning=2,Error=3" 492 569 } 493 570 }, 494 571 'foo_bar-enum': { 495 - description: 'This is a simple enum with strings', 496 - enum: ['Success', 'Warning', 'Error', 'ØÆÅ字符串'] 572 + description: "This is a simple enum with strings", 573 + enum: [ 574 + "Success", 575 + "Warning", 576 + "Error", 577 + "ØÆÅ字符串" 578 + ] 497 579 } 498 580 } 499 581 } as const; 500 582 501 583 export const ModelWithReferenceSchema = { 502 - description: 'This is a model with one property containing a reference', 503 - type: 'object', 584 + description: "This is a model with one property containing a reference", 585 + type: "object", 504 586 properties: { 505 587 prop: { 506 - '$ref': '#/components/schemas/ModelWithProperties' 588 + '$ref': "#/components/schemas/ModelWithProperties" 507 589 } 508 590 } 509 591 } as const; 510 592 511 593 export const ModelWithArrayReadOnlyAndWriteOnlySchema = { 512 - description: 'This is a model with one property containing an array', 513 - type: 'object', 594 + description: "This is a model with one property containing an array", 595 + type: "object", 514 596 properties: { 515 597 prop: { 516 - type: 'array', 598 + type: "array", 517 599 items: { 518 - '$ref': '#/components/schemas/ModelWithReadOnlyAndWriteOnly' 600 + '$ref': "#/components/schemas/ModelWithReadOnlyAndWriteOnly" 519 601 } 520 602 }, 521 603 propWithFile: { 522 - type: 'array', 604 + type: "array", 523 605 items: { 524 - format: 'binary', 525 - type: 'string' 606 + format: "binary", 607 + type: "string" 526 608 } 527 609 }, 528 610 propWithNumber: { 529 - type: 'array', 611 + type: "array", 530 612 items: { 531 - type: 'number' 613 + type: "number" 532 614 } 533 615 } 534 616 } 535 617 } as const; 536 618 537 619 export const ModelWithArraySchema = { 538 - description: 'This is a model with one property containing an array', 539 - type: 'object', 620 + description: "This is a model with one property containing an array", 621 + type: "object", 540 622 properties: { 541 623 prop: { 542 - type: 'array', 624 + type: "array", 543 625 items: { 544 - '$ref': '#/components/schemas/ModelWithString' 626 + '$ref': "#/components/schemas/ModelWithString" 545 627 } 546 628 }, 547 629 propWithFile: { 548 - type: 'array', 630 + type: "array", 549 631 items: { 550 - format: 'binary', 551 - type: 'string' 632 + format: "binary", 633 + type: "string" 552 634 } 553 635 }, 554 636 propWithNumber: { 555 - type: 'array', 637 + type: "array", 556 638 items: { 557 - type: 'number' 639 + type: "number" 558 640 } 559 641 } 560 642 } 561 643 } as const; 562 644 563 645 export const ModelWithDictionarySchema = { 564 - description: 'This is a model with one property containing a dictionary', 565 - type: 'object', 646 + description: "This is a model with one property containing a dictionary", 647 + type: "object", 566 648 properties: { 567 649 prop: { 568 - type: 'object', 650 + type: "object", 569 651 additionalProperties: { 570 - type: 'string' 652 + type: "string" 571 653 } 572 654 } 573 655 } ··· 575 657 576 658 export const DeprecatedModelSchema = { 577 659 deprecated: true, 578 - description: 'This is a deprecated model with a deprecated property', 579 - type: 'object', 660 + description: "This is a deprecated model with a deprecated property", 661 + type: "object", 580 662 properties: { 581 663 prop: { 582 664 deprecated: true, 583 - description: 'This is a deprecated property', 584 - type: 'string' 665 + description: "This is a deprecated property", 666 + type: "string" 585 667 } 586 668 } 587 669 } as const; 588 670 589 671 export const ModelWithCircularReferenceSchema = { 590 - description: 'This is a model with one property containing a circular reference', 591 - type: 'object', 672 + description: "This is a model with one property containing a circular reference", 673 + type: "object", 592 674 properties: { 593 675 prop: { 594 - '$ref': '#/components/schemas/ModelWithCircularReference' 676 + '$ref': "#/components/schemas/ModelWithCircularReference" 595 677 } 596 678 } 597 679 } as const; 598 680 599 681 export const CompositionWithOneOfSchema = { 600 682 description: "This is a model with one property with a 'one of' relationship", 601 - type: 'object', 683 + type: "object", 602 684 properties: { 603 685 propA: { 604 - type: 'object', 686 + type: "object", 605 687 oneOf: [ 606 688 { 607 - '$ref': '#/components/schemas/ModelWithString' 689 + '$ref': "#/components/schemas/ModelWithString" 608 690 }, 609 691 { 610 - '$ref': '#/components/schemas/ModelWithEnum' 692 + '$ref': "#/components/schemas/ModelWithEnum" 611 693 }, 612 694 { 613 - '$ref': '#/components/schemas/ModelWithArray' 695 + '$ref': "#/components/schemas/ModelWithArray" 614 696 }, 615 697 { 616 - '$ref': '#/components/schemas/ModelWithDictionary' 698 + '$ref': "#/components/schemas/ModelWithDictionary" 617 699 } 618 700 ] 619 701 } ··· 622 704 623 705 export const CompositionWithOneOfAnonymousSchema = { 624 706 description: "This is a model with one property with a 'one of' relationship where the options are not $ref", 625 - type: 'object', 707 + type: "object", 626 708 properties: { 627 709 propA: { 628 - type: 'object', 710 + type: "object", 629 711 oneOf: [ 630 712 { 631 - description: 'Anonymous object type', 632 - type: 'object', 713 + description: "Anonymous object type", 714 + type: "object", 633 715 properties: { 634 716 propA: { 635 - type: 'string' 717 + type: "string" 636 718 } 637 719 } 638 720 }, 639 721 { 640 - description: 'Anonymous string type', 641 - type: 'string' 722 + description: "Anonymous string type", 723 + type: "string" 642 724 }, 643 725 { 644 - description: 'Anonymous integer type', 645 - type: 'integer' 726 + description: "Anonymous integer type", 727 + type: "integer" 646 728 } 647 729 ] 648 730 } ··· 650 732 } as const; 651 733 652 734 export const ModelCircleSchema = { 653 - description: 'Circle', 654 - type: 'object', 655 - required: ['kind'], 735 + description: "Circle", 736 + type: "object", 737 + required: [ 738 + "kind" 739 + ], 656 740 properties: { 657 741 kind: { 658 - type: 'string' 742 + type: "string" 659 743 }, 660 744 radius: { 661 - type: 'number' 745 + type: "number" 662 746 } 663 747 } 664 748 } as const; 665 749 666 750 export const ModelSquareSchema = { 667 - description: 'Square', 668 - type: 'object', 669 - required: ['kind'], 751 + description: "Square", 752 + type: "object", 753 + required: [ 754 + "kind" 755 + ], 670 756 properties: { 671 757 kind: { 672 - type: 'string' 758 + type: "string" 673 759 }, 674 760 sideLength: { 675 - type: 'number' 761 + type: "number" 676 762 } 677 763 } 678 764 } as const; 679 765 680 766 export const CompositionWithOneOfDiscriminatorSchema = { 681 767 description: "This is a model with one property with a 'one of' relationship where the options are not $ref", 682 - type: 'object', 768 + type: "object", 683 769 oneOf: [ 684 770 { 685 - '$ref': '#/components/schemas/ModelCircle' 771 + '$ref': "#/components/schemas/ModelCircle" 686 772 }, 687 773 { 688 - '$ref': '#/components/schemas/ModelSquare' 774 + '$ref': "#/components/schemas/ModelSquare" 689 775 } 690 776 ], 691 777 discriminator: { 692 - propertyName: 'kind', 778 + propertyName: "kind", 693 779 mapping: { 694 - circle: '#/components/schemas/ModelCircle', 695 - square: '#/components/schemas/ModelSquare' 780 + circle: "#/components/schemas/ModelCircle", 781 + square: "#/components/schemas/ModelSquare" 696 782 } 697 783 } 698 784 } as const; 699 785 700 786 export const CompositionWithAnyOfSchema = { 701 787 description: "This is a model with one property with a 'any of' relationship", 702 - type: 'object', 788 + type: "object", 703 789 properties: { 704 790 propA: { 705 - type: 'object', 791 + type: "object", 706 792 anyOf: [ 707 793 { 708 - '$ref': '#/components/schemas/ModelWithString' 794 + '$ref': "#/components/schemas/ModelWithString" 709 795 }, 710 796 { 711 - '$ref': '#/components/schemas/ModelWithEnum' 797 + '$ref': "#/components/schemas/ModelWithEnum" 712 798 }, 713 799 { 714 - '$ref': '#/components/schemas/ModelWithArray' 800 + '$ref': "#/components/schemas/ModelWithArray" 715 801 }, 716 802 { 717 - '$ref': '#/components/schemas/ModelWithDictionary' 803 + '$ref': "#/components/schemas/ModelWithDictionary" 718 804 } 719 805 ] 720 806 } ··· 723 809 724 810 export const CompositionWithAnyOfAnonymousSchema = { 725 811 description: "This is a model with one property with a 'any of' relationship where the options are not $ref", 726 - type: 'object', 812 + type: "object", 727 813 properties: { 728 814 propA: { 729 - type: 'object', 815 + type: "object", 730 816 anyOf: [ 731 817 { 732 - description: 'Anonymous object type', 733 - type: 'object', 818 + description: "Anonymous object type", 819 + type: "object", 734 820 properties: { 735 821 propA: { 736 - type: 'string' 822 + type: "string" 737 823 } 738 824 } 739 825 }, 740 826 { 741 - description: 'Anonymous string type', 742 - type: 'string' 827 + description: "Anonymous string type", 828 + type: "string" 743 829 }, 744 830 { 745 - description: 'Anonymous integer type', 746 - type: 'integer' 831 + description: "Anonymous integer type", 832 + type: "integer" 747 833 } 748 834 ] 749 835 } ··· 752 838 753 839 export const CompositionWithNestedAnyAndTypeNullSchema = { 754 840 description: "This is a model with nested 'any of' property with a type null", 755 - type: 'object', 841 + type: "object", 756 842 properties: { 757 843 propA: { 758 - type: 'object', 844 + type: "object", 759 845 anyOf: [ 760 846 { 761 847 items: { 762 848 nullable: true, 763 849 allOf: [ 764 850 { 765 - '$ref': '#/components/schemas/ModelWithDictionary' 851 + '$ref': "#/components/schemas/ModelWithDictionary" 766 852 } 767 853 ] 768 854 }, 769 - type: 'array' 855 + type: "array" 770 856 }, 771 857 { 772 858 items: { 773 859 nullable: true, 774 860 allOf: [ 775 861 { 776 - '$ref': '#/components/schemas/ModelWithArray' 862 + '$ref': "#/components/schemas/ModelWithArray" 777 863 } 778 864 ] 779 865 }, 780 - type: 'array' 866 + type: "array" 781 867 } 782 868 ] 783 869 } ··· 785 871 } as const; 786 872 787 873 export const _3e_num_1ПериодSchema = { 788 - enum: ['Bird', 'Dog'], 789 - type: 'string' 874 + enum: [ 875 + "Bird", 876 + "Dog" 877 + ], 878 + type: "string" 790 879 } as const; 791 880 792 881 export const ConstValueSchema = { 793 - enum: ['ConstValue'], 794 - type: 'string' 882 + enum: [ 883 + "ConstValue" 884 + ], 885 + type: "string" 795 886 } as const; 796 887 797 888 export const CompositionWithNestedAnyOfAndNullSchema = { 798 889 description: "This is a model with one property with a 'any of' relationship where the options are not $ref", 799 - type: 'object', 890 + type: "object", 800 891 properties: { 801 892 propA: { 802 893 nullable: true, ··· 805 896 items: { 806 897 anyOf: [ 807 898 { 808 - '$ref': '#/components/schemas/3e-num_1Период' 899 + '$ref': "#/components/schemas/3e-num_1Период" 809 900 }, 810 901 { 811 - '$ref': '#/components/schemas/ConstValue' 902 + '$ref': "#/components/schemas/ConstValue" 812 903 } 813 904 ] 814 905 }, 815 - type: 'array' 906 + type: "array" 816 907 } 817 908 ], 818 - title: 'Scopes' 909 + title: "Scopes" 819 910 } 820 911 } 821 912 } as const; 822 913 823 914 export const CompositionWithOneOfAndNullableSchema = { 824 915 description: "This is a model with one property with a 'one of' relationship", 825 - type: 'object', 916 + type: "object", 826 917 properties: { 827 918 propA: { 828 919 nullable: true, 829 - type: 'object', 920 + type: "object", 830 921 oneOf: [ 831 922 { 832 - type: 'object', 923 + type: "object", 833 924 properties: { 834 925 boolean: { 835 - type: 'boolean' 926 + type: "boolean" 836 927 } 837 928 } 838 929 }, 839 930 { 840 - '$ref': '#/components/schemas/ModelWithEnum' 931 + '$ref': "#/components/schemas/ModelWithEnum" 841 932 }, 842 933 { 843 - '$ref': '#/components/schemas/ModelWithArray' 934 + '$ref': "#/components/schemas/ModelWithArray" 844 935 }, 845 936 { 846 - '$ref': '#/components/schemas/ModelWithDictionary' 937 + '$ref': "#/components/schemas/ModelWithDictionary" 847 938 } 848 939 ] 849 940 } ··· 851 942 } as const; 852 943 853 944 export const CompositionWithOneOfAndSimpleDictionarySchema = { 854 - description: 'This is a model that contains a simple dictionary within composition', 855 - type: 'object', 945 + description: "This is a model that contains a simple dictionary within composition", 946 + type: "object", 856 947 properties: { 857 948 propA: { 858 949 oneOf: [ 859 950 { 860 - type: 'boolean' 951 + type: "boolean" 861 952 }, 862 953 { 863 - type: 'object', 954 + type: "object", 864 955 additionalProperties: { 865 - type: 'number' 956 + type: "number" 866 957 } 867 958 } 868 959 ] ··· 871 962 } as const; 872 963 873 964 export const CompositionWithOneOfAndSimpleArrayDictionarySchema = { 874 - description: 'This is a model that contains a dictionary of simple arrays within composition', 875 - type: 'object', 965 + description: "This is a model that contains a dictionary of simple arrays within composition", 966 + type: "object", 876 967 properties: { 877 968 propA: { 878 969 oneOf: [ 879 970 { 880 - type: 'boolean' 971 + type: "boolean" 881 972 }, 882 973 { 883 - type: 'object', 974 + type: "object", 884 975 additionalProperties: { 885 - type: 'array', 976 + type: "array", 886 977 items: { 887 - type: 'boolean' 978 + type: "boolean" 888 979 } 889 980 } 890 981 } ··· 894 985 } as const; 895 986 896 987 export const CompositionWithOneOfAndComplexArrayDictionarySchema = { 897 - description: 'This is a model that contains a dictionary of complex arrays (composited) within composition', 898 - type: 'object', 988 + description: "This is a model that contains a dictionary of complex arrays (composited) within composition", 989 + type: "object", 899 990 properties: { 900 991 propA: { 901 992 oneOf: [ 902 993 { 903 - type: 'boolean' 994 + type: "boolean" 904 995 }, 905 996 { 906 - type: 'object', 997 + type: "object", 907 998 additionalProperties: { 908 - type: 'array', 999 + type: "array", 909 1000 items: { 910 1001 oneOf: [ 911 1002 { 912 - type: 'number' 1003 + type: "number" 913 1004 }, 914 1005 { 915 - type: 'string' 1006 + type: "string" 916 1007 } 917 1008 ] 918 1009 } ··· 925 1016 926 1017 export const CompositionWithAllOfAndNullableSchema = { 927 1018 description: "This is a model with one property with a 'all of' relationship", 928 - type: 'object', 1019 + type: "object", 929 1020 properties: { 930 1021 propA: { 931 1022 nullable: true, 932 - type: 'object', 1023 + type: "object", 933 1024 allOf: [ 934 1025 { 935 - type: 'object', 1026 + type: "object", 936 1027 properties: { 937 1028 boolean: { 938 - type: 'boolean' 1029 + type: "boolean" 939 1030 } 940 1031 } 941 1032 }, 942 1033 { 943 - '$ref': '#/components/schemas/ModelWithEnum' 1034 + '$ref': "#/components/schemas/ModelWithEnum" 944 1035 }, 945 1036 { 946 - '$ref': '#/components/schemas/ModelWithArray' 1037 + '$ref': "#/components/schemas/ModelWithArray" 947 1038 }, 948 1039 { 949 - '$ref': '#/components/schemas/ModelWithDictionary' 1040 + '$ref': "#/components/schemas/ModelWithDictionary" 950 1041 } 951 1042 ] 952 1043 } ··· 955 1046 956 1047 export const CompositionWithAnyOfAndNullableSchema = { 957 1048 description: "This is a model with one property with a 'any of' relationship", 958 - type: 'object', 1049 + type: "object", 959 1050 properties: { 960 1051 propA: { 961 1052 nullable: true, 962 - type: 'object', 1053 + type: "object", 963 1054 anyOf: [ 964 1055 { 965 - type: 'object', 1056 + type: "object", 966 1057 properties: { 967 1058 boolean: { 968 - type: 'boolean' 1059 + type: "boolean" 969 1060 } 970 1061 } 971 1062 }, 972 1063 { 973 - '$ref': '#/components/schemas/ModelWithEnum' 1064 + '$ref': "#/components/schemas/ModelWithEnum" 974 1065 }, 975 1066 { 976 - '$ref': '#/components/schemas/ModelWithArray' 1067 + '$ref': "#/components/schemas/ModelWithArray" 977 1068 }, 978 1069 { 979 - '$ref': '#/components/schemas/ModelWithDictionary' 1070 + '$ref': "#/components/schemas/ModelWithDictionary" 980 1071 } 981 1072 ] 982 1073 } ··· 984 1075 } as const; 985 1076 986 1077 export const CompositionBaseModelSchema = { 987 - description: 'This is a base model with two simple optional properties', 988 - type: 'object', 1078 + description: "This is a base model with two simple optional properties", 1079 + type: "object", 989 1080 properties: { 990 1081 firstName: { 991 - type: 'string' 1082 + type: "string" 992 1083 }, 993 1084 lastname: { 994 - type: 'string' 1085 + type: "string" 995 1086 } 996 1087 } 997 1088 } as const; 998 1089 999 1090 export const CompositionExtendedModelSchema = { 1000 - description: 'This is a model that extends the base model', 1001 - type: 'object', 1091 + description: "This is a model that extends the base model", 1092 + type: "object", 1002 1093 allOf: [ 1003 1094 { 1004 - '$ref': '#/components/schemas/CompositionBaseModel' 1095 + '$ref': "#/components/schemas/CompositionBaseModel" 1005 1096 } 1006 1097 ], 1007 1098 properties: { 1008 1099 age: { 1009 - type: 'number' 1100 + type: "number" 1010 1101 } 1011 1102 }, 1012 - required: ['firstName', 'lastname', 'age'] 1103 + required: [ 1104 + "firstName", 1105 + "lastname", 1106 + "age" 1107 + ] 1013 1108 } as const; 1014 1109 1015 1110 export const ModelWithPropertiesSchema = { 1016 - description: 'This is a model with one nested property', 1017 - type: 'object', 1018 - required: ['required', 'requiredAndReadOnly', 'requiredAndNullable'], 1111 + description: "This is a model with one nested property", 1112 + type: "object", 1113 + required: [ 1114 + "required", 1115 + "requiredAndReadOnly", 1116 + "requiredAndNullable" 1117 + ], 1019 1118 properties: { 1020 1119 required: { 1021 - type: 'string' 1120 + type: "string" 1022 1121 }, 1023 1122 requiredAndReadOnly: { 1024 - type: 'string', 1123 + type: "string", 1025 1124 readOnly: true 1026 1125 }, 1027 1126 requiredAndNullable: { 1028 - type: 'string', 1127 + type: "string", 1029 1128 nullable: true 1030 1129 }, 1031 1130 string: { 1032 - type: 'string' 1131 + type: "string" 1033 1132 }, 1034 1133 number: { 1035 - type: 'number' 1134 + type: "number" 1036 1135 }, 1037 1136 boolean: { 1038 - type: 'boolean' 1137 + type: "boolean" 1039 1138 }, 1040 1139 reference: { 1041 - '$ref': '#/components/schemas/ModelWithString' 1140 + '$ref': "#/components/schemas/ModelWithString" 1042 1141 }, 1043 1142 'property with space': { 1044 - type: 'string' 1143 + type: "string" 1045 1144 }, 1046 1145 default: { 1047 - type: 'string' 1146 + type: "string" 1048 1147 }, 1049 1148 try: { 1050 - type: 'string' 1149 + type: "string" 1051 1150 }, 1052 1151 '@namespace.string': { 1053 - type: 'string', 1152 + type: "string", 1054 1153 readOnly: true 1055 1154 }, 1056 1155 '@namespace.integer': { 1057 - type: 'integer', 1156 + type: "integer", 1058 1157 readOnly: true 1059 1158 } 1060 1159 } 1061 1160 } as const; 1062 1161 1063 1162 export const ModelWithNestedPropertiesSchema = { 1064 - description: 'This is a model with one nested property', 1065 - type: 'object', 1066 - required: ['first'], 1163 + description: "This is a model with one nested property", 1164 + type: "object", 1165 + required: [ 1166 + "first" 1167 + ], 1067 1168 properties: { 1068 1169 first: { 1069 - type: 'object', 1070 - required: ['second'], 1170 + type: "object", 1171 + required: [ 1172 + "second" 1173 + ], 1071 1174 readOnly: true, 1072 1175 nullable: true, 1073 1176 properties: { 1074 1177 second: { 1075 - type: 'object', 1076 - required: ['third'], 1178 + type: "object", 1179 + required: [ 1180 + "third" 1181 + ], 1077 1182 readOnly: true, 1078 1183 nullable: true, 1079 1184 properties: { 1080 1185 third: { 1081 - type: 'string', 1186 + type: "string", 1082 1187 required: true, 1083 1188 readOnly: true, 1084 1189 nullable: true ··· 1091 1196 } as const; 1092 1197 1093 1198 export const ModelWithDuplicatePropertiesSchema = { 1094 - description: 'This is a model with duplicated properties', 1095 - type: 'object', 1199 + description: "This is a model with duplicated properties", 1200 + type: "object", 1096 1201 properties: { 1097 1202 prop: { 1098 - '$ref': '#/components/schemas/ModelWithString' 1203 + '$ref': "#/components/schemas/ModelWithString" 1099 1204 } 1100 1205 } 1101 1206 } as const; 1102 1207 1103 1208 export const ModelWithOrderedPropertiesSchema = { 1104 - description: 'This is a model with ordered properties', 1105 - type: 'object', 1209 + description: "This is a model with ordered properties", 1210 + type: "object", 1106 1211 properties: { 1107 1212 zebra: { 1108 - type: 'string' 1213 + type: "string" 1109 1214 }, 1110 1215 apple: { 1111 - type: 'string' 1216 + type: "string" 1112 1217 }, 1113 1218 hawaii: { 1114 - type: 'string' 1219 + type: "string" 1115 1220 } 1116 1221 } 1117 1222 } as const; 1118 1223 1119 1224 export const ModelWithDuplicateImportsSchema = { 1120 - description: 'This is a model with duplicated imports', 1121 - type: 'object', 1225 + description: "This is a model with duplicated imports", 1226 + type: "object", 1122 1227 properties: { 1123 1228 propA: { 1124 - '$ref': '#/components/schemas/ModelWithString' 1229 + '$ref': "#/components/schemas/ModelWithString" 1125 1230 }, 1126 1231 propB: { 1127 - '$ref': '#/components/schemas/ModelWithString' 1232 + '$ref': "#/components/schemas/ModelWithString" 1128 1233 }, 1129 1234 propC: { 1130 - '$ref': '#/components/schemas/ModelWithString' 1235 + '$ref': "#/components/schemas/ModelWithString" 1131 1236 } 1132 1237 } 1133 1238 } as const; 1134 1239 1135 1240 export const ModelThatExtendsSchema = { 1136 - description: 'This is a model that extends another model', 1137 - type: 'object', 1241 + description: "This is a model that extends another model", 1242 + type: "object", 1138 1243 allOf: [ 1139 1244 { 1140 - '$ref': '#/components/schemas/ModelWithString' 1245 + '$ref': "#/components/schemas/ModelWithString" 1141 1246 }, 1142 1247 { 1143 - type: 'object', 1248 + type: "object", 1144 1249 properties: { 1145 1250 propExtendsA: { 1146 - type: 'string' 1251 + type: "string" 1147 1252 }, 1148 1253 propExtendsB: { 1149 - '$ref': '#/components/schemas/ModelWithString' 1254 + '$ref': "#/components/schemas/ModelWithString" 1150 1255 } 1151 1256 } 1152 1257 } ··· 1154 1259 } as const; 1155 1260 1156 1261 export const ModelThatExtendsExtendsSchema = { 1157 - description: 'This is a model that extends another model', 1158 - type: 'object', 1262 + description: "This is a model that extends another model", 1263 + type: "object", 1159 1264 allOf: [ 1160 1265 { 1161 - '$ref': '#/components/schemas/ModelWithString' 1266 + '$ref': "#/components/schemas/ModelWithString" 1162 1267 }, 1163 1268 { 1164 - '$ref': '#/components/schemas/ModelThatExtends' 1269 + '$ref': "#/components/schemas/ModelThatExtends" 1165 1270 }, 1166 1271 { 1167 - type: 'object', 1272 + type: "object", 1168 1273 properties: { 1169 1274 propExtendsC: { 1170 - type: 'string' 1275 + type: "string" 1171 1276 }, 1172 1277 propExtendsD: { 1173 - '$ref': '#/components/schemas/ModelWithString' 1278 + '$ref': "#/components/schemas/ModelWithString" 1174 1279 } 1175 1280 } 1176 1281 } ··· 1178 1283 } as const; 1179 1284 1180 1285 export const ModelWithPatternSchema = { 1181 - description: 'This is a model that contains a some patterns', 1182 - type: 'object', 1183 - required: ['key', 'name'], 1286 + description: "This is a model that contains a some patterns", 1287 + type: "object", 1288 + required: [ 1289 + "key", 1290 + "name" 1291 + ], 1184 1292 properties: { 1185 1293 key: { 1186 1294 maxLength: 64, 1187 - pattern: '^[a-zA-Z0-9_]*$', 1188 - type: 'string' 1295 + pattern: "^[a-zA-Z0-9_]*$", 1296 + type: "string" 1189 1297 }, 1190 1298 name: { 1191 1299 maxLength: 255, 1192 - type: 'string' 1300 + type: "string" 1193 1301 }, 1194 1302 enabled: { 1195 - type: 'boolean', 1303 + type: "boolean", 1196 1304 readOnly: true 1197 1305 }, 1198 1306 modified: { 1199 - type: 'string', 1200 - format: 'date-time', 1307 + type: "string", 1308 + format: "date-time", 1201 1309 readOnly: true 1202 1310 }, 1203 1311 id: { 1204 - type: 'string', 1205 - pattern: '^\\d{2}-\\d{3}-\\d{4}$' 1312 + type: "string", 1313 + pattern: "^\\d{2}-\\d{3}-\\d{4}$" 1206 1314 }, 1207 1315 text: { 1208 - type: 'string', 1209 - pattern: '^\\w+$' 1316 + type: "string", 1317 + pattern: "^\\w+$" 1210 1318 }, 1211 1319 patternWithSingleQuotes: { 1212 - type: 'string', 1320 + type: "string", 1213 1321 pattern: "^[a-zA-Z0-9']*$" 1214 1322 }, 1215 1323 patternWithNewline: { 1216 - type: 'string', 1217 - pattern: 'aaa\\nbbb' 1324 + type: "string", 1325 + pattern: "aaa\\nbbb" 1218 1326 }, 1219 1327 patternWithBacktick: { 1220 - type: 'string', 1221 - pattern: 'aaa`bbb' 1328 + type: "string", 1329 + pattern: "aaa`bbb" 1222 1330 } 1223 1331 } 1224 1332 } as const; 1225 1333 1226 1334 export const FileSchema = { 1227 - required: ['mime'], 1228 - type: 'object', 1335 + required: [ 1336 + "mime" 1337 + ], 1338 + type: "object", 1229 1339 properties: { 1230 1340 id: { 1231 - title: 'Id', 1232 - type: 'string', 1341 + title: "Id", 1342 + type: "string", 1233 1343 readOnly: true, 1234 1344 minLength: 1 1235 1345 }, 1236 1346 updated_at: { 1237 - title: 'Updated at', 1238 - type: 'string', 1239 - format: 'date-time', 1347 + title: "Updated at", 1348 + type: "string", 1349 + format: "date-time", 1240 1350 readOnly: true 1241 1351 }, 1242 1352 created_at: { 1243 - title: 'Created at', 1244 - type: 'string', 1245 - format: 'date-time', 1353 + title: "Created at", 1354 + type: "string", 1355 + format: "date-time", 1246 1356 readOnly: true 1247 1357 }, 1248 1358 mime: { 1249 - title: 'Mime', 1250 - type: 'string', 1359 + title: "Mime", 1360 + type: "string", 1251 1361 maxLength: 24, 1252 1362 minLength: 1 1253 1363 }, 1254 1364 file: { 1255 - title: 'File', 1256 - type: 'string', 1365 + title: "File", 1366 + type: "string", 1257 1367 readOnly: true, 1258 - format: 'uri' 1368 + format: "uri" 1259 1369 } 1260 1370 } 1261 1371 } as const; 1262 1372 1263 1373 export const defaultSchema = { 1264 - type: 'object', 1374 + type: "object", 1265 1375 properties: { 1266 1376 name: { 1267 - type: 'string' 1377 + type: "string" 1268 1378 } 1269 1379 } 1270 1380 } as const; 1271 1381 1272 1382 export const PageableSchema = { 1273 - type: 'object', 1383 + type: "object", 1274 1384 properties: { 1275 1385 page: { 1276 1386 minimum: 0, 1277 - type: 'integer', 1278 - format: 'int32', 1387 + type: "integer", 1388 + format: "int32", 1279 1389 default: 0 1280 1390 }, 1281 1391 size: { 1282 1392 minimum: 1, 1283 - type: 'integer', 1284 - format: 'int32' 1393 + type: "integer", 1394 + format: "int32" 1285 1395 }, 1286 1396 sort: { 1287 - type: 'array', 1397 + type: "array", 1288 1398 items: { 1289 - type: 'string' 1399 + type: "string" 1290 1400 } 1291 1401 } 1292 1402 } 1293 1403 } as const; 1294 1404 1295 1405 export const FreeFormObjectWithoutAdditionalPropertiesSchema = { 1296 - description: 'This is a free-form object without additionalProperties.', 1297 - type: 'object' 1406 + description: "This is a free-form object without additionalProperties.", 1407 + type: "object" 1298 1408 } as const; 1299 1409 1300 1410 export const FreeFormObjectWithAdditionalPropertiesEqTrueSchema = { 1301 - description: 'This is a free-form object with additionalProperties: true.', 1302 - type: 'object', 1411 + description: "This is a free-form object with additionalProperties: true.", 1412 + type: "object", 1303 1413 additionalProperties: true 1304 1414 } as const; 1305 1415 1306 1416 export const FreeFormObjectWithAdditionalPropertiesEqEmptyObjectSchema = { 1307 - description: 'This is a free-form object with additionalProperties: {}.', 1308 - type: 'object', 1417 + description: "This is a free-form object with additionalProperties: {}.", 1418 + type: "object", 1309 1419 additionalProperties: {} 1310 1420 } as const; 1311 1421 1312 1422 export const ModelWithConstSchema = { 1313 - type: 'object', 1423 + type: "object", 1314 1424 properties: { 1315 1425 String: { 1316 - enum: ['String'], 1317 - type: 'string' 1426 + enum: [ 1427 + "String" 1428 + ], 1429 + type: "string" 1318 1430 }, 1319 1431 number: { 1320 - enum: [0], 1321 - type: 'number' 1432 + enum: [ 1433 + 0 1434 + ], 1435 + type: "number" 1322 1436 }, 1323 1437 null: { 1324 1438 nullable: true 1325 1439 }, 1326 1440 withType: { 1327 - enum: ['Some string'], 1328 - type: 'string' 1441 + enum: [ 1442 + "Some string" 1443 + ], 1444 + type: "string" 1329 1445 } 1330 1446 } 1331 1447 } as const; 1332 1448 1333 1449 export const ModelWithAdditionalPropertiesEqTrueSchema = { 1334 - description: 'This is a model with one property and additionalProperties: true', 1335 - type: 'object', 1450 + description: "This is a model with one property and additionalProperties: true", 1451 + type: "object", 1336 1452 properties: { 1337 1453 prop: { 1338 - description: 'This is a simple string property', 1339 - type: 'string' 1454 + description: "This is a simple string property", 1455 + type: "string" 1340 1456 } 1341 1457 }, 1342 1458 additionalProperties: true ··· 1351 1467 items: { 1352 1468 anyOf: [ 1353 1469 { 1354 - type: 'string' 1470 + type: "string" 1355 1471 }, 1356 1472 { 1357 - type: 'boolean' 1473 + type: "boolean" 1358 1474 } 1359 1475 ] 1360 1476 }, 1361 - type: 'array' 1477 + type: "array" 1362 1478 } 1363 1479 ] 1364 1480 } 1365 1481 }, 1366 - type: 'object' 1482 + type: "object" 1367 1483 } as const; 1368 1484 1369 1485 export const CompositionWithOneOfAndPropertiesSchema = { 1370 - type: 'object', 1486 + type: "object", 1371 1487 oneOf: [ 1372 1488 { 1373 - type: 'object', 1374 - required: ['foo'], 1489 + type: "object", 1490 + required: [ 1491 + "foo" 1492 + ], 1375 1493 properties: { 1376 1494 foo: { 1377 - '$ref': '#/components/parameters/SimpleParameter' 1495 + '$ref': "#/components/parameters/SimpleParameter" 1378 1496 } 1379 1497 }, 1380 1498 additionalProperties: false 1381 1499 }, 1382 1500 { 1383 - type: 'object', 1384 - required: ['bar'], 1501 + type: "object", 1502 + required: [ 1503 + "bar" 1504 + ], 1385 1505 properties: { 1386 1506 bar: { 1387 - '$ref': '#/components/schemas/NonAsciiStringæøåÆØÅöôêÊ字符串' 1507 + '$ref': "#/components/schemas/NonAsciiStringæøåÆØÅöôêÊ字符串" 1388 1508 } 1389 1509 }, 1390 1510 additionalProperties: false 1391 1511 } 1392 1512 ], 1393 - required: ['baz', 'qux'], 1513 + required: [ 1514 + "baz", 1515 + "qux" 1516 + ], 1394 1517 properties: { 1395 1518 baz: { 1396 - type: 'integer', 1397 - format: 'uint16', 1519 + type: "integer", 1520 + format: "uint16", 1398 1521 minimum: 0, 1399 1522 nullable: true 1400 1523 }, 1401 1524 qux: { 1402 - type: 'integer', 1403 - format: 'uint8', 1525 + type: "integer", 1526 + format: "uint8", 1404 1527 minimum: 0 1405 1528 } 1406 1529 } 1407 1530 } as const; 1408 1531 1409 1532 export const NullableObjectSchema = { 1410 - description: 'An object that can be null', 1533 + description: "An object that can be null", 1411 1534 nullable: true, 1412 - type: 'object', 1535 + type: "object", 1413 1536 properties: { 1414 1537 foo: { 1415 - type: 'string' 1538 + type: "string" 1416 1539 } 1417 1540 }, 1418 1541 default: null 1419 1542 } as const; 1420 1543 1421 1544 export const CharactersInDescriptionSchema = { 1422 - type: 'string', 1423 - description: 'Some % character' 1545 + type: "string", 1546 + description: "Some % character" 1424 1547 } as const; 1425 1548 1426 1549 export const ModelWithNullableObjectSchema = { 1427 - type: 'object', 1550 + type: "object", 1428 1551 properties: { 1429 1552 data: { 1430 - '$ref': '#/components/schemas/NullableObject' 1553 + '$ref': "#/components/schemas/NullableObject" 1431 1554 } 1432 1555 } 1433 1556 } as const; ··· 1435 1558 export const ModelWithOneOfEnumSchema = { 1436 1559 oneOf: [ 1437 1560 { 1438 - type: 'object', 1439 - required: ['foo'], 1561 + type: "object", 1562 + required: [ 1563 + "foo" 1564 + ], 1440 1565 properties: { 1441 1566 foo: { 1442 - type: 'string', 1443 - enum: ['Bar'] 1567 + type: "string", 1568 + enum: [ 1569 + "Bar" 1570 + ] 1444 1571 } 1445 1572 } 1446 1573 }, 1447 1574 { 1448 - type: 'object', 1449 - required: ['foo'], 1575 + type: "object", 1576 + required: [ 1577 + "foo" 1578 + ], 1450 1579 properties: { 1451 1580 foo: { 1452 - type: 'string', 1453 - enum: ['Baz'] 1581 + type: "string", 1582 + enum: [ 1583 + "Baz" 1584 + ] 1454 1585 } 1455 1586 } 1456 1587 }, 1457 1588 { 1458 - type: 'object', 1459 - required: ['foo'], 1589 + type: "object", 1590 + required: [ 1591 + "foo" 1592 + ], 1460 1593 properties: { 1461 1594 foo: { 1462 - type: 'string', 1463 - enum: ['Qux'] 1595 + type: "string", 1596 + enum: [ 1597 + "Qux" 1598 + ] 1464 1599 } 1465 1600 } 1466 1601 }, 1467 1602 { 1468 - type: 'object', 1469 - required: ['content', 'foo'], 1603 + type: "object", 1604 + required: [ 1605 + "content", 1606 + "foo" 1607 + ], 1470 1608 properties: { 1471 1609 content: { 1472 - type: 'string', 1473 - format: 'date-time' 1610 + type: "string", 1611 + format: "date-time" 1474 1612 }, 1475 1613 foo: { 1476 - type: 'string', 1477 - enum: ['Quux'] 1614 + type: "string", 1615 + enum: [ 1616 + "Quux" 1617 + ] 1478 1618 } 1479 1619 } 1480 1620 }, 1481 1621 { 1482 - type: 'object', 1483 - required: ['content', 'foo'], 1622 + type: "object", 1623 + required: [ 1624 + "content", 1625 + "foo" 1626 + ], 1484 1627 properties: { 1485 1628 content: { 1486 - type: 'array', 1629 + type: "array", 1487 1630 items: { 1488 - type: 'string', 1489 - format: 'date-time' 1631 + type: "string", 1632 + format: "date-time" 1490 1633 }, 1491 1634 maxItems: 2, 1492 1635 minItems: 2 1493 1636 }, 1494 1637 foo: { 1495 - type: 'string', 1496 - enum: ['Corge'] 1638 + type: "string", 1639 + enum: [ 1640 + "Corge" 1641 + ] 1497 1642 } 1498 1643 } 1499 1644 } ··· 1501 1646 } as const; 1502 1647 1503 1648 export const ModelWithNestedArrayEnumsDataFooSchema = { 1504 - enum: ['foo', 'bar'], 1505 - type: 'string' 1649 + enum: [ 1650 + "foo", 1651 + "bar" 1652 + ], 1653 + type: "string" 1506 1654 } as const; 1507 1655 1508 1656 export const ModelWithNestedArrayEnumsDataBarSchema = { 1509 - enum: ['baz', 'qux'], 1510 - type: 'string' 1657 + enum: [ 1658 + "baz", 1659 + "qux" 1660 + ], 1661 + type: "string" 1511 1662 } as const; 1512 1663 1513 1664 export const ModelWithNestedArrayEnumsDataSchema = { 1514 - type: 'object', 1665 + type: "object", 1515 1666 properties: { 1516 1667 foo: { 1517 - type: 'array', 1668 + type: "array", 1518 1669 items: { 1519 - '$ref': '#/components/schemas/ModelWithNestedArrayEnumsDataFoo' 1670 + '$ref': "#/components/schemas/ModelWithNestedArrayEnumsDataFoo" 1520 1671 } 1521 1672 }, 1522 1673 bar: { 1523 - type: 'array', 1674 + type: "array", 1524 1675 items: { 1525 - '$ref': '#/components/schemas/ModelWithNestedArrayEnumsDataBar' 1676 + '$ref': "#/components/schemas/ModelWithNestedArrayEnumsDataBar" 1526 1677 } 1527 1678 } 1528 1679 } 1529 1680 } as const; 1530 1681 1531 1682 export const ModelWithNestedArrayEnumsSchema = { 1532 - type: 'object', 1683 + type: "object", 1533 1684 properties: { 1534 1685 array_strings: { 1535 - type: 'array', 1686 + type: "array", 1536 1687 items: { 1537 - type: 'string' 1688 + type: "string" 1538 1689 } 1539 1690 }, 1540 1691 data: { 1541 1692 allOf: [ 1542 1693 { 1543 - '$ref': '#/components/schemas/ModelWithNestedArrayEnumsData' 1694 + '$ref': "#/components/schemas/ModelWithNestedArrayEnumsData" 1544 1695 } 1545 1696 ] 1546 1697 } ··· 1548 1699 } as const; 1549 1700 1550 1701 export const ModelWithNestedCompositionEnumsSchema = { 1551 - type: 'object', 1702 + type: "object", 1552 1703 properties: { 1553 1704 foo: { 1554 1705 allOf: [ 1555 1706 { 1556 - '$ref': '#/components/schemas/ModelWithNestedArrayEnumsDataFoo' 1707 + '$ref': "#/components/schemas/ModelWithNestedArrayEnumsDataFoo" 1557 1708 } 1558 1709 ] 1559 1710 } ··· 1561 1712 } as const; 1562 1713 1563 1714 export const ModelWithReadOnlyAndWriteOnlySchema = { 1564 - type: 'object', 1565 - required: ['foo', 'bar'], 1715 + type: "object", 1716 + required: [ 1717 + "foo", 1718 + "bar" 1719 + ], 1566 1720 properties: { 1567 1721 foo: { 1568 - type: 'string' 1722 + type: "string" 1569 1723 }, 1570 1724 bar: { 1571 1725 readOnly: true, 1572 - type: 'string' 1726 + type: "string" 1573 1727 } 1574 1728 } 1575 1729 } as const; 1576 1730 1577 1731 export const ModelWithConstantSizeArraySchema = { 1578 - type: 'array', 1732 + type: "array", 1579 1733 items: { 1580 - type: 'number' 1734 + type: "number" 1581 1735 }, 1582 1736 minItems: 2, 1583 1737 maxItems: 2 1584 1738 } as const; 1585 1739 1586 1740 export const ModelWithAnyOfConstantSizeArraySchema = { 1587 - type: 'array', 1741 + type: "array", 1588 1742 items: { 1589 1743 oneOf: [ 1590 1744 { 1591 - type: 'number' 1745 + type: "number" 1592 1746 }, 1593 1747 { 1594 - type: 'string' 1748 + type: "string" 1595 1749 } 1596 1750 ] 1597 1751 }, ··· 1600 1754 } as const; 1601 1755 1602 1756 export const ModelWithPrefixItemsConstantSizeArraySchema = { 1603 - type: 'array', 1757 + type: "array", 1604 1758 items: { 1605 1759 oneOf: [ 1606 1760 { 1607 - '$ref': '#/components/schemas/ModelWithInteger' 1761 + '$ref': "#/components/schemas/ModelWithInteger" 1608 1762 }, 1609 1763 { 1610 - type: 'number' 1764 + type: "number" 1611 1765 }, 1612 1766 { 1613 - type: 'string' 1767 + type: "string" 1614 1768 } 1615 1769 ] 1616 1770 } 1617 1771 } as const; 1618 1772 1619 1773 export const ModelWithAnyOfConstantSizeArrayNullableSchema = { 1620 - type: 'array', 1774 + type: "array", 1621 1775 items: { 1622 1776 oneOf: [ 1623 1777 { 1624 - type: 'number', 1778 + type: "number", 1625 1779 nullable: true 1626 1780 }, 1627 1781 { 1628 - type: 'string' 1782 + type: "string" 1629 1783 } 1630 1784 ] 1631 1785 }, ··· 1634 1788 } as const; 1635 1789 1636 1790 export const ModelWithAnyOfConstantSizeArrayWithNSizeAndOptionsSchema = { 1637 - type: 'array', 1791 + type: "array", 1638 1792 items: { 1639 1793 oneOf: [ 1640 1794 { 1641 - type: 'number' 1795 + type: "number" 1642 1796 }, 1643 1797 { 1644 - '$ref': '#/components/schemas/import' 1798 + '$ref': "#/components/schemas/import" 1645 1799 } 1646 1800 ] 1647 1801 }, ··· 1650 1804 } as const; 1651 1805 1652 1806 export const ModelWithAnyOfConstantSizeArrayAndIntersectSchema = { 1653 - type: 'array', 1807 + type: "array", 1654 1808 items: { 1655 1809 allOf: [ 1656 1810 { 1657 - type: 'number' 1811 + type: "number" 1658 1812 }, 1659 1813 { 1660 - type: 'string' 1814 + type: "string" 1661 1815 } 1662 1816 ] 1663 1817 }, ··· 1666 1820 } as const; 1667 1821 1668 1822 export const ModelWithNumericEnumUnionSchema = { 1669 - type: 'object', 1823 + type: "object", 1670 1824 properties: { 1671 1825 value: { 1672 - type: 'number', 1673 - description: 'Период', 1674 - enum: [-10, -1, 0, 1, 3, 6, 12] 1826 + type: "number", 1827 + description: "Период", 1828 + enum: [ 1829 + -10, 1830 + -1, 1831 + 0, 1832 + 1, 1833 + 3, 1834 + 6, 1835 + 12 1836 + ] 1675 1837 } 1676 1838 } 1677 1839 } as const; 1678 1840 1679 1841 export const ModelWithBackticksInDescriptionSchema = { 1680 - description: 'Some description with `back ticks`', 1681 - type: 'object', 1842 + description: "Some description with `back ticks`", 1843 + type: "object", 1682 1844 properties: { 1683 1845 template: { 1684 - type: 'string', 1685 - description: `The template \`that\` should be used for parsing and importing the contents of the CSV file. 1686 - 1687 - <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> 1688 - <pre> 1689 - [ 1690 - { 1691 - "resourceType": "Asset", 1692 - "identifier": { 1693 - "name": "\${1}", 1694 - "domain": { 1695 - "name": "\${2}", 1696 - "community": { 1697 - "name": "Some Community" 1698 - } 1699 - } 1700 - }, 1701 - "attributes" : { 1702 - "00000000-0000-0000-0000-000000003115" : [ { 1703 - "value" : "\${3}" 1704 - } ], 1705 - "00000000-0000-0000-0000-000000000222" : [ { 1706 - "value" : "\${4}" 1707 - } ] 1708 - } 1709 - } 1710 - ] 1711 - </pre>` 1846 + type: "string", 1847 + description: "The template `that` should be used for parsing and importing the contents of the CSV file.\n\n<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>\n<pre>\n[\n {\n \"resourceType\": \"Asset\",\n \"identifier\": {\n \"name\": \"${1}\",\n \"domain\": {\n \"name\": \"${2}\",\n \"community\": {\n \"name\": \"Some Community\"\n }\n }\n },\n \"attributes\" : {\n \"00000000-0000-0000-0000-000000003115\" : [ {\n \"value\" : \"${3}\"\n } ],\n \"00000000-0000-0000-0000-000000000222\" : [ {\n \"value\" : \"${4}\"\n } ]\n }\n }\n]\n</pre>" 1712 1848 } 1713 1849 } 1714 1850 } as const; 1715 1851 1716 1852 export const ModelWithOneOfAndPropertiesSchema = { 1717 - type: 'object', 1853 + type: "object", 1718 1854 oneOf: [ 1719 1855 { 1720 - '$ref': '#/components/parameters/SimpleParameter' 1856 + '$ref': "#/components/parameters/SimpleParameter" 1721 1857 }, 1722 1858 { 1723 - '$ref': '#/components/schemas/NonAsciiStringæøåÆØÅöôêÊ字符串' 1859 + '$ref': "#/components/schemas/NonAsciiStringæøåÆØÅöôêÊ字符串" 1724 1860 } 1725 1861 ], 1726 - required: ['baz', 'qux'], 1862 + required: [ 1863 + "baz", 1864 + "qux" 1865 + ], 1727 1866 properties: { 1728 1867 baz: { 1729 - type: 'integer', 1730 - format: 'uint16', 1868 + type: "integer", 1869 + format: "uint16", 1731 1870 minimum: 0, 1732 1871 nullable: true 1733 1872 }, 1734 1873 qux: { 1735 - type: 'integer', 1736 - format: 'uint8', 1874 + type: "integer", 1875 + format: "uint8", 1737 1876 minimum: 0 1738 1877 } 1739 1878 } 1740 1879 } as const; 1741 1880 1742 1881 export const ParameterSimpleParameterUnusedSchema = { 1743 - description: 'Model used to test deduplication strategy (unused)', 1744 - type: 'string' 1882 + description: "Model used to test deduplication strategy (unused)", 1883 + type: "string" 1745 1884 } as const; 1746 1885 1747 1886 export const PostServiceWithEmptyTagResponseSchema = { 1748 - description: 'Model used to test deduplication strategy', 1749 - type: 'string' 1887 + description: "Model used to test deduplication strategy", 1888 + type: "string" 1750 1889 } as const; 1751 1890 1752 1891 export const PostServiceWithEmptyTagResponse2Schema = { 1753 - description: 'Model used to test deduplication strategy', 1754 - type: 'string' 1892 + description: "Model used to test deduplication strategy", 1893 + type: "string" 1755 1894 } as const; 1756 1895 1757 1896 export const DeleteFooDataSchema = { 1758 - description: 'Model used to test deduplication strategy', 1759 - type: 'string' 1897 + description: "Model used to test deduplication strategy", 1898 + type: "string" 1760 1899 } as const; 1761 1900 1762 1901 export const DeleteFooData2Schema = { 1763 - description: 'Model used to test deduplication strategy', 1764 - type: 'string' 1902 + description: "Model used to test deduplication strategy", 1903 + type: "string" 1765 1904 } as const; 1766 1905 1767 1906 export const importSchema = { 1768 - description: 'Model with restricted keyword name', 1769 - type: 'string' 1907 + description: "Model with restricted keyword name", 1908 + type: "string" 1770 1909 } as const; 1771 1910 1772 1911 export const SchemaWithFormRestrictedKeysSchema = { 1773 1912 properties: { 1774 1913 description: { 1775 - type: 'string' 1914 + type: "string" 1776 1915 }, 1777 1916 'x-enum-descriptions': { 1778 - type: 'string' 1917 + type: "string" 1779 1918 }, 1780 1919 'x-enum-varnames': { 1781 - type: 'string' 1920 + type: "string" 1782 1921 }, 1783 1922 'x-enumNames': { 1784 - type: 'string' 1923 + type: "string" 1785 1924 }, 1786 1925 title: { 1787 - type: 'string' 1926 + type: "string" 1788 1927 }, 1789 1928 object: { 1790 - type: 'object', 1929 + type: "object", 1791 1930 properties: { 1792 1931 description: { 1793 - type: 'string' 1932 + type: "string" 1794 1933 }, 1795 1934 'x-enum-descriptions': { 1796 - type: 'string' 1935 + type: "string" 1797 1936 }, 1798 1937 'x-enum-varnames': { 1799 - type: 'string' 1938 + type: "string" 1800 1939 }, 1801 1940 'x-enumNames': { 1802 - type: 'string' 1941 + type: "string" 1803 1942 }, 1804 1943 title: { 1805 - type: 'string' 1944 + type: "string" 1806 1945 } 1807 1946 } 1808 1947 }, 1809 1948 array: { 1810 - type: 'array', 1949 + type: "array", 1811 1950 items: { 1812 - type: 'object', 1951 + type: "object", 1813 1952 properties: { 1814 1953 description: { 1815 - type: 'string' 1954 + type: "string" 1816 1955 }, 1817 1956 'x-enum-descriptions': { 1818 - type: 'string' 1957 + type: "string" 1819 1958 }, 1820 1959 'x-enum-varnames': { 1821 - type: 'string' 1960 + type: "string" 1822 1961 }, 1823 1962 'x-enumNames': { 1824 - type: 'string' 1963 + type: "string" 1825 1964 }, 1826 1965 title: { 1827 - type: 'string' 1966 + type: "string" 1828 1967 } 1829 1968 } 1830 1969 } ··· 1833 1972 } as const; 1834 1973 1835 1974 export const io_k8s_apimachinery_pkg_apis_meta_v1_DeleteOptionsSchema = { 1836 - description: 'This schema was giving PascalCase transformations a hard time', 1975 + description: "This schema was giving PascalCase transformations a hard time", 1837 1976 properties: { 1838 1977 preconditions: { 1839 1978 allOf: [ 1840 1979 { 1841 - '$ref': '#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Preconditions' 1980 + '$ref': "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Preconditions" 1842 1981 } 1843 1982 ], 1844 - description: 'Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned.' 1983 + description: "Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned." 1845 1984 } 1846 1985 }, 1847 - type: 'object' 1986 + type: "object" 1848 1987 } as const; 1849 1988 1850 1989 export const io_k8s_apimachinery_pkg_apis_meta_v1_PreconditionsSchema = { 1851 - description: 'This schema was giving PascalCase transformations a hard time', 1990 + description: "This schema was giving PascalCase transformations a hard time", 1852 1991 properties: { 1853 1992 resourceVersion: { 1854 - description: 'Specifies the target ResourceVersion', 1855 - type: 'string' 1993 + description: "Specifies the target ResourceVersion", 1994 + type: "string" 1856 1995 }, 1857 1996 uid: { 1858 - description: 'Specifies the target UID.', 1859 - type: 'string' 1997 + description: "Specifies the target UID.", 1998 + type: "string" 1860 1999 } 1861 2000 }, 1862 - type: 'object' 2001 + type: "object" 1863 2002 } as const; 1864 2003 1865 2004 export const AdditionalPropertiesUnknownIssueSchema = { 1866 - type: 'object', 2005 + type: "object", 1867 2006 additionalProperties: { 1868 2007 anyOf: [ 1869 2008 { 1870 - type: 'string' 2009 + type: "string" 1871 2010 }, 1872 2011 { 1873 - type: 'number' 2012 + type: "number" 1874 2013 } 1875 2014 ] 1876 2015 } 1877 2016 } as const; 1878 2017 1879 2018 export const AdditionalPropertiesUnknownIssue2Schema = { 1880 - type: 'object', 2019 + type: "object", 1881 2020 additionalProperties: { 1882 2021 anyOf: [ 1883 2022 { 1884 - type: 'string' 2023 + type: "string" 1885 2024 }, 1886 2025 { 1887 - type: 'number' 2026 + type: "number" 1888 2027 } 1889 2028 ] 1890 2029 } 1891 2030 } as const; 1892 2031 1893 2032 export const AdditionalPropertiesUnknownIssue3Schema = { 1894 - type: 'object', 2033 + type: "object", 1895 2034 allOf: [ 1896 2035 { 1897 - type: 'string' 2036 + type: "string" 1898 2037 }, 1899 2038 { 1900 - type: 'object', 1901 - required: ['entries'], 2039 + type: "object", 2040 + required: [ 2041 + "entries" 2042 + ], 1902 2043 properties: { 1903 2044 entries: { 1904 - type: 'object', 2045 + type: "object", 1905 2046 additionalProperties: { 1906 - '$ref': '#/components/schemas/AdditionalPropertiesUnknownIssue' 2047 + '$ref': "#/components/schemas/AdditionalPropertiesUnknownIssue" 1907 2048 } 1908 2049 } 1909 2050 } ··· 1912 2053 } as const; 1913 2054 1914 2055 export const AdditionalPropertiesIntegerIssueSchema = { 1915 - type: 'object', 1916 - required: ['value'], 2056 + type: "object", 2057 + required: [ 2058 + "value" 2059 + ], 1917 2060 properties: { 1918 2061 value: { 1919 - type: 'integer' 2062 + type: "integer" 1920 2063 } 1921 2064 }, 1922 2065 additionalProperties: { 1923 - type: 'integer' 2066 + type: "integer" 1924 2067 } 1925 2068 } as const; 1926 2069 ··· 1931 2074 { 1932 2075 oneOf: [ 1933 2076 { 1934 - '$ref': '#/components/schemas/ConstValue' 2077 + '$ref': "#/components/schemas/ConstValue" 1935 2078 }, 1936 2079 { 1937 - '$ref': '#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.Boolean]' 2080 + '$ref': "#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.Boolean]" 1938 2081 } 1939 2082 ] 1940 2083 }, 1941 2084 { 1942 - '$ref': '#/components/schemas/3e-num_1Период' 2085 + '$ref': "#/components/schemas/3e-num_1Период" 1943 2086 } 1944 2087 ] 1945 2088 }, 1946 2089 { 1947 - '$ref': '#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.String]' 2090 + '$ref': "#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.String]" 1948 2091 } 1949 2092 ] 1950 2093 } as const; 1951 2094 1952 2095 export const Generic_Schema_Duplicate_Issue_1_System_Boolean_Schema = { 1953 - type: 'object', 2096 + type: "object", 1954 2097 properties: { 1955 2098 item: { 1956 - type: 'boolean' 2099 + type: "boolean" 1957 2100 }, 1958 2101 error: { 1959 - type: 'string', 2102 + type: "string", 1960 2103 nullable: true 1961 2104 }, 1962 2105 hasError: { 1963 - type: 'boolean', 2106 + type: "boolean", 1964 2107 readOnly: true 1965 2108 }, 1966 2109 data: { 1967 - type: 'object', 2110 + type: "object", 1968 2111 additionalProperties: false 1969 2112 } 1970 2113 }, ··· 1972 2115 } as const; 1973 2116 1974 2117 export const Generic_Schema_Duplicate_Issue_1_System_String_Schema = { 1975 - type: 'object', 2118 + type: "object", 1976 2119 properties: { 1977 2120 item: { 1978 - type: 'string', 2121 + type: "string", 1979 2122 nullable: true 1980 2123 }, 1981 2124 error: { 1982 - type: 'string', 2125 + type: "string", 1983 2126 nullable: true 1984 2127 }, 1985 2128 hasError: { 1986 - type: 'boolean', 2129 + type: "boolean", 1987 2130 readOnly: true 1988 2131 } 1989 2132 }, ··· 1991 2134 } as const; 1992 2135 1993 2136 export const external_shared_ExternalSharedModelSchema = { 1994 - type: 'object', 2137 + type: "object", 1995 2138 properties: { 1996 2139 id: { 1997 - type: 'string' 2140 + type: "string" 1998 2141 }, 1999 2142 name: { 2000 - type: 'string' 2143 + type: "string" 2001 2144 } 2002 2145 }, 2003 - required: ['id'] 2146 + required: [ 2147 + "id" 2148 + ] 2004 2149 } as const; 2005 2150 2006 2151 export const ModelWithReferenceWritableSchema = { 2007 - description: 'This is a model with one property containing a reference', 2008 - type: 'object', 2152 + description: "This is a model with one property containing a reference", 2153 + type: "object", 2009 2154 properties: { 2010 2155 prop: { 2011 - '$ref': '#/components/schemas/ModelWithPropertiesWritable' 2156 + '$ref': "#/components/schemas/ModelWithPropertiesWritable" 2012 2157 } 2013 2158 } 2014 2159 } as const; 2015 2160 2016 2161 export const ModelWithArrayReadOnlyAndWriteOnlyWritableSchema = { 2017 - description: 'This is a model with one property containing an array', 2018 - type: 'object', 2162 + description: "This is a model with one property containing an array", 2163 + type: "object", 2019 2164 properties: { 2020 2165 prop: { 2021 - type: 'array', 2166 + type: "array", 2022 2167 items: { 2023 - '$ref': '#/components/schemas/ModelWithReadOnlyAndWriteOnlyWritable' 2168 + '$ref': "#/components/schemas/ModelWithReadOnlyAndWriteOnlyWritable" 2024 2169 } 2025 2170 }, 2026 2171 propWithFile: { 2027 - type: 'array', 2172 + type: "array", 2028 2173 items: { 2029 - format: 'binary', 2030 - type: 'string' 2174 + format: "binary", 2175 + type: "string" 2031 2176 } 2032 2177 }, 2033 2178 propWithNumber: { 2034 - type: 'array', 2179 + type: "array", 2035 2180 items: { 2036 - type: 'number' 2181 + type: "number" 2037 2182 } 2038 2183 } 2039 2184 } 2040 2185 } as const; 2041 2186 2042 2187 export const ModelWithPropertiesWritableSchema = { 2043 - description: 'This is a model with one nested property', 2044 - type: 'object', 2045 - required: ['required', 'requiredAndNullable'], 2188 + description: "This is a model with one nested property", 2189 + type: "object", 2190 + required: [ 2191 + "required", 2192 + "requiredAndNullable" 2193 + ], 2046 2194 properties: { 2047 2195 required: { 2048 - type: 'string' 2196 + type: "string" 2049 2197 }, 2050 2198 requiredAndNullable: { 2051 - type: 'string', 2199 + type: "string", 2052 2200 nullable: true 2053 2201 }, 2054 2202 string: { 2055 - type: 'string' 2203 + type: "string" 2056 2204 }, 2057 2205 number: { 2058 - type: 'number' 2206 + type: "number" 2059 2207 }, 2060 2208 boolean: { 2061 - type: 'boolean' 2209 + type: "boolean" 2062 2210 }, 2063 2211 reference: { 2064 - '$ref': '#/components/schemas/ModelWithString' 2212 + '$ref': "#/components/schemas/ModelWithString" 2065 2213 }, 2066 2214 'property with space': { 2067 - type: 'string' 2215 + type: "string" 2068 2216 }, 2069 2217 default: { 2070 - type: 'string' 2218 + type: "string" 2071 2219 }, 2072 2220 try: { 2073 - type: 'string' 2221 + type: "string" 2074 2222 } 2075 2223 } 2076 2224 } as const; 2077 2225 2078 2226 export const ModelWithPatternWritableSchema = { 2079 - description: 'This is a model that contains a some patterns', 2080 - type: 'object', 2081 - required: ['key', 'name'], 2227 + description: "This is a model that contains a some patterns", 2228 + type: "object", 2229 + required: [ 2230 + "key", 2231 + "name" 2232 + ], 2082 2233 properties: { 2083 2234 key: { 2084 2235 maxLength: 64, 2085 - pattern: '^[a-zA-Z0-9_]*$', 2086 - type: 'string' 2236 + pattern: "^[a-zA-Z0-9_]*$", 2237 + type: "string" 2087 2238 }, 2088 2239 name: { 2089 2240 maxLength: 255, 2090 - type: 'string' 2241 + type: "string" 2091 2242 }, 2092 2243 id: { 2093 - type: 'string', 2094 - pattern: '^\\d{2}-\\d{3}-\\d{4}$' 2244 + type: "string", 2245 + pattern: "^\\d{2}-\\d{3}-\\d{4}$" 2095 2246 }, 2096 2247 text: { 2097 - type: 'string', 2098 - pattern: '^\\w+$' 2248 + type: "string", 2249 + pattern: "^\\w+$" 2099 2250 }, 2100 2251 patternWithSingleQuotes: { 2101 - type: 'string', 2252 + type: "string", 2102 2253 pattern: "^[a-zA-Z0-9']*$" 2103 2254 }, 2104 2255 patternWithNewline: { 2105 - type: 'string', 2106 - pattern: 'aaa\\nbbb' 2256 + type: "string", 2257 + pattern: "aaa\\nbbb" 2107 2258 }, 2108 2259 patternWithBacktick: { 2109 - type: 'string', 2110 - pattern: 'aaa`bbb' 2260 + type: "string", 2261 + pattern: "aaa`bbb" 2111 2262 } 2112 2263 } 2113 2264 } as const; 2114 2265 2115 2266 export const FileWritableSchema = { 2116 - required: ['mime'], 2117 - type: 'object', 2267 + required: [ 2268 + "mime" 2269 + ], 2270 + type: "object", 2118 2271 properties: { 2119 2272 mime: { 2120 - title: 'Mime', 2121 - type: 'string', 2273 + title: "Mime", 2274 + type: "string", 2122 2275 maxLength: 24, 2123 2276 minLength: 1 2124 2277 } ··· 2126 2279 } as const; 2127 2280 2128 2281 export const ModelWithReadOnlyAndWriteOnlyWritableSchema = { 2129 - type: 'object', 2130 - required: ['foo', 'baz'], 2282 + type: "object", 2283 + required: [ 2284 + "foo", 2285 + "baz" 2286 + ], 2131 2287 properties: { 2132 2288 foo: { 2133 - type: 'string' 2289 + type: "string" 2134 2290 }, 2135 2291 baz: { 2136 - type: 'string', 2292 + type: "string", 2137 2293 writeOnly: true 2138 2294 } 2139 2295 } 2140 2296 } as const; 2141 2297 2142 2298 export const ModelWithAnyOfConstantSizeArrayWithNSizeAndOptionsWritableSchema = { 2143 - type: 'array', 2299 + type: "array", 2144 2300 items: { 2145 2301 oneOf: [ 2146 2302 { 2147 - type: 'number' 2303 + type: "number" 2148 2304 }, 2149 2305 { 2150 - '$ref': '#/components/schemas/import' 2306 + '$ref': "#/components/schemas/import" 2151 2307 } 2152 2308 ] 2153 2309 }, ··· 2156 2312 } as const; 2157 2313 2158 2314 export const AdditionalPropertiesUnknownIssueWritableSchema = { 2159 - type: 'object', 2315 + type: "object", 2160 2316 additionalProperties: { 2161 2317 anyOf: [ 2162 2318 { 2163 - type: 'string' 2319 + type: "string" 2164 2320 }, 2165 2321 { 2166 - type: 'number' 2322 + type: "number" 2167 2323 } 2168 2324 ] 2169 2325 } ··· 2176 2332 { 2177 2333 oneOf: [ 2178 2334 { 2179 - '$ref': '#/components/schemas/ConstValue' 2335 + '$ref': "#/components/schemas/ConstValue" 2180 2336 }, 2181 2337 { 2182 - '$ref': '#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.Boolean]' 2338 + '$ref': "#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.Boolean]" 2183 2339 } 2184 2340 ] 2185 2341 }, 2186 2342 { 2187 - '$ref': '#/components/schemas/3e-num_1Период' 2343 + '$ref': "#/components/schemas/3e-num_1Период" 2188 2344 } 2189 2345 ] 2190 2346 }, 2191 2347 { 2192 - '$ref': '#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.String]' 2348 + '$ref': "#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.String]" 2193 2349 } 2194 2350 ] 2195 2351 } as const; 2196 2352 2197 2353 export const Generic_Schema_Duplicate_Issue_1_System_Boolean_WritableSchema = { 2198 - type: 'object', 2354 + type: "object", 2199 2355 properties: { 2200 2356 item: { 2201 - type: 'boolean' 2357 + type: "boolean" 2202 2358 }, 2203 2359 error: { 2204 - type: 'string', 2360 + type: "string", 2205 2361 nullable: true 2206 2362 }, 2207 2363 data: { 2208 - type: 'object', 2364 + type: "object", 2209 2365 additionalProperties: false 2210 2366 } 2211 2367 }, ··· 2213 2369 } as const; 2214 2370 2215 2371 export const Generic_Schema_Duplicate_Issue_1_System_String_WritableSchema = { 2216 - type: 'object', 2372 + type: "object", 2217 2373 properties: { 2218 2374 item: { 2219 - type: 'string', 2375 + type: "string", 2220 2376 nullable: true 2221 2377 }, 2222 2378 error: { 2223 - type: 'string', 2379 + type: "string", 2224 2380 nullable: true 2225 2381 } 2226 2382 },
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/sdk/default/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/sdk/throwOnError/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base', 18 - throwOnError: true 19 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base", throwOnError: true }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@pinia/colada/fetch/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/angular-query-experimental/axios/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseURL: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseURL: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/angular-query-experimental/fetch/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/react-query/axios/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseURL: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseURL: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/react-query/fetch/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/solid-query/axios/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseURL: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseURL: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/solid-query/fetch/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/svelte-query/axios/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseURL: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseURL: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/svelte-query/fetch/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/vue-query/axios/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseURL: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseURL: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/vue-query/fetch/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/servers/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'https://foo.com/v1' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "https://foo.com/v1" }));
+2 -6
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/transformers-all-of/transformers.gen.ts
··· 3 3 import type { GetFooResponse } from './types.gen'; 4 4 5 5 const fooSchemaResponseTransformer = (data: any) => { 6 - data.foo = data.foo.map((item: any) => { 7 - return barSchemaResponseTransformer(item); 8 - }); 6 + data.foo = data.foo.map((item: any) => barSchemaResponseTransformer(item)); 9 7 return data; 10 8 }; 11 9 12 10 const barSchemaResponseTransformer = (data: any) => { 13 - data.foo = data.foo.map((item: any) => { 14 - return bazSchemaResponseTransformer(item); 15 - }); 11 + data.foo = data.foo.map((item: any) => bazSchemaResponseTransformer(item)); 16 12 return data; 17 13 }; 18 14
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/transformers-any-of-null/transformers.gen.ts
··· 16 16 }; 17 17 18 18 export const getFooResponseTransformer = async (data: any): Promise<GetFooResponse> => { 19 - data = data.map((item: any) => { 20 - return fooSchemaResponseTransformer(item); 21 - }); 19 + data = data.map((item: any) => fooSchemaResponseTransformer(item)); 22 20 return data; 23 21 };
+2 -6
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/transformers-recursive/transformers.gen.ts
··· 7 7 data.createdAt = new Date(data.createdAt); 8 8 } 9 9 if (data.children) { 10 - data.children = data.children.map((item: any) => { 11 - return treeNodeSchemaResponseTransformer(item); 12 - }); 10 + data.children = data.children.map((item: any) => treeNodeSchemaResponseTransformer(item)); 13 11 } 14 12 return data; 15 13 }; 16 14 17 15 export const getTreeResponseTransformer = async (data: any): Promise<GetTreeResponse> => { 18 - data = data.map((item: any) => { 19 - return treeNodeSchemaResponseTransformer(item); 20 - }); 16 + data = data.map((item: any) => treeNodeSchemaResponseTransformer(item)); 21 17 return data; 22 18 };
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/base-url-number/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/base-url-strict/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/base-url-string/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'https://foo.com' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "https://foo.com" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/clean-false/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/default/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/import-file-extension-ts/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/sdk-client-optional/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/sdk-client-required/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/tsconfig-nodenext-sdk/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/base-url-number/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseURL: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseURL: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/base-url-strict/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseURL: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseURL: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/base-url-string/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseURL: 'https://foo.com' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseURL: "https://foo.com" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/clean-false/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseURL: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseURL: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/default/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseURL: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseURL: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/import-file-extension-ts/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseURL: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseURL: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/sdk-client-optional/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseURL: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseURL: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/sdk-client-required/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseURL: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseURL: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/tsconfig-nodenext-sdk/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseURL: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseURL: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/base-url-number/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/base-url-strict/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/base-url-string/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'https://foo.com' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "https://foo.com" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/clean-false/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/default/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/import-file-extension-ts/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/sdk-client-optional/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/sdk-client-required/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/tsconfig-nodenext-sdk/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/base-url-number/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/base-url-strict/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/base-url-string/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'https://foo.com' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "https://foo.com" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/clean-false/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/default/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/import-file-extension-ts/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/sdk-client-optional/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/sdk-client-required/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/tsconfig-nodenext-sdk/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/base-url-number/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/base-url-strict/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/base-url-string/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'https://foo.com' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "https://foo.com" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/clean-false/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/default/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/import-file-extension-ts/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/sdk-client-optional/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/sdk-client-required/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/tsconfig-nodenext-sdk/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/base-url-number/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseURL: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseURL: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/base-url-strict/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseURL: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseURL: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/base-url-string/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseURL: 'https://foo.com' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseURL: "https://foo.com" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/clean-false/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseURL: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseURL: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/default/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseURL: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseURL: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/import-file-extension-ts/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseURL: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseURL: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/sdk-client-optional/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseURL: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseURL: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/sdk-client-required/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseURL: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseURL: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/tsconfig-nodenext-sdk/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseURL: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseURL: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/base-url-number/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/base-url-strict/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/base-url-string/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'https://foo.com' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "https://foo.com" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/clean-false/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/default/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/import-file-extension-ts/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/sdk-client-optional/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/sdk-client-required/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/tsconfig-nodenext-sdk/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/client-custom/base-url-number/custom-client.gen.ts
··· 14 14 */ 15 15 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 16 16 17 - export const client = createClient(createConfig<ClientOptions2>({ 18 - baseUrl: 'http://localhost:3000/base' 19 - })); 17 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/client-custom/base-url-strict/custom-client.gen.ts
··· 14 14 */ 15 15 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 16 16 17 - export const client = createClient(createConfig<ClientOptions2>({ 18 - baseUrl: 'http://localhost:3000/base' 19 - })); 17 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/client-custom/base-url-string/custom-client.gen.ts
··· 14 14 */ 15 15 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 16 16 17 - export const client = createClient(createConfig<ClientOptions2>({ 18 - baseUrl: 'https://foo.com' 19 - })); 17 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "https://foo.com" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/client-custom/bundle/custom-client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/client-custom/default/custom-client.gen.ts
··· 14 14 */ 15 15 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 16 16 17 - export const client = createClient(createConfig<ClientOptions2>({ 18 - baseUrl: 'http://localhost:3000/base' 19 - })); 17 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/client-custom/sdk-client-optional/custom-client.gen.ts
··· 14 14 */ 15 15 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 16 16 17 - export const client = createClient(createConfig<ClientOptions2>({ 18 - baseUrl: 'http://localhost:3000/base' 19 - })); 17 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/client-custom/sdk-client-required/custom-client.gen.ts
··· 14 14 */ 15 15 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 16 16 17 - export const client = createClient(createConfig<ClientOptions2>({ 18 - baseUrl: 'http://localhost:3000/base' 19 - })); 17 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/my-client/base-url-number/custom.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/my-client/base-url-strict/custom.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/my-client/base-url-string/custom.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'https://foo.com' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "https://foo.com" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/my-client/bundle/custom.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/my-client/default/custom.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/my-client/sdk-client-optional/custom.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/my-client/sdk-client-required/custom.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@angular/common/default-class/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@angular/common/default/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+919 -700
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@hey-api/schemas/default/schemas.gen.ts
··· 1 1 // This file is auto-generated by @hey-api/openapi-ts 2 2 3 3 export const _400Schema = { 4 - description: 'Model with number-only name', 5 - type: 'string' 4 + description: "Model with number-only name", 5 + type: "string" 6 6 } as const; 7 7 8 8 export const ExternalRefASchema = { 9 - description: 'External ref to shared model (A)', 10 - '$ref': '#/components/schemas/external-shared_ExternalSharedModel' 9 + description: "External ref to shared model (A)", 10 + '$ref': "#/components/schemas/external-shared_ExternalSharedModel" 11 11 } as const; 12 12 13 13 export const ExternalRefBSchema = { 14 - description: 'External ref to shared model (B)', 15 - '$ref': '#/components/schemas/external-shared_ExternalSharedModel' 14 + description: "External ref to shared model (B)", 15 + '$ref': "#/components/schemas/external-shared_ExternalSharedModel" 16 16 } as const; 17 17 18 18 export const camelCaseCommentWithBreaksSchema = { 19 - description: `Testing multiline comments in string: First line 20 - Second line 21 - 22 - Fourth line`, 23 - type: 'integer' 19 + description: "Testing multiline comments in string: First line\nSecond line\n\nFourth line", 20 + type: "integer" 24 21 } as const; 25 22 26 23 export const CommentWithBreaksSchema = { 27 - description: `Testing multiline comments in string: First line 28 - Second line 29 - 30 - Fourth line`, 31 - type: 'integer' 24 + description: "Testing multiline comments in string: First line\nSecond line\n\nFourth line", 25 + type: "integer" 32 26 } as const; 33 27 34 28 export const CommentWithBackticksSchema = { 35 - description: 'Testing backticks in string: `backticks` and ```multiple backticks``` should work', 36 - type: 'integer' 29 + description: "Testing backticks in string: `backticks` and ```multiple backticks``` should work", 30 + type: "integer" 37 31 } as const; 38 32 39 33 export const CommentWithBackticksAndQuotesSchema = { 40 - description: `Testing backticks and quotes in string: \`backticks\`, 'quotes', "double quotes" and \`\`\`multiple backticks\`\`\` should work`, 41 - type: 'integer' 34 + description: "Testing backticks and quotes in string: `backticks`, 'quotes', \"double quotes\" and ```multiple backticks``` should work", 35 + type: "integer" 42 36 } as const; 43 37 44 38 export const CommentWithSlashesSchema = { 45 - description: 'Testing slashes in string: \\backwards\\\\\\ and /forwards/// should work', 46 - type: 'integer' 39 + description: "Testing slashes in string: \\backwards\\\\\\ and /forwards/// should work", 40 + type: "integer" 47 41 } as const; 48 42 49 43 export const CommentWithExpressionPlaceholdersSchema = { 50 - description: 'Testing expression placeholders in string: ${expression} should work', 51 - type: 'integer' 44 + description: "Testing expression placeholders in string: ${expression} should work", 45 + type: "integer" 52 46 } as const; 53 47 54 48 export const CommentWithQuotesSchema = { 55 - description: `Testing quotes in string: 'single quote''' and "double quotes""" should work`, 56 - type: 'integer' 49 + description: "Testing quotes in string: 'single quote''' and \"double quotes\"\"\" should work", 50 + type: "integer" 57 51 } as const; 58 52 59 53 export const CommentWithReservedCharactersSchema = { 60 - description: 'Testing reserved characters in string: /* inline */ and /** inline **/ should work', 61 - type: 'integer' 54 + description: "Testing reserved characters in string: /* inline */ and /** inline **/ should work", 55 + type: "integer" 62 56 } as const; 63 57 64 58 export const SimpleIntegerSchema = { 65 - description: 'This is a simple number', 66 - type: 'integer' 59 + description: "This is a simple number", 60 + type: "integer" 67 61 } as const; 68 62 69 63 export const SimpleBooleanSchema = { 70 - description: 'This is a simple boolean', 71 - type: 'boolean' 64 + description: "This is a simple boolean", 65 + type: "boolean" 72 66 } as const; 73 67 74 68 export const SimpleStringSchema = { 75 - description: 'This is a simple string', 76 - type: 'string' 69 + description: "This is a simple string", 70 + type: "string" 77 71 } as const; 78 72 79 73 export const NonAsciiStringæøåÆØÅöôêÊ字符串Schema = { 80 - description: 'A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串)', 81 - type: 'string' 74 + description: "A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串)", 75 + type: "string" 82 76 } as const; 83 77 84 78 export const SimpleFileSchema = { 85 - description: 'This is a simple file', 86 - format: 'binary', 87 - type: 'string' 79 + description: "This is a simple file", 80 + format: "binary", 81 + type: "string" 88 82 } as const; 89 83 90 84 export const SimpleReferenceSchema = { 91 - description: 'This is a simple reference', 92 - '$ref': '#/components/schemas/ModelWithString' 85 + description: "This is a simple reference", 86 + '$ref': "#/components/schemas/ModelWithString" 93 87 } as const; 94 88 95 89 export const SimpleStringWithPatternSchema = { 96 - description: 'This is a simple string', 90 + description: "This is a simple string", 97 91 maxLength: 64, 98 - pattern: '^[a-zA-Z0-9_]*$', 99 - type: ['string', 'null'] 92 + pattern: "^[a-zA-Z0-9_]*$", 93 + type: [ 94 + "string", 95 + "null" 96 + ] 100 97 } as const; 101 98 102 99 export const EnumWithStringsSchema = { 103 - description: 'This is a simple enum with strings', 104 - enum: ['Success', 'Warning', 'Error', "'Single Quote'", '"Double Quotes"', 'Non-ascii: øæåôöØÆÅÔÖ字符串'] 100 + description: "This is a simple enum with strings", 101 + enum: [ 102 + "Success", 103 + "Warning", 104 + "Error", 105 + "'Single Quote'", 106 + "\"Double Quotes\"", 107 + "Non-ascii: øæåôöØÆÅÔÖ字符串" 108 + ] 105 109 } as const; 106 110 107 111 export const EnumWithReplacedCharactersSchema = { 108 - enum: ["'Single Quote'", '"Double Quotes"', 'øæåôöØÆÅÔÖ字符串', 3.1, ''], 109 - type: 'string' 112 + enum: [ 113 + "'Single Quote'", 114 + "\"Double Quotes\"", 115 + "øæåôöØÆÅÔÖ字符串", 116 + 3.1, 117 + "" 118 + ], 119 + type: "string" 110 120 } as const; 111 121 112 122 export const EnumWithNumbersSchema = { 113 - description: 'This is a simple enum with numbers', 114 - enum: [1, 2, 3, 1.1, 1.2, 1.3, 100, 200, 300, -100, -200, -300, -1.1, -1.2, -1.3], 123 + description: "This is a simple enum with numbers", 124 + enum: [ 125 + 1, 126 + 2, 127 + 3, 128 + 1.1, 129 + 1.2, 130 + 1.3, 131 + 100, 132 + 200, 133 + 300, 134 + -100, 135 + -200, 136 + -300, 137 + -1.1, 138 + -1.2, 139 + -1.3 140 + ], 115 141 default: 200 116 142 } as const; 117 143 118 144 export const EnumFromDescriptionSchema = { 119 - description: 'Success=1,Warning=2,Error=3', 120 - type: 'number' 145 + description: "Success=1,Warning=2,Error=3", 146 + type: "number" 121 147 } as const; 122 148 123 149 export const EnumWithExtensionsSchema = { 124 - description: 'This is a simple enum with numbers', 125 - enum: [200, 400, 500], 126 - 'x-enum-varnames': ['CUSTOM_SUCCESS', 'CUSTOM_WARNING', 'CUSTOM_ERROR'], 127 - 'x-enum-descriptions': ['Used when the status of something is successful', 'Used when the status of something has a warning', 'Used when the status of something has an error'] 150 + description: "This is a simple enum with numbers", 151 + enum: [ 152 + 200, 153 + 400, 154 + 500 155 + ], 156 + 'x-enum-varnames': [ 157 + "CUSTOM_SUCCESS", 158 + "CUSTOM_WARNING", 159 + "CUSTOM_ERROR" 160 + ], 161 + 'x-enum-descriptions': [ 162 + "Used when the status of something is successful", 163 + "Used when the status of something has a warning", 164 + "Used when the status of something has an error" 165 + ] 128 166 } as const; 129 167 130 168 export const EnumWithXEnumNamesSchema = { 131 - enum: [0, 1, 2], 132 - 'x-enumNames': ['zero', 'one', 'two'] 169 + enum: [ 170 + 0, 171 + 1, 172 + 2 173 + ], 174 + 'x-enumNames': [ 175 + "zero", 176 + "one", 177 + "two" 178 + ] 133 179 } as const; 134 180 135 181 export const ArrayWithNumbersSchema = { 136 - description: 'This is a simple array with numbers', 137 - type: 'array', 182 + description: "This is a simple array with numbers", 183 + type: "array", 138 184 items: { 139 - type: 'integer' 185 + type: "integer" 140 186 } 141 187 } as const; 142 188 143 189 export const ArrayWithBooleansSchema = { 144 - description: 'This is a simple array with booleans', 145 - type: 'array', 190 + description: "This is a simple array with booleans", 191 + type: "array", 146 192 items: { 147 - type: 'boolean' 193 + type: "boolean" 148 194 } 149 195 } as const; 150 196 151 197 export const ArrayWithStringsSchema = { 152 - description: 'This is a simple array with strings', 153 - type: 'array', 198 + description: "This is a simple array with strings", 199 + type: "array", 154 200 items: { 155 - type: 'string' 201 + type: "string" 156 202 }, 157 - default: ['test'] 203 + default: [ 204 + "test" 205 + ] 158 206 } as const; 159 207 160 208 export const ArrayWithReferencesSchema = { 161 - description: 'This is a simple array with references', 162 - type: 'array', 209 + description: "This is a simple array with references", 210 + type: "array", 163 211 items: { 164 - '$ref': '#/components/schemas/ModelWithString' 212 + '$ref': "#/components/schemas/ModelWithString" 165 213 } 166 214 } as const; 167 215 168 216 export const ArrayWithArraySchema = { 169 - description: 'This is a simple array containing an array', 170 - type: 'array', 217 + description: "This is a simple array containing an array", 218 + type: "array", 171 219 items: { 172 - type: 'array', 220 + type: "array", 173 221 items: { 174 - '$ref': '#/components/schemas/ModelWithString' 222 + '$ref': "#/components/schemas/ModelWithString" 175 223 } 176 224 } 177 225 } as const; 178 226 179 227 export const ArrayWithPropertiesSchema = { 180 - description: 'This is a simple array with properties', 181 - type: 'array', 228 + description: "This is a simple array with properties", 229 + type: "array", 182 230 items: { 183 - type: 'object', 231 + type: "object", 184 232 properties: { 185 233 '16x16': { 186 - '$ref': '#/components/schemas/camelCaseCommentWithBreaks' 234 + '$ref': "#/components/schemas/camelCaseCommentWithBreaks" 187 235 }, 188 236 bar: { 189 - type: 'string' 237 + type: "string" 190 238 } 191 239 } 192 240 } 193 241 } as const; 194 242 195 243 export const ArrayWithAnyOfPropertiesSchema = { 196 - description: 'This is a simple array with any of properties', 197 - type: 'array', 244 + description: "This is a simple array with any of properties", 245 + type: "array", 198 246 items: { 199 247 anyOf: [ 200 248 { 201 - type: 'object', 249 + type: "object", 202 250 properties: { 203 251 foo: { 204 - type: 'string', 205 - default: 'test' 252 + type: "string", 253 + default: "test" 206 254 } 207 255 } 208 256 }, 209 257 { 210 - type: 'object', 258 + type: "object", 211 259 properties: { 212 260 bar: { 213 - type: 'string' 261 + type: "string" 214 262 } 215 263 } 216 264 } ··· 219 267 } as const; 220 268 221 269 export const AnyOfAnyAndNullSchema = { 222 - type: 'object', 270 + type: "object", 223 271 properties: { 224 272 data: { 225 273 anyOf: [ 226 274 {}, 227 275 { 228 - type: 'null' 276 + type: "null" 229 277 } 230 278 ] 231 279 } ··· 233 281 } as const; 234 282 235 283 export const AnyOfArraysSchema = { 236 - description: 'This is a simple array with any of properties', 237 - type: 'object', 284 + description: "This is a simple array with any of properties", 285 + type: "object", 238 286 properties: { 239 287 results: { 240 288 items: { 241 289 anyOf: [ 242 290 { 243 - type: 'object', 291 + type: "object", 244 292 properties: { 245 293 foo: { 246 - type: 'string' 294 + type: "string" 247 295 } 248 296 } 249 297 }, 250 298 { 251 - type: 'object', 299 + type: "object", 252 300 properties: { 253 301 bar: { 254 - type: 'string' 302 + type: "string" 255 303 } 256 304 } 257 305 } 258 306 ] 259 307 }, 260 - type: 'array' 308 + type: "array" 261 309 } 262 310 } 263 311 } as const; 264 312 265 313 export const DictionaryWithStringSchema = { 266 - description: 'This is a string dictionary', 267 - type: 'object', 314 + description: "This is a string dictionary", 315 + type: "object", 268 316 additionalProperties: { 269 - type: 'string' 317 + type: "string" 270 318 } 271 319 } as const; 272 320 273 321 export const DictionaryWithPropertiesAndAdditionalPropertiesSchema = { 274 - type: 'object', 322 + type: "object", 275 323 properties: { 276 324 foo: { 277 - type: 'number' 325 + type: "number" 278 326 }, 279 327 bar: { 280 - type: 'boolean' 328 + type: "boolean" 281 329 } 282 330 }, 283 331 additionalProperties: { 284 - type: 'string' 332 + type: "string" 285 333 } 286 334 } as const; 287 335 288 336 export const DictionaryWithReferenceSchema = { 289 - description: 'This is a string reference', 290 - type: 'object', 337 + description: "This is a string reference", 338 + type: "object", 291 339 additionalProperties: { 292 - '$ref': '#/components/schemas/ModelWithString' 340 + '$ref': "#/components/schemas/ModelWithString" 293 341 } 294 342 } as const; 295 343 296 344 export const DictionaryWithArraySchema = { 297 - description: 'This is a complex dictionary', 298 - type: 'object', 345 + description: "This is a complex dictionary", 346 + type: "object", 299 347 additionalProperties: { 300 - type: 'array', 348 + type: "array", 301 349 items: { 302 - '$ref': '#/components/schemas/ModelWithString' 350 + '$ref': "#/components/schemas/ModelWithString" 303 351 } 304 352 } 305 353 } as const; 306 354 307 355 export const DictionaryWithDictionarySchema = { 308 - description: 'This is a string dictionary', 309 - type: 'object', 356 + description: "This is a string dictionary", 357 + type: "object", 310 358 additionalProperties: { 311 - type: 'object', 359 + type: "object", 312 360 additionalProperties: { 313 - type: 'string' 361 + type: "string" 314 362 } 315 363 } 316 364 } as const; 317 365 318 366 export const DictionaryWithPropertiesSchema = { 319 - description: 'This is a complex dictionary', 320 - type: 'object', 367 + description: "This is a complex dictionary", 368 + type: "object", 321 369 additionalProperties: { 322 - type: 'object', 370 + type: "object", 323 371 properties: { 324 372 foo: { 325 - type: 'string' 373 + type: "string" 326 374 }, 327 375 bar: { 328 - type: 'string' 376 + type: "string" 329 377 } 330 378 } 331 379 } 332 380 } as const; 333 381 334 382 export const ModelWithIntegerSchema = { 335 - description: 'This is a model with one number property', 336 - type: 'object', 383 + description: "This is a model with one number property", 384 + type: "object", 337 385 properties: { 338 386 prop: { 339 - description: 'This is a simple number property', 340 - type: 'integer' 387 + description: "This is a simple number property", 388 + type: "integer" 341 389 } 342 390 } 343 391 } as const; 344 392 345 393 export const ModelWithBooleanSchema = { 346 - description: 'This is a model with one boolean property', 347 - type: 'object', 394 + description: "This is a model with one boolean property", 395 + type: "object", 348 396 properties: { 349 397 prop: { 350 - description: 'This is a simple boolean property', 351 - type: 'boolean' 398 + description: "This is a simple boolean property", 399 + type: "boolean" 352 400 } 353 401 } 354 402 } as const; 355 403 356 404 export const ModelWithStringSchema = { 357 - description: 'This is a model with one string property', 358 - type: 'object', 405 + description: "This is a model with one string property", 406 + type: "object", 359 407 properties: { 360 408 prop: { 361 - description: 'This is a simple string property', 362 - type: 'string' 409 + description: "This is a simple string property", 410 + type: "string" 363 411 } 364 412 } 365 413 } as const; 366 414 367 415 export const ModelWithStringErrorSchema = { 368 - description: 'This is a model with one string property', 369 - type: 'object', 416 + description: "This is a model with one string property", 417 + type: "object", 370 418 properties: { 371 419 prop: { 372 - description: 'This is a simple string property', 373 - type: 'string' 420 + description: "This is a simple string property", 421 + type: "string" 374 422 } 375 423 } 376 424 } as const; 377 425 378 426 export const Model_From_ZendeskSchema = { 379 - description: `\`Comment\` or \`VoiceComment\`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets)`, 380 - type: 'string' 427 + description: "`Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets)", 428 + type: "string" 381 429 } as const; 382 430 383 431 export const ModelWithNullableStringSchema = { 384 - description: 'This is a model with one string property', 385 - type: 'object', 386 - required: ['nullableRequiredProp1', 'nullableRequiredProp2'], 432 + description: "This is a model with one string property", 433 + type: "object", 434 + required: [ 435 + "nullableRequiredProp1", 436 + "nullableRequiredProp2" 437 + ], 387 438 properties: { 388 439 nullableProp1: { 389 - description: 'This is a simple string property', 390 - type: ['string', 'null'] 440 + description: "This is a simple string property", 441 + type: [ 442 + "string", 443 + "null" 444 + ] 391 445 }, 392 446 nullableRequiredProp1: { 393 - description: 'This is a simple string property', 394 - type: ['string', 'null'] 447 + description: "This is a simple string property", 448 + type: [ 449 + "string", 450 + "null" 451 + ] 395 452 }, 396 453 nullableProp2: { 397 - description: 'This is a simple string property', 398 - type: ['string', 'null'] 454 + description: "This is a simple string property", 455 + type: [ 456 + "string", 457 + "null" 458 + ] 399 459 }, 400 460 nullableRequiredProp2: { 401 - description: 'This is a simple string property', 402 - type: ['string', 'null'] 461 + description: "This is a simple string property", 462 + type: [ 463 + "string", 464 + "null" 465 + ] 403 466 }, 404 467 'foo_bar-enum': { 405 - description: 'This is a simple enum with strings', 406 - enum: ['Success', 'Warning', 'Error', 'ØÆÅ字符串'] 468 + description: "This is a simple enum with strings", 469 + enum: [ 470 + "Success", 471 + "Warning", 472 + "Error", 473 + "ØÆÅ字符串" 474 + ] 407 475 } 408 476 } 409 477 } as const; 410 478 411 479 export const ModelWithEnumSchema = { 412 - description: 'This is a model with one enum', 413 - type: 'object', 480 + description: "This is a model with one enum", 481 + type: "object", 414 482 properties: { 415 483 'foo_bar-enum': { 416 - description: 'This is a simple enum with strings', 417 - enum: ['Success', 'Warning', 'Error', 'ØÆÅ字符串'] 484 + description: "This is a simple enum with strings", 485 + enum: [ 486 + "Success", 487 + "Warning", 488 + "Error", 489 + "ØÆÅ字符串" 490 + ] 418 491 }, 419 492 statusCode: { 420 - description: 'These are the HTTP error code enums', 421 - enum: ['100', '200 FOO', '300 FOO_BAR', '400 foo-bar', '500 foo.bar', '600 foo&bar'] 493 + description: "These are the HTTP error code enums", 494 + enum: [ 495 + "100", 496 + "200 FOO", 497 + "300 FOO_BAR", 498 + "400 foo-bar", 499 + "500 foo.bar", 500 + "600 foo&bar" 501 + ] 422 502 }, 423 503 bool: { 424 - description: 'Simple boolean enum', 425 - type: 'boolean', 426 - enum: [true] 504 + description: "Simple boolean enum", 505 + type: "boolean", 506 + enum: [ 507 + true 508 + ] 427 509 } 428 510 } 429 511 } as const; 430 512 431 513 export const ModelWithEnumWithHyphenSchema = { 432 - description: 'This is a model with one enum with escaped name', 433 - type: 'object', 514 + description: "This is a model with one enum with escaped name", 515 + type: "object", 434 516 properties: { 435 517 'foo-bar-baz-qux': { 436 - type: 'string', 437 - enum: ['3.0'], 438 - title: 'Foo-Bar-Baz-Qux', 439 - default: '3.0' 518 + type: "string", 519 + enum: [ 520 + "3.0" 521 + ], 522 + title: "Foo-Bar-Baz-Qux", 523 + default: "3.0" 440 524 } 441 525 } 442 526 } as const; 443 527 444 528 export const ModelWithEnumFromDescriptionSchema = { 445 - description: 'This is a model with one enum', 446 - type: 'object', 529 + description: "This is a model with one enum", 530 + type: "object", 447 531 properties: { 448 532 test: { 449 - type: 'integer', 450 - description: 'Success=1,Warning=2,Error=3' 533 + type: "integer", 534 + description: "Success=1,Warning=2,Error=3" 451 535 } 452 536 } 453 537 } as const; 454 538 455 539 export const ModelWithNestedEnumsSchema = { 456 - description: 'This is a model with nested enums', 457 - type: 'object', 540 + description: "This is a model with nested enums", 541 + type: "object", 458 542 properties: { 459 543 dictionaryWithEnum: { 460 - type: 'object', 544 + type: "object", 461 545 additionalProperties: { 462 - enum: ['Success', 'Warning', 'Error'] 546 + enum: [ 547 + "Success", 548 + "Warning", 549 + "Error" 550 + ] 463 551 } 464 552 }, 465 553 dictionaryWithEnumFromDescription: { 466 - type: 'object', 554 + type: "object", 467 555 additionalProperties: { 468 - type: 'integer', 469 - description: 'Success=1,Warning=2,Error=3' 556 + type: "integer", 557 + description: "Success=1,Warning=2,Error=3" 470 558 } 471 559 }, 472 560 arrayWithEnum: { 473 - type: 'array', 561 + type: "array", 474 562 items: { 475 - enum: ['Success', 'Warning', 'Error'] 563 + enum: [ 564 + "Success", 565 + "Warning", 566 + "Error" 567 + ] 476 568 } 477 569 }, 478 570 arrayWithDescription: { 479 - type: 'array', 571 + type: "array", 480 572 items: { 481 - type: 'integer', 482 - description: 'Success=1,Warning=2,Error=3' 573 + type: "integer", 574 + description: "Success=1,Warning=2,Error=3" 483 575 } 484 576 }, 485 577 'foo_bar-enum': { 486 - description: 'This is a simple enum with strings', 487 - enum: ['Success', 'Warning', 'Error', 'ØÆÅ字符串'] 578 + description: "This is a simple enum with strings", 579 + enum: [ 580 + "Success", 581 + "Warning", 582 + "Error", 583 + "ØÆÅ字符串" 584 + ] 488 585 } 489 586 } 490 587 } as const; 491 588 492 589 export const ModelWithReferenceSchema = { 493 - description: 'This is a model with one property containing a reference', 494 - type: 'object', 590 + description: "This is a model with one property containing a reference", 591 + type: "object", 495 592 properties: { 496 593 prop: { 497 - '$ref': '#/components/schemas/ModelWithProperties' 594 + '$ref': "#/components/schemas/ModelWithProperties" 498 595 } 499 596 } 500 597 } as const; 501 598 502 599 export const ModelWithArrayReadOnlyAndWriteOnlySchema = { 503 - description: 'This is a model with one property containing an array', 504 - type: 'object', 600 + description: "This is a model with one property containing an array", 601 + type: "object", 505 602 properties: { 506 603 prop: { 507 - type: 'array', 604 + type: "array", 508 605 items: { 509 - '$ref': '#/components/schemas/ModelWithReadOnlyAndWriteOnly' 606 + '$ref': "#/components/schemas/ModelWithReadOnlyAndWriteOnly" 510 607 } 511 608 }, 512 609 propWithFile: { 513 - type: 'array', 610 + type: "array", 514 611 items: { 515 - format: 'binary', 516 - type: 'string' 612 + format: "binary", 613 + type: "string" 517 614 } 518 615 }, 519 616 propWithNumber: { 520 - type: 'array', 617 + type: "array", 521 618 items: { 522 - type: 'number' 619 + type: "number" 523 620 } 524 621 } 525 622 } 526 623 } as const; 527 624 528 625 export const ModelWithArraySchema = { 529 - description: 'This is a model with one property containing an array', 530 - type: 'object', 626 + description: "This is a model with one property containing an array", 627 + type: "object", 531 628 properties: { 532 629 prop: { 533 - type: 'array', 630 + type: "array", 534 631 items: { 535 - '$ref': '#/components/schemas/ModelWithString' 632 + '$ref': "#/components/schemas/ModelWithString" 536 633 } 537 634 }, 538 635 propWithFile: { 539 - type: 'array', 636 + type: "array", 540 637 items: { 541 - format: 'binary', 542 - type: 'string' 638 + format: "binary", 639 + type: "string" 543 640 } 544 641 }, 545 642 propWithNumber: { 546 - type: 'array', 643 + type: "array", 547 644 items: { 548 - type: 'number' 645 + type: "number" 549 646 } 550 647 } 551 648 } 552 649 } as const; 553 650 554 651 export const ModelWithDictionarySchema = { 555 - description: 'This is a model with one property containing a dictionary', 556 - type: 'object', 652 + description: "This is a model with one property containing a dictionary", 653 + type: "object", 557 654 properties: { 558 655 prop: { 559 - type: 'object', 656 + type: "object", 560 657 additionalProperties: { 561 - type: 'string' 658 + type: "string" 562 659 } 563 660 } 564 661 } ··· 566 663 567 664 export const DeprecatedModelSchema = { 568 665 deprecated: true, 569 - description: 'This is a deprecated model with a deprecated property', 570 - type: 'object', 666 + description: "This is a deprecated model with a deprecated property", 667 + type: "object", 571 668 properties: { 572 669 prop: { 573 670 deprecated: true, 574 - description: 'This is a deprecated property', 575 - type: 'string' 671 + description: "This is a deprecated property", 672 + type: "string" 576 673 } 577 674 } 578 675 } as const; 579 676 580 677 export const ModelWithCircularReferenceSchema = { 581 - description: 'This is a model with one property containing a circular reference', 582 - type: 'object', 678 + description: "This is a model with one property containing a circular reference", 679 + type: "object", 583 680 properties: { 584 681 prop: { 585 - '$ref': '#/components/schemas/ModelWithCircularReference' 682 + '$ref': "#/components/schemas/ModelWithCircularReference" 586 683 } 587 684 } 588 685 } as const; 589 686 590 687 export const CompositionWithOneOfSchema = { 591 688 description: "This is a model with one property with a 'one of' relationship", 592 - type: 'object', 689 + type: "object", 593 690 properties: { 594 691 propA: { 595 - type: 'object', 692 + type: "object", 596 693 oneOf: [ 597 694 { 598 - '$ref': '#/components/schemas/ModelWithString' 695 + '$ref': "#/components/schemas/ModelWithString" 599 696 }, 600 697 { 601 - '$ref': '#/components/schemas/ModelWithEnum' 698 + '$ref': "#/components/schemas/ModelWithEnum" 602 699 }, 603 700 { 604 - '$ref': '#/components/schemas/ModelWithArray' 701 + '$ref': "#/components/schemas/ModelWithArray" 605 702 }, 606 703 { 607 - '$ref': '#/components/schemas/ModelWithDictionary' 704 + '$ref': "#/components/schemas/ModelWithDictionary" 608 705 } 609 706 ] 610 707 } ··· 613 710 614 711 export const CompositionWithOneOfAnonymousSchema = { 615 712 description: "This is a model with one property with a 'one of' relationship where the options are not $ref", 616 - type: 'object', 713 + type: "object", 617 714 properties: { 618 715 propA: { 619 - type: 'object', 716 + type: "object", 620 717 oneOf: [ 621 718 { 622 - description: 'Anonymous object type', 623 - type: 'object', 719 + description: "Anonymous object type", 720 + type: "object", 624 721 properties: { 625 722 propA: { 626 - type: 'string' 723 + type: "string" 627 724 } 628 725 } 629 726 }, 630 727 { 631 - description: 'Anonymous string type', 632 - type: 'string' 728 + description: "Anonymous string type", 729 + type: "string" 633 730 }, 634 731 { 635 - description: 'Anonymous integer type', 636 - type: 'integer' 732 + description: "Anonymous integer type", 733 + type: "integer" 637 734 } 638 735 ] 639 736 } ··· 641 738 } as const; 642 739 643 740 export const ModelCircleSchema = { 644 - description: 'Circle', 645 - type: 'object', 646 - required: ['kind'], 741 + description: "Circle", 742 + type: "object", 743 + required: [ 744 + "kind" 745 + ], 647 746 properties: { 648 747 kind: { 649 - type: 'string' 748 + type: "string" 650 749 }, 651 750 radius: { 652 - type: 'number' 751 + type: "number" 653 752 } 654 753 } 655 754 } as const; 656 755 657 756 export const ModelSquareSchema = { 658 - description: 'Square', 659 - type: 'object', 660 - required: ['kind'], 757 + description: "Square", 758 + type: "object", 759 + required: [ 760 + "kind" 761 + ], 661 762 properties: { 662 763 kind: { 663 - type: 'string' 764 + type: "string" 664 765 }, 665 766 sideLength: { 666 - type: 'number' 767 + type: "number" 667 768 } 668 769 } 669 770 } as const; 670 771 671 772 export const CompositionWithOneOfDiscriminatorSchema = { 672 773 description: "This is a model with one property with a 'one of' relationship where the options are not $ref", 673 - type: 'object', 774 + type: "object", 674 775 oneOf: [ 675 776 { 676 - '$ref': '#/components/schemas/ModelCircle' 777 + '$ref': "#/components/schemas/ModelCircle" 677 778 }, 678 779 { 679 - '$ref': '#/components/schemas/ModelSquare' 780 + '$ref': "#/components/schemas/ModelSquare" 680 781 } 681 782 ], 682 783 discriminator: { 683 - propertyName: 'kind', 784 + propertyName: "kind", 684 785 mapping: { 685 - circle: '#/components/schemas/ModelCircle', 686 - square: '#/components/schemas/ModelSquare' 786 + circle: "#/components/schemas/ModelCircle", 787 + square: "#/components/schemas/ModelSquare" 687 788 } 688 789 } 689 790 } as const; 690 791 691 792 export const CompositionWithAnyOfSchema = { 692 793 description: "This is a model with one property with a 'any of' relationship", 693 - type: 'object', 794 + type: "object", 694 795 properties: { 695 796 propA: { 696 - type: 'object', 797 + type: "object", 697 798 anyOf: [ 698 799 { 699 - '$ref': '#/components/schemas/ModelWithString' 800 + '$ref': "#/components/schemas/ModelWithString" 700 801 }, 701 802 { 702 - '$ref': '#/components/schemas/ModelWithEnum' 803 + '$ref': "#/components/schemas/ModelWithEnum" 703 804 }, 704 805 { 705 - '$ref': '#/components/schemas/ModelWithArray' 806 + '$ref': "#/components/schemas/ModelWithArray" 706 807 }, 707 808 { 708 - '$ref': '#/components/schemas/ModelWithDictionary' 809 + '$ref': "#/components/schemas/ModelWithDictionary" 709 810 } 710 811 ] 711 812 } ··· 714 815 715 816 export const CompositionWithAnyOfAnonymousSchema = { 716 817 description: "This is a model with one property with a 'any of' relationship where the options are not $ref", 717 - type: 'object', 818 + type: "object", 718 819 properties: { 719 820 propA: { 720 - type: 'object', 821 + type: "object", 721 822 anyOf: [ 722 823 { 723 - description: 'Anonymous object type', 724 - type: 'object', 824 + description: "Anonymous object type", 825 + type: "object", 725 826 properties: { 726 827 propA: { 727 - type: 'string' 828 + type: "string" 728 829 } 729 830 } 730 831 }, 731 832 { 732 - description: 'Anonymous string type', 733 - type: 'string' 833 + description: "Anonymous string type", 834 + type: "string" 734 835 }, 735 836 { 736 - description: 'Anonymous integer type', 737 - type: 'integer' 837 + description: "Anonymous integer type", 838 + type: "integer" 738 839 } 739 840 ] 740 841 } ··· 743 844 744 845 export const CompositionWithNestedAnyAndTypeNullSchema = { 745 846 description: "This is a model with nested 'any of' property with a type null", 746 - type: 'object', 847 + type: "object", 747 848 properties: { 748 849 propA: { 749 - type: 'object', 850 + type: "object", 750 851 anyOf: [ 751 852 { 752 853 items: { 753 854 anyOf: [ 754 855 { 755 - '$ref': '#/components/schemas/ModelWithDictionary' 856 + '$ref': "#/components/schemas/ModelWithDictionary" 756 857 }, 757 858 { 758 - type: 'null' 859 + type: "null" 759 860 } 760 861 ] 761 862 }, 762 - type: 'array' 863 + type: "array" 763 864 }, 764 865 { 765 866 items: { 766 867 anyOf: [ 767 868 { 768 - '$ref': '#/components/schemas/ModelWithArray' 869 + '$ref': "#/components/schemas/ModelWithArray" 769 870 }, 770 871 { 771 - type: 'null' 872 + type: "null" 772 873 } 773 874 ] 774 875 }, 775 - type: 'array' 876 + type: "array" 776 877 } 777 878 ] 778 879 } ··· 780 881 } as const; 781 882 782 883 export const _3e_num_1ПериодSchema = { 783 - enum: ['Bird', 'Dog'], 784 - type: 'string' 884 + enum: [ 885 + "Bird", 886 + "Dog" 887 + ], 888 + type: "string" 785 889 } as const; 786 890 787 891 export const ConstValueSchema = { 788 - type: 'string', 789 - const: 'ConstValue' 892 + type: "string", 893 + const: "ConstValue" 790 894 } as const; 791 895 792 896 export const CompositionWithNestedAnyOfAndNullSchema = { 793 897 description: "This is a model with one property with a 'any of' relationship where the options are not $ref", 794 - type: 'object', 898 + type: "object", 795 899 properties: { 796 900 propA: { 797 901 anyOf: [ ··· 799 903 items: { 800 904 anyOf: [ 801 905 { 802 - '$ref': '#/components/schemas/3e-num_1Период' 906 + '$ref': "#/components/schemas/3e-num_1Период" 803 907 }, 804 908 { 805 - '$ref': '#/components/schemas/ConstValue' 909 + '$ref': "#/components/schemas/ConstValue" 806 910 } 807 911 ] 808 912 }, 809 - type: 'array' 913 + type: "array" 810 914 }, 811 915 { 812 - type: 'null' 916 + type: "null" 813 917 } 814 918 ], 815 - title: 'Scopes' 919 + title: "Scopes" 816 920 } 817 921 } 818 922 } as const; 819 923 820 924 export const CompositionWithOneOfAndNullableSchema = { 821 925 description: "This is a model with one property with a 'one of' relationship", 822 - type: 'object', 926 + type: "object", 823 927 properties: { 824 928 propA: { 825 - type: ['object', 'null'], 929 + type: [ 930 + "object", 931 + "null" 932 + ], 826 933 oneOf: [ 827 934 { 828 - type: 'object', 935 + type: "object", 829 936 properties: { 830 937 boolean: { 831 - type: 'boolean' 938 + type: "boolean" 832 939 } 833 940 } 834 941 }, 835 942 { 836 - '$ref': '#/components/schemas/ModelWithEnum' 943 + '$ref': "#/components/schemas/ModelWithEnum" 837 944 }, 838 945 { 839 - '$ref': '#/components/schemas/ModelWithArray' 946 + '$ref': "#/components/schemas/ModelWithArray" 840 947 }, 841 948 { 842 - '$ref': '#/components/schemas/ModelWithDictionary' 949 + '$ref': "#/components/schemas/ModelWithDictionary" 843 950 } 844 951 ] 845 952 } ··· 847 954 } as const; 848 955 849 956 export const CompositionWithOneOfAndSimpleDictionarySchema = { 850 - description: 'This is a model that contains a simple dictionary within composition', 851 - type: 'object', 957 + description: "This is a model that contains a simple dictionary within composition", 958 + type: "object", 852 959 properties: { 853 960 propA: { 854 961 oneOf: [ 855 962 { 856 - type: 'boolean' 963 + type: "boolean" 857 964 }, 858 965 { 859 - type: 'object', 966 + type: "object", 860 967 additionalProperties: { 861 - type: 'number' 968 + type: "number" 862 969 } 863 970 } 864 971 ] ··· 867 974 } as const; 868 975 869 976 export const CompositionWithOneOfAndSimpleArrayDictionarySchema = { 870 - description: 'This is a model that contains a dictionary of simple arrays within composition', 871 - type: 'object', 977 + description: "This is a model that contains a dictionary of simple arrays within composition", 978 + type: "object", 872 979 properties: { 873 980 propA: { 874 981 oneOf: [ 875 982 { 876 - type: 'boolean' 983 + type: "boolean" 877 984 }, 878 985 { 879 - type: 'object', 986 + type: "object", 880 987 additionalProperties: { 881 - type: 'array', 988 + type: "array", 882 989 items: { 883 - type: 'boolean' 990 + type: "boolean" 884 991 } 885 992 } 886 993 } ··· 890 997 } as const; 891 998 892 999 export const CompositionWithOneOfAndComplexArrayDictionarySchema = { 893 - description: 'This is a model that contains a dictionary of complex arrays (composited) within composition', 894 - type: 'object', 1000 + description: "This is a model that contains a dictionary of complex arrays (composited) within composition", 1001 + type: "object", 895 1002 properties: { 896 1003 propA: { 897 1004 oneOf: [ 898 1005 { 899 - type: 'boolean' 1006 + type: "boolean" 900 1007 }, 901 1008 { 902 - type: 'object', 1009 + type: "object", 903 1010 additionalProperties: { 904 - type: 'array', 1011 + type: "array", 905 1012 items: { 906 1013 oneOf: [ 907 1014 { 908 - type: 'number' 1015 + type: "number" 909 1016 }, 910 1017 { 911 - type: 'string' 1018 + type: "string" 912 1019 } 913 1020 ] 914 1021 } ··· 921 1028 922 1029 export const CompositionWithAllOfAndNullableSchema = { 923 1030 description: "This is a model with one property with a 'all of' relationship", 924 - type: 'object', 1031 + type: "object", 925 1032 properties: { 926 1033 propA: { 927 - type: ['object', 'null'], 1034 + type: [ 1035 + "object", 1036 + "null" 1037 + ], 928 1038 allOf: [ 929 1039 { 930 - type: 'object', 1040 + type: "object", 931 1041 properties: { 932 1042 boolean: { 933 - type: 'boolean' 1043 + type: "boolean" 934 1044 } 935 1045 } 936 1046 }, 937 1047 { 938 - '$ref': '#/components/schemas/ModelWithEnum' 1048 + '$ref': "#/components/schemas/ModelWithEnum" 939 1049 }, 940 1050 { 941 - '$ref': '#/components/schemas/ModelWithArray' 1051 + '$ref': "#/components/schemas/ModelWithArray" 942 1052 }, 943 1053 { 944 - '$ref': '#/components/schemas/ModelWithDictionary' 1054 + '$ref': "#/components/schemas/ModelWithDictionary" 945 1055 } 946 1056 ] 947 1057 } ··· 950 1060 951 1061 export const CompositionWithAnyOfAndNullableSchema = { 952 1062 description: "This is a model with one property with a 'any of' relationship", 953 - type: 'object', 1063 + type: "object", 954 1064 properties: { 955 1065 propA: { 956 - type: ['object', 'null'], 1066 + type: [ 1067 + "object", 1068 + "null" 1069 + ], 957 1070 anyOf: [ 958 1071 { 959 - type: 'object', 1072 + type: "object", 960 1073 properties: { 961 1074 boolean: { 962 - type: 'boolean' 1075 + type: "boolean" 963 1076 } 964 1077 } 965 1078 }, 966 1079 { 967 - '$ref': '#/components/schemas/ModelWithEnum' 1080 + '$ref': "#/components/schemas/ModelWithEnum" 968 1081 }, 969 1082 { 970 - '$ref': '#/components/schemas/ModelWithArray' 1083 + '$ref': "#/components/schemas/ModelWithArray" 971 1084 }, 972 1085 { 973 - '$ref': '#/components/schemas/ModelWithDictionary' 1086 + '$ref': "#/components/schemas/ModelWithDictionary" 974 1087 } 975 1088 ] 976 1089 } ··· 978 1091 } as const; 979 1092 980 1093 export const CompositionBaseModelSchema = { 981 - description: 'This is a base model with two simple optional properties', 982 - type: 'object', 1094 + description: "This is a base model with two simple optional properties", 1095 + type: "object", 983 1096 properties: { 984 1097 firstName: { 985 - type: 'string' 1098 + type: "string" 986 1099 }, 987 1100 lastname: { 988 - type: 'string' 1101 + type: "string" 989 1102 } 990 1103 } 991 1104 } as const; 992 1105 993 1106 export const CompositionExtendedModelSchema = { 994 - description: 'This is a model that extends the base model', 995 - type: 'object', 1107 + description: "This is a model that extends the base model", 1108 + type: "object", 996 1109 allOf: [ 997 1110 { 998 - '$ref': '#/components/schemas/CompositionBaseModel' 1111 + '$ref': "#/components/schemas/CompositionBaseModel" 999 1112 } 1000 1113 ], 1001 1114 properties: { 1002 1115 age: { 1003 - type: 'number' 1116 + type: "number" 1004 1117 } 1005 1118 }, 1006 - required: ['firstName', 'lastname', 'age'] 1119 + required: [ 1120 + "firstName", 1121 + "lastname", 1122 + "age" 1123 + ] 1007 1124 } as const; 1008 1125 1009 1126 export const ModelWithPropertiesSchema = { 1010 - description: 'This is a model with one nested property', 1011 - type: 'object', 1012 - required: ['required', 'requiredAndReadOnly', 'requiredAndNullable'], 1127 + description: "This is a model with one nested property", 1128 + type: "object", 1129 + required: [ 1130 + "required", 1131 + "requiredAndReadOnly", 1132 + "requiredAndNullable" 1133 + ], 1013 1134 properties: { 1014 1135 required: { 1015 - type: 'string' 1136 + type: "string" 1016 1137 }, 1017 1138 requiredAndReadOnly: { 1018 - type: 'string', 1139 + type: "string", 1019 1140 readOnly: true 1020 1141 }, 1021 1142 requiredAndNullable: { 1022 - type: ['string', 'null'] 1143 + type: [ 1144 + "string", 1145 + "null" 1146 + ] 1023 1147 }, 1024 1148 string: { 1025 - type: 'string' 1149 + type: "string" 1026 1150 }, 1027 1151 number: { 1028 - type: 'number' 1152 + type: "number" 1029 1153 }, 1030 1154 boolean: { 1031 - type: 'boolean' 1155 + type: "boolean" 1032 1156 }, 1033 1157 reference: { 1034 - '$ref': '#/components/schemas/ModelWithString' 1158 + '$ref': "#/components/schemas/ModelWithString" 1035 1159 }, 1036 1160 'property with space': { 1037 - type: 'string' 1161 + type: "string" 1038 1162 }, 1039 1163 default: { 1040 - type: 'string' 1164 + type: "string" 1041 1165 }, 1042 1166 try: { 1043 - type: 'string' 1167 + type: "string" 1044 1168 }, 1045 1169 '@namespace.string': { 1046 - type: 'string', 1170 + type: "string", 1047 1171 readOnly: true 1048 1172 }, 1049 1173 '@namespace.integer': { 1050 - type: 'integer', 1174 + type: "integer", 1051 1175 readOnly: true 1052 1176 } 1053 1177 } 1054 1178 } as const; 1055 1179 1056 1180 export const ModelWithNestedPropertiesSchema = { 1057 - description: 'This is a model with one nested property', 1058 - type: 'object', 1059 - required: ['first'], 1181 + description: "This is a model with one nested property", 1182 + type: "object", 1183 + required: [ 1184 + "first" 1185 + ], 1060 1186 properties: { 1061 1187 first: { 1062 - type: ['object', 'null'], 1063 - required: ['second'], 1188 + type: [ 1189 + "object", 1190 + "null" 1191 + ], 1192 + required: [ 1193 + "second" 1194 + ], 1064 1195 readOnly: true, 1065 1196 properties: { 1066 1197 second: { 1067 - type: ['object', 'null'], 1068 - required: ['third'], 1198 + type: [ 1199 + "object", 1200 + "null" 1201 + ], 1202 + required: [ 1203 + "third" 1204 + ], 1069 1205 readOnly: true, 1070 1206 properties: { 1071 1207 third: { 1072 - type: ['string', 'null'], 1208 + type: [ 1209 + "string", 1210 + "null" 1211 + ], 1073 1212 required: true, 1074 1213 readOnly: true 1075 1214 } ··· 1081 1220 } as const; 1082 1221 1083 1222 export const ModelWithDuplicatePropertiesSchema = { 1084 - description: 'This is a model with duplicated properties', 1085 - type: 'object', 1223 + description: "This is a model with duplicated properties", 1224 + type: "object", 1086 1225 properties: { 1087 1226 prop: { 1088 - '$ref': '#/components/schemas/ModelWithString' 1227 + '$ref': "#/components/schemas/ModelWithString" 1089 1228 } 1090 1229 } 1091 1230 } as const; 1092 1231 1093 1232 export const ModelWithOrderedPropertiesSchema = { 1094 - description: 'This is a model with ordered properties', 1095 - type: 'object', 1233 + description: "This is a model with ordered properties", 1234 + type: "object", 1096 1235 properties: { 1097 1236 zebra: { 1098 - type: 'string' 1237 + type: "string" 1099 1238 }, 1100 1239 apple: { 1101 - type: 'string' 1240 + type: "string" 1102 1241 }, 1103 1242 hawaii: { 1104 - type: 'string' 1243 + type: "string" 1105 1244 } 1106 1245 } 1107 1246 } as const; 1108 1247 1109 1248 export const ModelWithDuplicateImportsSchema = { 1110 - description: 'This is a model with duplicated imports', 1111 - type: 'object', 1249 + description: "This is a model with duplicated imports", 1250 + type: "object", 1112 1251 properties: { 1113 1252 propA: { 1114 - '$ref': '#/components/schemas/ModelWithString' 1253 + '$ref': "#/components/schemas/ModelWithString" 1115 1254 }, 1116 1255 propB: { 1117 - '$ref': '#/components/schemas/ModelWithString' 1256 + '$ref': "#/components/schemas/ModelWithString" 1118 1257 }, 1119 1258 propC: { 1120 - '$ref': '#/components/schemas/ModelWithString' 1259 + '$ref': "#/components/schemas/ModelWithString" 1121 1260 } 1122 1261 } 1123 1262 } as const; 1124 1263 1125 1264 export const ModelThatExtendsSchema = { 1126 - description: 'This is a model that extends another model', 1127 - type: 'object', 1265 + description: "This is a model that extends another model", 1266 + type: "object", 1128 1267 allOf: [ 1129 1268 { 1130 - '$ref': '#/components/schemas/ModelWithString' 1269 + '$ref': "#/components/schemas/ModelWithString" 1131 1270 }, 1132 1271 { 1133 - type: 'object', 1272 + type: "object", 1134 1273 properties: { 1135 1274 propExtendsA: { 1136 - type: 'string' 1275 + type: "string" 1137 1276 }, 1138 1277 propExtendsB: { 1139 - '$ref': '#/components/schemas/ModelWithString' 1278 + '$ref': "#/components/schemas/ModelWithString" 1140 1279 } 1141 1280 } 1142 1281 } ··· 1144 1283 } as const; 1145 1284 1146 1285 export const ModelThatExtendsExtendsSchema = { 1147 - description: 'This is a model that extends another model', 1148 - type: 'object', 1286 + description: "This is a model that extends another model", 1287 + type: "object", 1149 1288 allOf: [ 1150 1289 { 1151 - '$ref': '#/components/schemas/ModelWithString' 1290 + '$ref': "#/components/schemas/ModelWithString" 1152 1291 }, 1153 1292 { 1154 - '$ref': '#/components/schemas/ModelThatExtends' 1293 + '$ref': "#/components/schemas/ModelThatExtends" 1155 1294 }, 1156 1295 { 1157 - type: 'object', 1296 + type: "object", 1158 1297 properties: { 1159 1298 propExtendsC: { 1160 - type: 'string' 1299 + type: "string" 1161 1300 }, 1162 1301 propExtendsD: { 1163 - '$ref': '#/components/schemas/ModelWithString' 1302 + '$ref': "#/components/schemas/ModelWithString" 1164 1303 } 1165 1304 } 1166 1305 } ··· 1168 1307 } as const; 1169 1308 1170 1309 export const ModelWithPatternSchema = { 1171 - description: 'This is a model that contains a some patterns', 1172 - type: 'object', 1173 - required: ['key', 'name'], 1310 + description: "This is a model that contains a some patterns", 1311 + type: "object", 1312 + required: [ 1313 + "key", 1314 + "name" 1315 + ], 1174 1316 properties: { 1175 1317 key: { 1176 1318 maxLength: 64, 1177 - pattern: '^[a-zA-Z0-9_]*$', 1178 - type: 'string' 1319 + pattern: "^[a-zA-Z0-9_]*$", 1320 + type: "string" 1179 1321 }, 1180 1322 name: { 1181 1323 maxLength: 255, 1182 - type: 'string' 1324 + type: "string" 1183 1325 }, 1184 1326 enabled: { 1185 - type: 'boolean', 1327 + type: "boolean", 1186 1328 readOnly: true 1187 1329 }, 1188 1330 modified: { 1189 - type: 'string', 1190 - format: 'date-time', 1331 + type: "string", 1332 + format: "date-time", 1191 1333 readOnly: true 1192 1334 }, 1193 1335 id: { 1194 - type: 'string', 1195 - pattern: '^\\d{2}-\\d{3}-\\d{4}$' 1336 + type: "string", 1337 + pattern: "^\\d{2}-\\d{3}-\\d{4}$" 1196 1338 }, 1197 1339 text: { 1198 - type: 'string', 1199 - pattern: '^\\w+$' 1340 + type: "string", 1341 + pattern: "^\\w+$" 1200 1342 }, 1201 1343 patternWithSingleQuotes: { 1202 - type: 'string', 1344 + type: "string", 1203 1345 pattern: "^[a-zA-Z0-9']*$" 1204 1346 }, 1205 1347 patternWithNewline: { 1206 - type: 'string', 1207 - pattern: 'aaa\\nbbb' 1348 + type: "string", 1349 + pattern: "aaa\\nbbb" 1208 1350 }, 1209 1351 patternWithBacktick: { 1210 - type: 'string', 1211 - pattern: 'aaa`bbb' 1352 + type: "string", 1353 + pattern: "aaa`bbb" 1212 1354 } 1213 1355 } 1214 1356 } as const; 1215 1357 1216 1358 export const FileSchema = { 1217 - required: ['mime'], 1218 - type: 'object', 1359 + required: [ 1360 + "mime" 1361 + ], 1362 + type: "object", 1219 1363 properties: { 1220 1364 id: { 1221 - title: 'Id', 1222 - type: 'string', 1365 + title: "Id", 1366 + type: "string", 1223 1367 readOnly: true, 1224 1368 minLength: 1 1225 1369 }, 1226 1370 updated_at: { 1227 - title: 'Updated at', 1228 - type: 'string', 1229 - format: 'date-time', 1371 + title: "Updated at", 1372 + type: "string", 1373 + format: "date-time", 1230 1374 readOnly: true 1231 1375 }, 1232 1376 created_at: { 1233 - title: 'Created at', 1234 - type: 'string', 1235 - format: 'date-time', 1377 + title: "Created at", 1378 + type: "string", 1379 + format: "date-time", 1236 1380 readOnly: true 1237 1381 }, 1238 1382 mime: { 1239 - title: 'Mime', 1240 - type: 'string', 1383 + title: "Mime", 1384 + type: "string", 1241 1385 maxLength: 24, 1242 1386 minLength: 1 1243 1387 }, 1244 1388 file: { 1245 - title: 'File', 1246 - type: 'string', 1389 + title: "File", 1390 + type: "string", 1247 1391 readOnly: true, 1248 - format: 'uri' 1392 + format: "uri" 1249 1393 } 1250 1394 } 1251 1395 } as const; 1252 1396 1253 1397 export const defaultSchema = { 1254 - type: 'object', 1398 + type: "object", 1255 1399 properties: { 1256 1400 name: { 1257 - type: 'string' 1401 + type: "string" 1258 1402 } 1259 1403 } 1260 1404 } as const; 1261 1405 1262 1406 export const PageableSchema = { 1263 - type: 'object', 1407 + type: "object", 1264 1408 properties: { 1265 1409 page: { 1266 1410 minimum: 0, 1267 - type: 'integer', 1268 - format: 'int32', 1411 + type: "integer", 1412 + format: "int32", 1269 1413 default: 0 1270 1414 }, 1271 1415 size: { 1272 1416 minimum: 1, 1273 - type: 'integer', 1274 - format: 'int32' 1417 + type: "integer", 1418 + format: "int32" 1275 1419 }, 1276 1420 sort: { 1277 - type: 'array', 1421 + type: "array", 1278 1422 items: { 1279 - type: 'string' 1423 + type: "string" 1280 1424 } 1281 1425 } 1282 1426 } 1283 1427 } as const; 1284 1428 1285 1429 export const FreeFormObjectWithoutAdditionalPropertiesSchema = { 1286 - description: 'This is a free-form object without additionalProperties.', 1287 - type: 'object' 1430 + description: "This is a free-form object without additionalProperties.", 1431 + type: "object" 1288 1432 } as const; 1289 1433 1290 1434 export const FreeFormObjectWithAdditionalPropertiesEqTrueSchema = { 1291 - description: 'This is a free-form object with additionalProperties: true.', 1292 - type: 'object', 1435 + description: "This is a free-form object with additionalProperties: true.", 1436 + type: "object", 1293 1437 additionalProperties: true 1294 1438 } as const; 1295 1439 1296 1440 export const FreeFormObjectWithAdditionalPropertiesEqEmptyObjectSchema = { 1297 - description: 'This is a free-form object with additionalProperties: {}.', 1298 - type: 'object', 1441 + description: "This is a free-form object with additionalProperties: {}.", 1442 + type: "object", 1299 1443 additionalProperties: {} 1300 1444 } as const; 1301 1445 1302 1446 export const ModelWithConstSchema = { 1303 - type: 'object', 1447 + type: "object", 1304 1448 properties: { 1305 1449 String: { 1306 - const: 'String' 1450 + const: "String" 1307 1451 }, 1308 1452 number: { 1309 1453 const: 0 ··· 1312 1456 const: null 1313 1457 }, 1314 1458 withType: { 1315 - type: 'string', 1316 - const: 'Some string' 1459 + type: "string", 1460 + const: "Some string" 1317 1461 } 1318 1462 } 1319 1463 } as const; 1320 1464 1321 1465 export const ModelWithAdditionalPropertiesEqTrueSchema = { 1322 - description: 'This is a model with one property and additionalProperties: true', 1323 - type: 'object', 1466 + description: "This is a model with one property and additionalProperties: true", 1467 + type: "object", 1324 1468 properties: { 1325 1469 prop: { 1326 - description: 'This is a simple string property', 1327 - type: 'string' 1470 + description: "This is a simple string property", 1471 + type: "string" 1328 1472 } 1329 1473 }, 1330 1474 additionalProperties: true ··· 1338 1482 items: { 1339 1483 anyOf: [ 1340 1484 { 1341 - type: 'string' 1485 + type: "string" 1342 1486 }, 1343 1487 { 1344 - type: 'boolean' 1488 + type: "boolean" 1345 1489 } 1346 1490 ] 1347 1491 }, 1348 - type: 'array' 1492 + type: "array" 1349 1493 }, 1350 1494 { 1351 - type: 'null' 1495 + type: "null" 1352 1496 } 1353 1497 ] 1354 1498 } 1355 1499 }, 1356 - type: 'object' 1500 + type: "object" 1357 1501 } as const; 1358 1502 1359 1503 export const CompositionWithOneOfAndPropertiesSchema = { 1360 - type: 'object', 1504 + type: "object", 1361 1505 oneOf: [ 1362 1506 { 1363 - type: 'object', 1364 - required: ['foo'], 1507 + type: "object", 1508 + required: [ 1509 + "foo" 1510 + ], 1365 1511 properties: { 1366 1512 foo: { 1367 - '$ref': '#/components/parameters/SimpleParameter' 1513 + '$ref': "#/components/parameters/SimpleParameter" 1368 1514 } 1369 1515 }, 1370 1516 additionalProperties: false 1371 1517 }, 1372 1518 { 1373 - type: 'object', 1374 - required: ['bar'], 1519 + type: "object", 1520 + required: [ 1521 + "bar" 1522 + ], 1375 1523 properties: { 1376 1524 bar: { 1377 - '$ref': '#/components/schemas/NonAsciiStringæøåÆØÅöôêÊ字符串' 1525 + '$ref': "#/components/schemas/NonAsciiStringæøåÆØÅöôêÊ字符串" 1378 1526 } 1379 1527 }, 1380 1528 additionalProperties: false 1381 1529 } 1382 1530 ], 1383 - required: ['baz', 'qux'], 1531 + required: [ 1532 + "baz", 1533 + "qux" 1534 + ], 1384 1535 properties: { 1385 1536 baz: { 1386 - type: ['integer', 'null'], 1387 - format: 'uint16', 1537 + type: [ 1538 + "integer", 1539 + "null" 1540 + ], 1541 + format: "uint16", 1388 1542 minimum: 0 1389 1543 }, 1390 1544 qux: { 1391 - type: 'integer', 1392 - format: 'uint8', 1545 + type: "integer", 1546 + format: "uint8", 1393 1547 minimum: 0 1394 1548 } 1395 1549 } 1396 1550 } as const; 1397 1551 1398 1552 export const NullableObjectSchema = { 1399 - type: ['object', 'null'], 1400 - description: 'An object that can be null', 1553 + type: [ 1554 + "object", 1555 + "null" 1556 + ], 1557 + description: "An object that can be null", 1401 1558 properties: { 1402 1559 foo: { 1403 - type: 'string' 1560 + type: "string" 1404 1561 } 1405 1562 }, 1406 1563 default: null 1407 1564 } as const; 1408 1565 1409 1566 export const CharactersInDescriptionSchema = { 1410 - type: 'string', 1411 - description: 'Some % character' 1567 + type: "string", 1568 + description: "Some % character" 1412 1569 } as const; 1413 1570 1414 1571 export const ModelWithNullableObjectSchema = { 1415 - type: 'object', 1572 + type: "object", 1416 1573 properties: { 1417 1574 data: { 1418 - '$ref': '#/components/schemas/NullableObject' 1575 + '$ref': "#/components/schemas/NullableObject" 1419 1576 } 1420 1577 } 1421 1578 } as const; ··· 1423 1580 export const ModelWithOneOfEnumSchema = { 1424 1581 oneOf: [ 1425 1582 { 1426 - type: 'object', 1427 - required: ['foo'], 1583 + type: "object", 1584 + required: [ 1585 + "foo" 1586 + ], 1428 1587 properties: { 1429 1588 foo: { 1430 - type: 'string', 1431 - enum: ['Bar'] 1589 + type: "string", 1590 + enum: [ 1591 + "Bar" 1592 + ] 1432 1593 } 1433 1594 } 1434 1595 }, 1435 1596 { 1436 - type: 'object', 1437 - required: ['foo'], 1597 + type: "object", 1598 + required: [ 1599 + "foo" 1600 + ], 1438 1601 properties: { 1439 1602 foo: { 1440 - type: 'string', 1441 - enum: ['Baz'] 1603 + type: "string", 1604 + enum: [ 1605 + "Baz" 1606 + ] 1442 1607 } 1443 1608 } 1444 1609 }, 1445 1610 { 1446 - type: 'object', 1447 - required: ['foo'], 1611 + type: "object", 1612 + required: [ 1613 + "foo" 1614 + ], 1448 1615 properties: { 1449 1616 foo: { 1450 - type: 'string', 1451 - enum: ['Qux'] 1617 + type: "string", 1618 + enum: [ 1619 + "Qux" 1620 + ] 1452 1621 } 1453 1622 } 1454 1623 }, 1455 1624 { 1456 - type: 'object', 1457 - required: ['content', 'foo'], 1625 + type: "object", 1626 + required: [ 1627 + "content", 1628 + "foo" 1629 + ], 1458 1630 properties: { 1459 1631 content: { 1460 - type: 'string', 1461 - format: 'date-time' 1632 + type: "string", 1633 + format: "date-time" 1462 1634 }, 1463 1635 foo: { 1464 - type: 'string', 1465 - enum: ['Quux'] 1636 + type: "string", 1637 + enum: [ 1638 + "Quux" 1639 + ] 1466 1640 } 1467 1641 } 1468 1642 }, 1469 1643 { 1470 - type: 'object', 1471 - required: ['content', 'foo'], 1644 + type: "object", 1645 + required: [ 1646 + "content", 1647 + "foo" 1648 + ], 1472 1649 properties: { 1473 1650 content: { 1474 - type: 'array', 1651 + type: "array", 1475 1652 prefixItems: [ 1476 1653 { 1477 - type: 'string', 1478 - format: 'date-time' 1654 + type: "string", 1655 + format: "date-time" 1479 1656 }, 1480 1657 { 1481 - type: 'string' 1658 + type: "string" 1482 1659 } 1483 1660 ], 1484 1661 maxItems: 2, 1485 1662 minItems: 2 1486 1663 }, 1487 1664 foo: { 1488 - type: 'string', 1489 - enum: ['Corge'] 1665 + type: "string", 1666 + enum: [ 1667 + "Corge" 1668 + ] 1490 1669 } 1491 1670 } 1492 1671 } ··· 1494 1673 } as const; 1495 1674 1496 1675 export const ModelWithNestedArrayEnumsDataFooSchema = { 1497 - enum: ['foo', 'bar'], 1498 - type: 'string' 1676 + enum: [ 1677 + "foo", 1678 + "bar" 1679 + ], 1680 + type: "string" 1499 1681 } as const; 1500 1682 1501 1683 export const ModelWithNestedArrayEnumsDataBarSchema = { 1502 - enum: ['baz', 'qux'], 1503 - type: 'string' 1684 + enum: [ 1685 + "baz", 1686 + "qux" 1687 + ], 1688 + type: "string" 1504 1689 } as const; 1505 1690 1506 1691 export const ModelWithNestedArrayEnumsDataSchema = { 1507 - type: 'object', 1692 + type: "object", 1508 1693 properties: { 1509 1694 foo: { 1510 - type: 'array', 1695 + type: "array", 1511 1696 items: { 1512 - '$ref': '#/components/schemas/ModelWithNestedArrayEnumsDataFoo' 1697 + '$ref': "#/components/schemas/ModelWithNestedArrayEnumsDataFoo" 1513 1698 } 1514 1699 }, 1515 1700 bar: { 1516 - type: 'array', 1701 + type: "array", 1517 1702 items: { 1518 - '$ref': '#/components/schemas/ModelWithNestedArrayEnumsDataBar' 1703 + '$ref': "#/components/schemas/ModelWithNestedArrayEnumsDataBar" 1519 1704 } 1520 1705 } 1521 1706 } 1522 1707 } as const; 1523 1708 1524 1709 export const ModelWithNestedArrayEnumsSchema = { 1525 - type: 'object', 1710 + type: "object", 1526 1711 properties: { 1527 1712 array_strings: { 1528 - type: 'array', 1713 + type: "array", 1529 1714 items: { 1530 - type: 'string' 1715 + type: "string" 1531 1716 } 1532 1717 }, 1533 1718 data: { 1534 1719 allOf: [ 1535 1720 { 1536 - '$ref': '#/components/schemas/ModelWithNestedArrayEnumsData' 1721 + '$ref': "#/components/schemas/ModelWithNestedArrayEnumsData" 1537 1722 } 1538 1723 ] 1539 1724 } ··· 1541 1726 } as const; 1542 1727 1543 1728 export const ModelWithNestedCompositionEnumsSchema = { 1544 - type: 'object', 1729 + type: "object", 1545 1730 properties: { 1546 1731 foo: { 1547 1732 allOf: [ 1548 1733 { 1549 - '$ref': '#/components/schemas/ModelWithNestedArrayEnumsDataFoo' 1734 + '$ref': "#/components/schemas/ModelWithNestedArrayEnumsDataFoo" 1550 1735 } 1551 1736 ] 1552 1737 } ··· 1554 1739 } as const; 1555 1740 1556 1741 export const ModelWithReadOnlyAndWriteOnlySchema = { 1557 - type: 'object', 1558 - required: ['foo', 'bar'], 1742 + type: "object", 1743 + required: [ 1744 + "foo", 1745 + "bar" 1746 + ], 1559 1747 properties: { 1560 1748 foo: { 1561 - type: 'string' 1749 + type: "string" 1562 1750 }, 1563 1751 bar: { 1564 1752 readOnly: true, 1565 - type: 'string' 1753 + type: "string" 1566 1754 } 1567 1755 } 1568 1756 } as const; 1569 1757 1570 1758 export const ModelWithConstantSizeArraySchema = { 1571 - type: 'array', 1759 + type: "array", 1572 1760 items: { 1573 - type: 'number' 1761 + type: "number" 1574 1762 }, 1575 1763 minItems: 2, 1576 1764 maxItems: 2 1577 1765 } as const; 1578 1766 1579 1767 export const ModelWithAnyOfConstantSizeArraySchema = { 1580 - type: 'array', 1768 + type: "array", 1581 1769 items: { 1582 1770 oneOf: [ 1583 1771 { 1584 - type: 'number' 1772 + type: "number" 1585 1773 }, 1586 1774 { 1587 - type: 'string' 1775 + type: "string" 1588 1776 } 1589 1777 ] 1590 1778 }, ··· 1593 1781 } as const; 1594 1782 1595 1783 export const ModelWithPrefixItemsConstantSizeArraySchema = { 1596 - type: 'array', 1784 + type: "array", 1597 1785 prefixItems: [ 1598 1786 { 1599 - '$ref': '#/components/schemas/ModelWithInteger' 1787 + '$ref': "#/components/schemas/ModelWithInteger" 1600 1788 }, 1601 1789 { 1602 1790 oneOf: [ 1603 1791 { 1604 - type: 'number' 1792 + type: "number" 1605 1793 }, 1606 1794 { 1607 - type: 'string' 1795 + type: "string" 1608 1796 } 1609 1797 ] 1610 1798 }, 1611 1799 { 1612 - type: 'string' 1800 + type: "string" 1613 1801 } 1614 1802 ] 1615 1803 } as const; 1616 1804 1617 1805 export const ModelWithAnyOfConstantSizeArrayNullableSchema = { 1618 - type: ['array'], 1806 + type: [ 1807 + "array" 1808 + ], 1619 1809 items: { 1620 1810 oneOf: [ 1621 1811 { 1622 - type: ['number', 'null'] 1812 + type: [ 1813 + "number", 1814 + "null" 1815 + ] 1623 1816 }, 1624 1817 { 1625 - type: 'string' 1818 + type: "string" 1626 1819 } 1627 1820 ] 1628 1821 }, ··· 1631 1824 } as const; 1632 1825 1633 1826 export const ModelWithAnyOfConstantSizeArrayWithNSizeAndOptionsSchema = { 1634 - type: 'array', 1827 + type: "array", 1635 1828 items: { 1636 1829 oneOf: [ 1637 1830 { 1638 - type: 'number' 1831 + type: "number" 1639 1832 }, 1640 1833 { 1641 - '$ref': '#/components/schemas/import' 1834 + '$ref': "#/components/schemas/import" 1642 1835 } 1643 1836 ] 1644 1837 }, ··· 1647 1840 } as const; 1648 1841 1649 1842 export const ModelWithAnyOfConstantSizeArrayAndIntersectSchema = { 1650 - type: 'array', 1843 + type: "array", 1651 1844 items: { 1652 1845 allOf: [ 1653 1846 { 1654 - type: 'number' 1847 + type: "number" 1655 1848 }, 1656 1849 { 1657 - type: 'string' 1850 + type: "string" 1658 1851 } 1659 1852 ] 1660 1853 }, ··· 1663 1856 } as const; 1664 1857 1665 1858 export const ModelWithNumericEnumUnionSchema = { 1666 - type: 'object', 1859 + type: "object", 1667 1860 properties: { 1668 1861 value: { 1669 - type: 'number', 1670 - description: 'Период', 1671 - enum: [-10, -1, 0, 1, 3, 6, 12] 1862 + type: "number", 1863 + description: "Период", 1864 + enum: [ 1865 + -10, 1866 + -1, 1867 + 0, 1868 + 1, 1869 + 3, 1870 + 6, 1871 + 12 1872 + ] 1672 1873 } 1673 1874 } 1674 1875 } as const; 1675 1876 1676 1877 export const ModelWithBackticksInDescriptionSchema = { 1677 - description: 'Some description with `back ticks`', 1678 - type: 'object', 1878 + description: "Some description with `back ticks`", 1879 + type: "object", 1679 1880 properties: { 1680 1881 template: { 1681 - type: 'string', 1682 - description: `The template \`that\` should be used for parsing and importing the contents of the CSV file. 1683 - 1684 - <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> 1685 - <pre> 1686 - [ 1687 - { 1688 - "resourceType": "Asset", 1689 - "identifier": { 1690 - "name": "\${1}", 1691 - "domain": { 1692 - "name": "\${2}", 1693 - "community": { 1694 - "name": "Some Community" 1695 - } 1696 - } 1697 - }, 1698 - "attributes" : { 1699 - "00000000-0000-0000-0000-000000003115" : [ { 1700 - "value" : "\${3}" 1701 - } ], 1702 - "00000000-0000-0000-0000-000000000222" : [ { 1703 - "value" : "\${4}" 1704 - } ] 1705 - } 1706 - } 1707 - ] 1708 - </pre>` 1882 + type: "string", 1883 + description: "The template `that` should be used for parsing and importing the contents of the CSV file.\n\n<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>\n<pre>\n[\n {\n \"resourceType\": \"Asset\",\n \"identifier\": {\n \"name\": \"${1}\",\n \"domain\": {\n \"name\": \"${2}\",\n \"community\": {\n \"name\": \"Some Community\"\n }\n }\n },\n \"attributes\" : {\n \"00000000-0000-0000-0000-000000003115\" : [ {\n \"value\" : \"${3}\"\n } ],\n \"00000000-0000-0000-0000-000000000222\" : [ {\n \"value\" : \"${4}\"\n } ]\n }\n }\n]\n</pre>" 1709 1884 } 1710 1885 } 1711 1886 } as const; 1712 1887 1713 1888 export const ModelWithOneOfAndPropertiesSchema = { 1714 - type: 'object', 1889 + type: "object", 1715 1890 oneOf: [ 1716 1891 { 1717 - '$ref': '#/components/parameters/SimpleParameter' 1892 + '$ref': "#/components/parameters/SimpleParameter" 1718 1893 }, 1719 1894 { 1720 - '$ref': '#/components/schemas/NonAsciiStringæøåÆØÅöôêÊ字符串' 1895 + '$ref': "#/components/schemas/NonAsciiStringæøåÆØÅöôêÊ字符串" 1721 1896 } 1722 1897 ], 1723 - required: ['baz', 'qux'], 1898 + required: [ 1899 + "baz", 1900 + "qux" 1901 + ], 1724 1902 properties: { 1725 1903 baz: { 1726 - type: ['integer', 'null'], 1727 - format: 'uint16', 1904 + type: [ 1905 + "integer", 1906 + "null" 1907 + ], 1908 + format: "uint16", 1728 1909 minimum: 0 1729 1910 }, 1730 1911 qux: { 1731 - type: 'integer', 1732 - format: 'uint8', 1912 + type: "integer", 1913 + format: "uint8", 1733 1914 minimum: 0 1734 1915 } 1735 1916 } 1736 1917 } as const; 1737 1918 1738 1919 export const ParameterSimpleParameterUnusedSchema = { 1739 - description: 'Model used to test deduplication strategy (unused)', 1740 - type: 'string' 1920 + description: "Model used to test deduplication strategy (unused)", 1921 + type: "string" 1741 1922 } as const; 1742 1923 1743 1924 export const PostServiceWithEmptyTagResponseSchema = { 1744 - description: 'Model used to test deduplication strategy', 1745 - type: 'string' 1925 + description: "Model used to test deduplication strategy", 1926 + type: "string" 1746 1927 } as const; 1747 1928 1748 1929 export const PostServiceWithEmptyTagResponse2Schema = { 1749 - description: 'Model used to test deduplication strategy', 1750 - type: 'string' 1930 + description: "Model used to test deduplication strategy", 1931 + type: "string" 1751 1932 } as const; 1752 1933 1753 1934 export const DeleteFooDataSchema = { 1754 - description: 'Model used to test deduplication strategy', 1755 - type: 'string' 1935 + description: "Model used to test deduplication strategy", 1936 + type: "string" 1756 1937 } as const; 1757 1938 1758 1939 export const DeleteFooData2Schema = { 1759 - description: 'Model used to test deduplication strategy', 1760 - type: 'string' 1940 + description: "Model used to test deduplication strategy", 1941 + type: "string" 1761 1942 } as const; 1762 1943 1763 1944 export const importSchema = { 1764 - description: 'Model with restricted keyword name', 1765 - type: 'string' 1945 + description: "Model with restricted keyword name", 1946 + type: "string" 1766 1947 } as const; 1767 1948 1768 1949 export const SchemaWithFormRestrictedKeysSchema = { 1769 - type: 'object', 1950 + type: "object", 1770 1951 properties: { 1771 1952 description: { 1772 - type: 'string' 1953 + type: "string" 1773 1954 }, 1774 1955 'x-enum-descriptions': { 1775 - type: 'string' 1956 + type: "string" 1776 1957 }, 1777 1958 'x-enum-varnames': { 1778 - type: 'string' 1959 + type: "string" 1779 1960 }, 1780 1961 'x-enumNames': { 1781 - type: 'string' 1962 + type: "string" 1782 1963 }, 1783 1964 title: { 1784 - type: 'string' 1965 + type: "string" 1785 1966 }, 1786 1967 object: { 1787 - type: 'object', 1968 + type: "object", 1788 1969 properties: { 1789 1970 description: { 1790 - type: 'string' 1971 + type: "string" 1791 1972 }, 1792 1973 'x-enum-descriptions': { 1793 - type: 'string' 1974 + type: "string" 1794 1975 }, 1795 1976 'x-enum-varnames': { 1796 - type: 'string' 1977 + type: "string" 1797 1978 }, 1798 1979 'x-enumNames': { 1799 - type: 'string' 1980 + type: "string" 1800 1981 }, 1801 1982 title: { 1802 - type: 'string' 1983 + type: "string" 1803 1984 } 1804 1985 } 1805 1986 }, 1806 1987 array: { 1807 - type: 'array', 1988 + type: "array", 1808 1989 items: { 1809 - type: 'object', 1990 + type: "object", 1810 1991 properties: { 1811 1992 description: { 1812 - type: 'string' 1993 + type: "string" 1813 1994 }, 1814 1995 'x-enum-descriptions': { 1815 - type: 'string' 1996 + type: "string" 1816 1997 }, 1817 1998 'x-enum-varnames': { 1818 - type: 'string' 1999 + type: "string" 1819 2000 }, 1820 2001 'x-enumNames': { 1821 - type: 'string' 2002 + type: "string" 1822 2003 }, 1823 2004 title: { 1824 - type: 'string' 2005 + type: "string" 1825 2006 } 1826 2007 } 1827 2008 } ··· 1830 2011 } as const; 1831 2012 1832 2013 export const io_k8s_apimachinery_pkg_apis_meta_v1_DeleteOptionsSchema = { 1833 - description: 'This schema was giving PascalCase transformations a hard time', 2014 + description: "This schema was giving PascalCase transformations a hard time", 1834 2015 properties: { 1835 2016 preconditions: { 1836 2017 allOf: [ 1837 2018 { 1838 - '$ref': '#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Preconditions' 2019 + '$ref': "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Preconditions" 1839 2020 } 1840 2021 ], 1841 - description: 'Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned.' 2022 + description: "Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned." 1842 2023 } 1843 2024 }, 1844 - type: 'object' 2025 + type: "object" 1845 2026 } as const; 1846 2027 1847 2028 export const io_k8s_apimachinery_pkg_apis_meta_v1_PreconditionsSchema = { 1848 - description: 'This schema was giving PascalCase transformations a hard time', 2029 + description: "This schema was giving PascalCase transformations a hard time", 1849 2030 properties: { 1850 2031 resourceVersion: { 1851 - description: 'Specifies the target ResourceVersion', 1852 - type: 'string' 2032 + description: "Specifies the target ResourceVersion", 2033 + type: "string" 1853 2034 }, 1854 2035 uid: { 1855 - description: 'Specifies the target UID.', 1856 - type: 'string' 2036 + description: "Specifies the target UID.", 2037 + type: "string" 1857 2038 } 1858 2039 }, 1859 - type: 'object' 2040 + type: "object" 1860 2041 } as const; 1861 2042 1862 2043 export const AdditionalPropertiesUnknownIssueSchema = { 1863 - type: 'object', 2044 + type: "object", 1864 2045 additionalProperties: { 1865 2046 anyOf: [ 1866 2047 { 1867 - type: 'string' 2048 + type: "string" 1868 2049 }, 1869 2050 { 1870 - type: 'number' 2051 + type: "number" 1871 2052 } 1872 2053 ] 1873 2054 } 1874 2055 } as const; 1875 2056 1876 2057 export const AdditionalPropertiesUnknownIssue2Schema = { 1877 - type: 'object', 2058 + type: "object", 1878 2059 additionalProperties: { 1879 2060 anyOf: [ 1880 2061 { 1881 - type: 'string' 2062 + type: "string" 1882 2063 }, 1883 2064 { 1884 - type: 'number' 2065 + type: "number" 1885 2066 } 1886 2067 ] 1887 2068 } 1888 2069 } as const; 1889 2070 1890 2071 export const AdditionalPropertiesUnknownIssue3Schema = { 1891 - type: 'object', 2072 + type: "object", 1892 2073 allOf: [ 1893 2074 { 1894 - type: 'string' 2075 + type: "string" 1895 2076 }, 1896 2077 { 1897 - type: 'object', 1898 - required: ['entries'], 2078 + type: "object", 2079 + required: [ 2080 + "entries" 2081 + ], 1899 2082 properties: { 1900 2083 entries: { 1901 - type: 'object', 2084 + type: "object", 1902 2085 additionalProperties: { 1903 - '$ref': '#/components/schemas/AdditionalPropertiesUnknownIssue' 2086 + '$ref': "#/components/schemas/AdditionalPropertiesUnknownIssue" 1904 2087 } 1905 2088 } 1906 2089 } ··· 1909 2092 } as const; 1910 2093 1911 2094 export const AdditionalPropertiesIntegerIssueSchema = { 1912 - type: 'object', 1913 - required: ['value'], 2095 + type: "object", 2096 + required: [ 2097 + "value" 2098 + ], 1914 2099 properties: { 1915 2100 value: { 1916 - type: 'integer' 2101 + type: "integer" 1917 2102 } 1918 2103 }, 1919 2104 additionalProperties: { 1920 - type: 'integer' 2105 + type: "integer" 1921 2106 } 1922 2107 } as const; 1923 2108 ··· 1928 2113 { 1929 2114 oneOf: [ 1930 2115 { 1931 - '$ref': '#/components/schemas/ConstValue' 2116 + '$ref': "#/components/schemas/ConstValue" 1932 2117 }, 1933 2118 { 1934 - '$ref': '#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.Boolean]' 2119 + '$ref': "#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.Boolean]" 1935 2120 } 1936 2121 ] 1937 2122 }, 1938 2123 { 1939 - '$ref': '#/components/schemas/3e-num_1Период' 2124 + '$ref': "#/components/schemas/3e-num_1Период" 1940 2125 } 1941 2126 ] 1942 2127 }, 1943 2128 { 1944 - '$ref': '#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.String]' 2129 + '$ref': "#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.String]" 1945 2130 } 1946 2131 ] 1947 2132 } as const; 1948 2133 1949 2134 export const Generic_Schema_Duplicate_Issue_1_System_Boolean_Schema = { 1950 - type: 'object', 2135 + type: "object", 1951 2136 properties: { 1952 2137 item: { 1953 - type: 'boolean' 2138 + type: "boolean" 1954 2139 }, 1955 2140 error: { 1956 - type: ['string', 'null'] 2141 + type: [ 2142 + "string", 2143 + "null" 2144 + ] 1957 2145 }, 1958 2146 hasError: { 1959 - type: 'boolean', 2147 + type: "boolean", 1960 2148 readOnly: true 1961 2149 }, 1962 2150 data: { 1963 - type: 'object', 2151 + type: "object", 1964 2152 additionalProperties: false 1965 2153 } 1966 2154 }, ··· 1968 2156 } as const; 1969 2157 1970 2158 export const Generic_Schema_Duplicate_Issue_1_System_String_Schema = { 1971 - type: 'object', 2159 + type: "object", 1972 2160 properties: { 1973 2161 item: { 1974 - type: ['string', 'null'] 2162 + type: [ 2163 + "string", 2164 + "null" 2165 + ] 1975 2166 }, 1976 2167 error: { 1977 - type: ['string', 'null'] 2168 + type: [ 2169 + "string", 2170 + "null" 2171 + ] 1978 2172 }, 1979 2173 hasError: { 1980 - type: 'boolean', 2174 + type: "boolean", 1981 2175 readOnly: true 1982 2176 } 1983 2177 }, ··· 1985 2179 } as const; 1986 2180 1987 2181 export const external_shared_ExternalSharedModelSchema = { 1988 - type: 'object', 2182 + type: "object", 1989 2183 properties: { 1990 2184 id: { 1991 - type: 'string' 2185 + type: "string" 1992 2186 }, 1993 2187 name: { 1994 - type: 'string' 2188 + type: "string" 1995 2189 } 1996 2190 }, 1997 - required: ['id'] 2191 + required: [ 2192 + "id" 2193 + ] 1998 2194 } as const; 1999 2195 2000 2196 export const ModelWithReferenceWritableSchema = { 2001 - description: 'This is a model with one property containing a reference', 2002 - type: 'object', 2197 + description: "This is a model with one property containing a reference", 2198 + type: "object", 2003 2199 properties: { 2004 2200 prop: { 2005 - '$ref': '#/components/schemas/ModelWithPropertiesWritable' 2201 + '$ref': "#/components/schemas/ModelWithPropertiesWritable" 2006 2202 } 2007 2203 } 2008 2204 } as const; 2009 2205 2010 2206 export const ModelWithArrayReadOnlyAndWriteOnlyWritableSchema = { 2011 - description: 'This is a model with one property containing an array', 2012 - type: 'object', 2207 + description: "This is a model with one property containing an array", 2208 + type: "object", 2013 2209 properties: { 2014 2210 prop: { 2015 - type: 'array', 2211 + type: "array", 2016 2212 items: { 2017 - '$ref': '#/components/schemas/ModelWithReadOnlyAndWriteOnlyWritable' 2213 + '$ref': "#/components/schemas/ModelWithReadOnlyAndWriteOnlyWritable" 2018 2214 } 2019 2215 }, 2020 2216 propWithFile: { 2021 - type: 'array', 2217 + type: "array", 2022 2218 items: { 2023 - format: 'binary', 2024 - type: 'string' 2219 + format: "binary", 2220 + type: "string" 2025 2221 } 2026 2222 }, 2027 2223 propWithNumber: { 2028 - type: 'array', 2224 + type: "array", 2029 2225 items: { 2030 - type: 'number' 2226 + type: "number" 2031 2227 } 2032 2228 } 2033 2229 } 2034 2230 } as const; 2035 2231 2036 2232 export const ModelWithPropertiesWritableSchema = { 2037 - description: 'This is a model with one nested property', 2038 - type: 'object', 2039 - required: ['required', 'requiredAndNullable'], 2233 + description: "This is a model with one nested property", 2234 + type: "object", 2235 + required: [ 2236 + "required", 2237 + "requiredAndNullable" 2238 + ], 2040 2239 properties: { 2041 2240 required: { 2042 - type: 'string' 2241 + type: "string" 2043 2242 }, 2044 2243 requiredAndNullable: { 2045 - type: ['string', 'null'] 2244 + type: [ 2245 + "string", 2246 + "null" 2247 + ] 2046 2248 }, 2047 2249 string: { 2048 - type: 'string' 2250 + type: "string" 2049 2251 }, 2050 2252 number: { 2051 - type: 'number' 2253 + type: "number" 2052 2254 }, 2053 2255 boolean: { 2054 - type: 'boolean' 2256 + type: "boolean" 2055 2257 }, 2056 2258 reference: { 2057 - '$ref': '#/components/schemas/ModelWithString' 2259 + '$ref': "#/components/schemas/ModelWithString" 2058 2260 }, 2059 2261 'property with space': { 2060 - type: 'string' 2262 + type: "string" 2061 2263 }, 2062 2264 default: { 2063 - type: 'string' 2265 + type: "string" 2064 2266 }, 2065 2267 try: { 2066 - type: 'string' 2268 + type: "string" 2067 2269 } 2068 2270 } 2069 2271 } as const; 2070 2272 2071 2273 export const ModelWithPatternWritableSchema = { 2072 - description: 'This is a model that contains a some patterns', 2073 - type: 'object', 2074 - required: ['key', 'name'], 2274 + description: "This is a model that contains a some patterns", 2275 + type: "object", 2276 + required: [ 2277 + "key", 2278 + "name" 2279 + ], 2075 2280 properties: { 2076 2281 key: { 2077 2282 maxLength: 64, 2078 - pattern: '^[a-zA-Z0-9_]*$', 2079 - type: 'string' 2283 + pattern: "^[a-zA-Z0-9_]*$", 2284 + type: "string" 2080 2285 }, 2081 2286 name: { 2082 2287 maxLength: 255, 2083 - type: 'string' 2288 + type: "string" 2084 2289 }, 2085 2290 id: { 2086 - type: 'string', 2087 - pattern: '^\\d{2}-\\d{3}-\\d{4}$' 2291 + type: "string", 2292 + pattern: "^\\d{2}-\\d{3}-\\d{4}$" 2088 2293 }, 2089 2294 text: { 2090 - type: 'string', 2091 - pattern: '^\\w+$' 2295 + type: "string", 2296 + pattern: "^\\w+$" 2092 2297 }, 2093 2298 patternWithSingleQuotes: { 2094 - type: 'string', 2299 + type: "string", 2095 2300 pattern: "^[a-zA-Z0-9']*$" 2096 2301 }, 2097 2302 patternWithNewline: { 2098 - type: 'string', 2099 - pattern: 'aaa\\nbbb' 2303 + type: "string", 2304 + pattern: "aaa\\nbbb" 2100 2305 }, 2101 2306 patternWithBacktick: { 2102 - type: 'string', 2103 - pattern: 'aaa`bbb' 2307 + type: "string", 2308 + pattern: "aaa`bbb" 2104 2309 } 2105 2310 } 2106 2311 } as const; 2107 2312 2108 2313 export const FileWritableSchema = { 2109 - required: ['mime'], 2110 - type: 'object', 2314 + required: [ 2315 + "mime" 2316 + ], 2317 + type: "object", 2111 2318 properties: { 2112 2319 mime: { 2113 - title: 'Mime', 2114 - type: 'string', 2320 + title: "Mime", 2321 + type: "string", 2115 2322 maxLength: 24, 2116 2323 minLength: 1 2117 2324 } ··· 2119 2326 } as const; 2120 2327 2121 2328 export const ModelWithReadOnlyAndWriteOnlyWritableSchema = { 2122 - type: 'object', 2123 - required: ['foo', 'baz'], 2329 + type: "object", 2330 + required: [ 2331 + "foo", 2332 + "baz" 2333 + ], 2124 2334 properties: { 2125 2335 foo: { 2126 - type: 'string' 2336 + type: "string" 2127 2337 }, 2128 2338 baz: { 2129 - type: 'string', 2339 + type: "string", 2130 2340 writeOnly: true 2131 2341 } 2132 2342 } 2133 2343 } as const; 2134 2344 2135 2345 export const ModelWithAnyOfConstantSizeArrayWithNSizeAndOptionsWritableSchema = { 2136 - type: 'array', 2346 + type: "array", 2137 2347 items: { 2138 2348 oneOf: [ 2139 2349 { 2140 - type: 'number' 2350 + type: "number" 2141 2351 }, 2142 2352 { 2143 - '$ref': '#/components/schemas/import' 2353 + '$ref': "#/components/schemas/import" 2144 2354 } 2145 2355 ] 2146 2356 }, ··· 2149 2359 } as const; 2150 2360 2151 2361 export const AdditionalPropertiesUnknownIssueWritableSchema = { 2152 - type: 'object', 2362 + type: "object", 2153 2363 additionalProperties: { 2154 2364 anyOf: [ 2155 2365 { 2156 - type: 'string' 2366 + type: "string" 2157 2367 }, 2158 2368 { 2159 - type: 'number' 2369 + type: "number" 2160 2370 } 2161 2371 ] 2162 2372 } ··· 2169 2379 { 2170 2380 oneOf: [ 2171 2381 { 2172 - '$ref': '#/components/schemas/ConstValue' 2382 + '$ref': "#/components/schemas/ConstValue" 2173 2383 }, 2174 2384 { 2175 - '$ref': '#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.Boolean]' 2385 + '$ref': "#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.Boolean]" 2176 2386 } 2177 2387 ] 2178 2388 }, 2179 2389 { 2180 - '$ref': '#/components/schemas/3e-num_1Период' 2390 + '$ref': "#/components/schemas/3e-num_1Период" 2181 2391 } 2182 2392 ] 2183 2393 }, 2184 2394 { 2185 - '$ref': '#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.String]' 2395 + '$ref': "#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.String]" 2186 2396 } 2187 2397 ] 2188 2398 } as const; 2189 2399 2190 2400 export const Generic_Schema_Duplicate_Issue_1_System_Boolean_WritableSchema = { 2191 - type: 'object', 2401 + type: "object", 2192 2402 properties: { 2193 2403 item: { 2194 - type: 'boolean' 2404 + type: "boolean" 2195 2405 }, 2196 2406 error: { 2197 - type: ['string', 'null'] 2407 + type: [ 2408 + "string", 2409 + "null" 2410 + ] 2198 2411 }, 2199 2412 data: { 2200 - type: 'object', 2413 + type: "object", 2201 2414 additionalProperties: false 2202 2415 } 2203 2416 }, ··· 2205 2418 } as const; 2206 2419 2207 2420 export const Generic_Schema_Duplicate_Issue_1_System_String_WritableSchema = { 2208 - type: 'object', 2421 + type: "object", 2209 2422 properties: { 2210 2423 item: { 2211 - type: ['string', 'null'] 2424 + type: [ 2425 + "string", 2426 + "null" 2427 + ] 2212 2428 }, 2213 2429 error: { 2214 - type: ['string', 'null'] 2430 + type: [ 2431 + "string", 2432 + "null" 2433 + ] 2215 2434 } 2216 2435 }, 2217 2436 additionalProperties: false
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@hey-api/sdk/default/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@hey-api/sdk/throwOnError/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base', 18 - throwOnError: true 19 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base", throwOnError: true }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@pinia/colada/fetch/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/angular-query-experimental/axios/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseURL: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseURL: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/angular-query-experimental/fetch/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/react-query/axios/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseURL: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseURL: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/react-query/fetch/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/solid-query/axios/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseURL: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseURL: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/solid-query/fetch/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/svelte-query/axios/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseURL: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseURL: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/svelte-query/fetch/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/vue-query/axios/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseURL: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseURL: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/vue-query/fetch/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'http://localhost:3000/base' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:3000/base" }));
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/servers/client.gen.ts
··· 13 13 */ 14 14 export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; 15 15 16 - export const client = createClient(createConfig<ClientOptions2>({ 17 - baseUrl: 'https://foo.com/v1' 18 - })); 16 + export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "https://foo.com/v1" }));
+2 -6
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/transformers-all-of/transformers.gen.ts
··· 3 3 import type { GetFooResponse } from './types.gen'; 4 4 5 5 const fooSchemaResponseTransformer = (data: any) => { 6 - data.foo = data.foo.map((item: any) => { 7 - return barSchemaResponseTransformer(item); 8 - }); 6 + data.foo = data.foo.map((item: any) => barSchemaResponseTransformer(item)); 9 7 return data; 10 8 }; 11 9 12 10 const barSchemaResponseTransformer = (data: any) => { 13 - data.foo = data.foo.map((item: any) => { 14 - return bazSchemaResponseTransformer(item); 15 - }); 11 + data.foo = data.foo.map((item: any) => bazSchemaResponseTransformer(item)); 16 12 return data; 17 13 }; 18 14
+1 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/transformers-any-of-null/transformers.gen.ts
··· 19 19 }; 20 20 21 21 export const getFooResponseTransformer = async (data: any): Promise<GetFooResponse> => { 22 - data = data.map((item: any) => { 23 - return fooSchemaResponseTransformer(item); 24 - }); 22 + data = data.map((item: any) => fooSchemaResponseTransformer(item)); 25 23 return data; 26 24 }; 27 25
+2 -6
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/transformers-recursive/transformers.gen.ts
··· 7 7 data.createdAt = new Date(data.createdAt); 8 8 } 9 9 if (data.children) { 10 - data.children = data.children.map((item: any) => { 11 - return treeNodeSchemaResponseTransformer(item); 12 - }); 10 + data.children = data.children.map((item: any) => treeNodeSchemaResponseTransformer(item)); 13 11 } 14 12 return data; 15 13 }; 16 14 17 15 export const getTreeResponseTransformer = async (data: any): Promise<GetTreeResponse> => { 18 - data = data.map((item: any) => { 19 - return treeNodeSchemaResponseTransformer(item); 20 - }); 16 + data = data.map((item: any) => treeNodeSchemaResponseTransformer(item)); 21 17 return data; 22 18 };
+24 -38
packages/openapi-ts/src/plugins/@hey-api/client-core/client.ts
··· 1 1 import { clientFolderAbsolutePath } from '~/generate/client'; 2 - import { tsc } from '~/tsc'; 2 + import { $ } from '~/ts-dsl'; 3 3 import { parseUrl } from '~/utils/url'; 4 4 5 5 import type { PluginHandler } from './types'; ··· 51 51 }) 52 52 : undefined; 53 53 54 - const defaultValues: Array<unknown> = []; 54 + const defaultVals = $.object(); 55 55 56 56 const resolvedBaseUrl = resolveBaseUrlString({ 57 57 plugin: plugin as any, ··· 59 59 if (resolvedBaseUrl) { 60 60 const url = parseUrl(resolvedBaseUrl); 61 61 if (url.protocol && url.host && !resolvedBaseUrl.includes('{')) { 62 - defaultValues.push({ 63 - key: getClientBaseUrlKey(plugin.context.config), 64 - value: resolvedBaseUrl, 65 - }); 62 + defaultVals.prop( 63 + getClientBaseUrlKey(plugin.context.config), 64 + $.literal(resolvedBaseUrl), 65 + ); 66 66 } else if (resolvedBaseUrl !== '/' && resolvedBaseUrl.startsWith('/')) { 67 67 const baseUrl = resolvedBaseUrl.endsWith('/') 68 68 ? resolvedBaseUrl.slice(0, -1) 69 69 : resolvedBaseUrl; 70 - defaultValues.push({ 71 - key: getClientBaseUrlKey(plugin.context.config), 72 - value: baseUrl, 73 - }); 70 + defaultVals.prop( 71 + getClientBaseUrlKey(plugin.context.config), 72 + $.literal(baseUrl), 73 + ); 74 74 } 75 75 } 76 76 77 77 if ('throwOnError' in plugin.config && plugin.config.throwOnError) { 78 - defaultValues.push({ 79 - key: 'throwOnError', 80 - value: true, 81 - }); 78 + defaultVals.prop('throwOnError', $.literal(true)); 82 79 } 83 80 84 81 const createConfigParameters = [ 85 - tsc.callExpression({ 86 - functionName: symbolCreateConfig.placeholder, 87 - parameters: defaultValues.length 88 - ? [tsc.objectExpression({ obj: defaultValues })] 89 - : undefined, 90 - types: [ 91 - tsc.typeReferenceNode({ typeName: symbolClientOptions.placeholder }), 92 - ], 93 - }), 82 + $(symbolCreateConfig.placeholder) 83 + .call(defaultVals.hasProps() ? defaultVals : undefined) 84 + .generic(symbolClientOptions.placeholder), 94 85 ]; 95 86 96 87 const symbolClient = plugin.registerSymbol({ 88 + exported: true, 97 89 meta: { 98 90 category: 'client', 99 91 }, 100 92 name: 'client', 101 93 }); 102 - const statement = tsc.constVariable({ 103 - exportConst: true, 104 - expression: tsc.callExpression({ 105 - functionName: symbolCreateClient.placeholder, 106 - parameters: symbolCreateClientConfig 107 - ? [ 108 - tsc.callExpression({ 109 - functionName: symbolCreateClientConfig.placeholder, 110 - parameters: createConfigParameters, 111 - }), 112 - ] 113 - : createConfigParameters, 114 - }), 115 - name: symbolClient.placeholder, 116 - }); 94 + const statement = $.const(symbolClient.placeholder) 95 + .export(symbolClient.exported) 96 + .assign( 97 + $(symbolCreateClient.placeholder).$if( 98 + symbolCreateClientConfig, 99 + (c, s) => c.call($(s.placeholder).call(...createConfigParameters)), 100 + (c) => c.call(...createConfigParameters), 101 + ), 102 + ); 117 103 plugin.setSymbolValue(symbolClient, statement); 118 104 };
+34 -50
packages/openapi-ts/src/plugins/@hey-api/client-core/createClientConfig.ts
··· 1 1 import { clientFolderAbsolutePath } from '~/generate/client'; 2 - import { tsc } from '~/tsc'; 2 + import { $ } from '~/ts-dsl'; 3 3 4 4 import type { PluginHandler } from './types'; 5 5 ··· 28 28 name: 'CreateClientConfig', 29 29 }); 30 30 31 - const defaultClientOptionsType = tsc.typeReferenceNode({ 32 - typeName: symbolDefaultClientOptions.placeholder, 33 - }); 34 - const tType = tsc.typeReferenceNode({ typeName: 'T' }); 35 - const typeCreateClientConfig = tsc.typeAliasDeclaration({ 36 - comment: [ 31 + const typeCreateClientConfig = $.type 32 + .alias(symbolCreateClientConfig.placeholder) 33 + .export(symbolCreateClientConfig.exported) 34 + .doc([ 37 35 'The `createClientConfig()` function will be called on client initialization', 38 36 "and the returned object will become the client's initial configuration.", 39 37 '', 40 38 'You may want to initialize your client this way instead of calling', 41 39 "`setConfig()`. This is useful for example if you're using Next.js", 42 40 'to ensure your client always has the correct values.', 43 - ], 44 - exportType: symbolCreateClientConfig.exported, 45 - name: symbolCreateClientConfig.placeholder, 46 - type: tsc.functionTypeNode({ 47 - parameters: [ 48 - tsc.parameterDeclaration({ 49 - name: 'override', 50 - required: false, 51 - type: tsc.typeReferenceNode({ 52 - typeArguments: [ 53 - tsc.typeIntersectionNode({ 54 - types: [defaultClientOptionsType, tType], 55 - }), 56 - ], 57 - typeName: symbolConfig.placeholder, 58 - }), 59 - }), 60 - ], 61 - returnType: tsc.typeReferenceNode({ 62 - typeArguments: [ 63 - tsc.typeIntersectionNode({ 64 - types: [ 65 - tsc.typeReferenceNode({ 66 - typeArguments: [defaultClientOptionsType], 67 - typeName: 'Required', 68 - }), 69 - tType, 70 - ], 71 - }), 72 - ], 73 - typeName: symbolConfig.placeholder, 74 - }), 75 - }), 76 - typeParameters: [ 77 - { 78 - default: tsc.typeReferenceNode({ 79 - typeName: symbolClientOptions.placeholder, 80 - }), 81 - extends: defaultClientOptionsType, 82 - name: 'T', 83 - }, 84 - ], 85 - }); 41 + ]) 42 + .generic('T', (g) => 43 + g 44 + .extends(symbolDefaultClientOptions.placeholder) 45 + .default(symbolClientOptions.placeholder), 46 + ) 47 + .type( 48 + $.type 49 + .func() 50 + .param('override', (p) => 51 + p 52 + .optional() 53 + .type( 54 + $.type(symbolConfig.placeholder).generic( 55 + $.type.and(symbolDefaultClientOptions.placeholder, 'T'), 56 + ), 57 + ), 58 + ) 59 + .returns( 60 + $.type(symbolConfig.placeholder).generic( 61 + $.type.and( 62 + $.type('Required').generic( 63 + symbolDefaultClientOptions.placeholder, 64 + ), 65 + 'T', 66 + ), 67 + ), 68 + ), 69 + ); 86 70 plugin.setSymbolValue(symbolCreateClientConfig, typeCreateClientConfig); 87 71 };
+28 -19
packages/openapi-ts/src/plugins/@hey-api/schemas/plugin.ts
··· 5 5 import type { OpenApiV3_1_XTypes } from '~/openApi/3.1.x'; 6 6 import { ensureValidIdentifier } from '~/openApi/shared/utils/identifier'; 7 7 import type { OpenApi } from '~/openApi/types'; 8 - import { tsc } from '~/tsc'; 8 + import { $ } from '~/ts-dsl'; 9 9 10 10 import type { HeyApiSchemasPlugin } from './types'; 11 11 ··· 383 383 plugin, 384 384 schema, 385 385 }); 386 - const statement = tsc.constVariable({ 387 - assertion: 'const', 388 - exportConst: symbol.exported, 389 - expression: tsc.objectExpression({ obj }), 390 - name: symbol.placeholder, 391 - }); 386 + const statement = $.const(symbol.placeholder) 387 + .export(symbol.exported) 388 + .assign( 389 + $( 390 + $.toExpr(obj, { 391 + layout: 'pretty', 392 + })!, 393 + ).as('const'), 394 + ); 392 395 plugin.setSymbolValue(symbol, statement); 393 396 } 394 397 }; ··· 421 424 plugin, 422 425 schema, 423 426 }); 424 - const statement = tsc.constVariable({ 425 - assertion: 'const', 426 - exportConst: symbol.exported, 427 - expression: tsc.objectExpression({ obj }), 428 - name: symbol.placeholder, 429 - }); 427 + const statement = $.const(symbol.placeholder) 428 + .export(symbol.exported) 429 + .assign( 430 + $( 431 + $.toExpr(obj, { 432 + layout: 'pretty', 433 + })!, 434 + ).as('const'), 435 + ); 430 436 plugin.setSymbolValue(symbol, statement); 431 437 } 432 438 }; ··· 459 465 plugin, 460 466 schema, 461 467 }); 462 - const statement = tsc.constVariable({ 463 - assertion: 'const', 464 - exportConst: symbol.exported, 465 - expression: tsc.objectExpression({ obj }), 466 - name: symbol.placeholder, 467 - }); 468 + const statement = $.const(symbol.placeholder) 469 + .export(symbol.exported) 470 + .assign( 471 + $( 472 + $.toExpr(obj, { 473 + layout: 'pretty', 474 + })!, 475 + ).as('const'), 476 + ); 468 477 plugin.setSymbolValue(symbol, statement); 469 478 } 470 479 };
+10 -37
packages/openapi-ts/src/plugins/@hey-api/transformers/expressions.ts
··· 1 1 import type ts from 'typescript'; 2 2 3 3 import type { IR } from '~/ir/types'; 4 - import { tsc } from '~/tsc'; 4 + import { $ } from '~/ts-dsl'; 5 5 6 6 import type { UserConfig } from './types'; 7 7 ··· 11 11 schema, 12 12 }: { 13 13 config: Omit<UserConfig, 'name'>; 14 - dataExpression?: ts.Expression | string; 14 + dataExpression?: 15 + | ts.Expression 16 + | ReturnType<typeof $.expr | typeof $.attr> 17 + | string; 15 18 schema: IR.SchemaObject; 16 - }) => Array<ts.Expression> | undefined; 19 + }) => Array<NonNullable<ReturnType<typeof $.toExpr>>> | undefined; 17 20 18 21 export const bigIntExpressions: ExpressionTransformer = ({ 19 22 dataExpression, ··· 25 28 26 29 const bigIntCallExpression = 27 30 dataExpression !== undefined 28 - ? tsc.callExpression({ 29 - functionName: 'BigInt', 30 - parameters: [ 31 - tsc.callExpression({ 32 - functionName: tsc.propertyAccessExpression({ 33 - expression: dataExpression, 34 - name: 'toString', 35 - }), 36 - }), 37 - ], 38 - }) 31 + ? $('BigInt').call($.expr(dataExpression).attr('toString').call()) 39 32 : undefined; 40 33 41 34 if (bigIntCallExpression) { ··· 44 37 } 45 38 46 39 if (dataExpression) { 47 - return [ 48 - tsc.assignment({ 49 - left: dataExpression, 50 - right: bigIntCallExpression, 51 - }), 52 - ]; 40 + return [$.expr(dataExpression).assign(bigIntCallExpression)]; 53 41 } 54 42 } 55 43 ··· 67 55 return; 68 56 } 69 57 70 - const identifierDate = tsc.identifier({ text: 'Date' }); 71 - 72 58 if (typeof dataExpression === 'string') { 73 - return [ 74 - tsc.newExpression({ 75 - argumentsArray: [tsc.identifier({ text: dataExpression })], 76 - expression: identifierDate, 77 - }), 78 - ]; 59 + return [$.new('Date').arg(dataExpression)]; 79 60 } 80 61 81 62 if (dataExpression) { 82 - return [ 83 - tsc.assignment({ 84 - left: dataExpression, 85 - right: tsc.newExpression({ 86 - argumentsArray: [dataExpression], 87 - expression: identifierDate, 88 - }), 89 - }), 90 - ]; 63 + return [$.expr(dataExpression).assign($.new('Date').arg(dataExpression))]; 91 64 } 92 65 93 66 return;
+70 -116
packages/openapi-ts/src/plugins/@hey-api/transformers/plugin.ts
··· 4 4 import { createOperationKey, operationResponsesMap } from '~/ir/operation'; 5 5 import type { IR } from '~/ir/types'; 6 6 import { buildName } from '~/openApi/shared/utils/name'; 7 - import { tsc } from '~/tsc'; 7 + import { $ } from '~/ts-dsl'; 8 + import { TsDsl } from '~/ts-dsl'; 8 9 import { refToName } from '~/utils/ref'; 9 10 10 11 import type { HeyApiTransformersPlugin } from './types'; ··· 15 16 // can emit calls to transformers that will be implemented later. 16 17 const buildingSymbols = new Set<number>(); 17 18 19 + type Expr = NonNullable< 20 + ReturnType<typeof $.toExpr | typeof $.return | typeof $.if> 21 + >; 22 + 18 23 const ensureStatements = ( 19 - nodes: Array<ts.Expression | ts.Statement>, 20 - ): Array<ts.Statement> => 21 - nodes.map((node) => 22 - ts.isStatement(node) 23 - ? node 24 - : tsc.expressionToStatement({ expression: node }), 25 - ); 24 + nodes: Array<Expr | ts.Expression | ts.Statement>, 25 + ): Array<ts.Statement | ReturnType<typeof $.return>> => 26 + nodes.map((node) => { 27 + if (node instanceof TsDsl) { 28 + node = node.$render(); 29 + } 30 + return $.toStmt(node); 31 + }); 26 32 27 33 const isNodeReturnStatement = ({ 28 34 node, 29 35 }: { 30 - node: ts.Expression | ts.Statement; 31 - }) => node.kind === ts.SyntaxKind.ReturnStatement; 36 + node: ts.Expression | ts.Statement | Expr; 37 + }) => { 38 + if (node instanceof TsDsl) { 39 + node = node.$render(); 40 + } 41 + return node.kind === ts.SyntaxKind.ReturnStatement; 42 + }; 32 43 33 44 const schemaResponseTransformerNodes = ({ 34 45 plugin, ··· 36 47 }: { 37 48 plugin: HeyApiTransformersPlugin['Instance']; 38 49 schema: IR.SchemaObject; 39 - }): Array<ts.Expression | ts.Statement> => { 40 - const identifierData = tsc.identifier({ text: dataVariableName }); 50 + }): Array<ts.Expression | ts.Statement | Expr> => { 41 51 const nodes = processSchemaType({ 42 - dataExpression: identifierData, 52 + dataExpression: $(dataVariableName), 43 53 plugin, 44 54 schema, 45 55 }); 46 56 // append return statement if one does not already exist 47 - if ( 48 - nodes.length && 49 - !isNodeReturnStatement({ node: nodes[nodes.length - 1]! }) 50 - ) { 51 - nodes.push(tsc.returnStatement({ expression: identifierData })); 57 + if (nodes.length) { 58 + const last = nodes[nodes.length - 1]!; 59 + if (!isNodeReturnStatement({ node: last })) { 60 + nodes.push($.return(dataVariableName)); 61 + } 52 62 } 53 63 return nodes; 54 64 }; ··· 58 68 plugin, 59 69 schema, 60 70 }: { 61 - dataExpression?: ts.Expression | string; 71 + dataExpression?: 72 + | ts.Expression 73 + | string 74 + | ReturnType<typeof $.attr | typeof $.expr>; 62 75 plugin: HeyApiTransformersPlugin['Instance']; 63 76 schema: IR.SchemaObject; 64 - }): Array<ts.Expression | ts.Statement> => { 77 + }): Array<Expr | ts.Expression | ts.Statement> => { 65 78 if (schema.$ref) { 66 79 const query: SymbolMeta = { 67 80 category: 'transform', ··· 106 119 }); 107 120 108 121 if (nodes.length) { 109 - const node = tsc.constVariable({ 110 - expression: tsc.arrowFunction({ 111 - async: false, 112 - multiLine: true, 113 - parameters: [ 114 - { 115 - name: dataVariableName, 116 - // TODO: parser - add types, generate types without transforms 117 - type: tsc.keywordTypeNode({ keyword: 'any' }), 118 - }, 119 - ], 120 - statements: ensureStatements(nodes), 121 - }), 122 - name: symbol.placeholder, 123 - }); 122 + const node = $.const(symbol.placeholder).assign( 123 + // TODO: parser - add types, generate types without transforms 124 + $.func() 125 + .param(dataVariableName, (p) => p.type('any')) 126 + .do(...ensureStatements(nodes)), 127 + ); 124 128 plugin.setSymbolValue(symbol, node); 125 129 } 126 130 } finally { ··· 134 138 const currentValue = plugin.gen.symbols.getValue(symbol.id); 135 139 if (currentValue || buildingSymbols.has(symbol.id)) { 136 140 const ref = plugin.referenceSymbol(query); 137 - const callExpression = tsc.callExpression({ 138 - functionName: ref.placeholder, 139 - parameters: [dataExpression], 140 - }); 141 + const callExpression = $(ref.placeholder).call(dataExpression); 141 142 142 143 if (dataExpression) { 143 144 // In a map callback, the item needs to be returned, not just the transformation result 144 145 if (typeof dataExpression === 'string' && dataExpression === 'item') { 145 - return [ 146 - tsc.returnStatement({ 147 - expression: callExpression, 148 - }), 149 - ]; 146 + return [$.return(callExpression)]; 150 147 } 151 148 152 149 return [ 153 150 typeof dataExpression === 'string' 154 151 ? callExpression 155 - : tsc.assignment({ 156 - left: dataExpression, 157 - right: callExpression, 158 - }), 152 + : $(dataExpression).assign(callExpression), 159 153 ]; 160 154 } 161 155 } ··· 193 187 ); 194 188 195 189 if (!hasReturnStatement) { 196 - mapCallbackStatements.push( 197 - tsc.returnStatement({ 198 - expression: tsc.identifier({ text: 'item' }), 199 - }), 200 - ); 190 + mapCallbackStatements.push($.return('item')); 201 191 } 202 192 203 193 return [ 204 - tsc.assignment({ 205 - left: dataExpression, 206 - right: tsc.callExpression({ 207 - functionName: tsc.propertyAccessExpression({ 208 - expression: dataExpression, 209 - name: 'map', 210 - }), 211 - parameters: [ 212 - tsc.arrowFunction({ 213 - multiLine: true, 214 - parameters: [ 215 - { 216 - name: 'item', 217 - type: 'any', 218 - }, 219 - ], 220 - statements: mapCallbackStatements, 221 - }), 222 - ], 223 - }), 224 - }), 194 + $(dataExpression).assign( 195 + $(dataExpression) 196 + .attr('map') 197 + .call( 198 + $.func() 199 + .param('item', (p) => p.type('any')) 200 + .do(...mapCallbackStatements), 201 + ), 202 + ), 225 203 ]; 226 204 } 227 205 228 206 if (schema.type === 'object') { 229 - let nodes: Array<ts.Expression | ts.Statement> = []; 207 + let nodes: Array<ts.Expression | ts.Statement | Expr> = []; 230 208 const required = schema.required ?? []; 231 209 232 210 for (const name in schema.properties) { 233 211 const property = schema.properties[name]!; 234 - const propertyAccessExpression = tsc.propertyAccessExpression({ 235 - expression: dataExpression || dataVariableName, 236 - name, 237 - }); 212 + const propertyAccessExpression = $( 213 + dataExpression || dataVariableName, 214 + ).attr(name); 238 215 const propertyNodes = processSchemaType({ 239 216 dataExpression: propertyAccessExpression, 240 217 plugin, ··· 256 233 // todo: Probably, it would make more sense to go with if(x !== undefined && x !== null) instead of if(x) 257 234 // this place influences all underlying transformers, while it's not exactly transformer itself 258 235 // Keep in mind that !!0 === false, so it already makes output for Bigint undesirable 259 - tsc.ifStatement({ 260 - expression: propertyAccessExpression, 261 - thenStatement: tsc.block({ 262 - statements: ensureStatements(propertyNodes), 263 - }), 264 - }), 236 + $.if(propertyAccessExpression).do(...ensureStatements(propertyNodes)), 265 237 ); 266 238 } 267 239 } ··· 278 250 }); 279 251 } 280 252 281 - let arrayNodes: Array<ts.Expression | ts.Statement> = []; 253 + let arrayNodes: Array<ts.Expression | ts.Statement | Expr> = []; 282 254 // process 2 items if one of them is null 283 255 if ( 284 256 schema.logicalOperator === 'and' || ··· 297 269 if (dataExpression) { 298 270 arrayNodes = arrayNodes.concat(nodes); 299 271 } else { 300 - const identifierItem = tsc.identifier({ text: 'item' }); 301 272 // processed means the item was transformed 302 273 arrayNodes.push( 303 - tsc.ifStatement({ 304 - expression: identifierItem, 305 - thenStatement: tsc.block({ 306 - statements: ensureStatements(nodes), 307 - }), 308 - }), 309 - tsc.returnStatement({ expression: identifierItem }), 274 + $.if('item').do(...ensureStatements(nodes)), 275 + $.return('item'), 310 276 ); 311 277 } 312 278 } ··· 393 359 name: operation.id, 394 360 }), 395 361 }); 396 - const value = tsc.constVariable({ 397 - exportConst: symbol.exported, 398 - expression: tsc.arrowFunction({ 399 - async: true, 400 - multiLine: true, 401 - parameters: [ 402 - { 403 - name: dataVariableName, 404 - // TODO: parser - add types, generate types without transforms 405 - type: tsc.keywordTypeNode({ keyword: 'any' }), 406 - }, 407 - ], 408 - returnType: tsc.typeReferenceNode({ 409 - typeArguments: [ 410 - tsc.typeReferenceNode({ typeName: symbolResponse.placeholder }), 411 - ], 412 - typeName: 'Promise', 413 - }), 414 - statements: ensureStatements(nodes), 415 - }), 416 - name: symbol.placeholder, 417 - }); 362 + const value = $.const(symbol.placeholder) 363 + .export(symbol.exported) 364 + .assign( 365 + // TODO: parser - add types, generate types without transforms 366 + $.func() 367 + .async() 368 + .param(dataVariableName, (p) => p.type('any')) 369 + .returns($.type('Promise').generic(symbolResponse.placeholder)) 370 + .do(...ensureStatements(nodes)), 371 + ); 418 372 plugin.setSymbolValue(symbol, value); 419 373 }, 420 374 {
+4 -3
packages/openapi-ts/src/ts-dsl/array.ts
··· 1 - /* eslint-disable @typescript-eslint/no-empty-object-type, @typescript-eslint/no-unsafe-declaration-merging */ 1 + /* eslint-disable @typescript-eslint/no-unsafe-declaration-merging */ 2 2 import ts from 'typescript'; 3 3 4 4 import type { MaybeTsDsl } from './base'; 5 5 import { TsDsl } from './base'; 6 6 import { LiteralTsDsl } from './literal'; 7 7 import { mixin } from './mixins/apply'; 8 + import { AsMixin } from './mixins/as'; 8 9 import { LayoutMixin } from './mixins/layout'; 9 10 10 11 export class ArrayTsDsl extends TsDsl<ts.ArrayLiteralExpression> { ··· 63 64 } 64 65 } 65 66 66 - export interface ArrayTsDsl extends LayoutMixin {} 67 - mixin(ArrayTsDsl, LayoutMixin); 67 + export interface ArrayTsDsl extends AsMixin, LayoutMixin {} 68 + mixin(ArrayTsDsl, AsMixin, LayoutMixin);
+5 -4
packages/openapi-ts/src/ts-dsl/as.ts
··· 1 - /* eslint-disable @typescript-eslint/no-empty-object-type, @typescript-eslint/no-unsafe-declaration-merging */ 1 + /* eslint-disable @typescript-eslint/no-unsafe-declaration-merging */ 2 2 import ts from 'typescript'; 3 3 4 4 import type { MaybeTsDsl, TypeTsDsl } from './base'; 5 5 import { TsDsl } from './base'; 6 6 import { mixin } from './mixins/apply'; 7 - import { ExprMixin, registerLazyAccessAsFactory } from './mixins/expr'; 7 + import { AsMixin, registerLazyAccessAsFactory } from './mixins/as'; 8 + import { ExprMixin } from './mixins/expr'; 8 9 9 10 export class AsTsDsl extends TsDsl<ts.AsExpression> { 10 11 private expr: string | MaybeTsDsl<ts.Expression>; ··· 27 28 } 28 29 } 29 30 30 - export interface AsTsDsl extends ExprMixin {} 31 - mixin(AsTsDsl, ExprMixin); 31 + export interface AsTsDsl extends AsMixin, ExprMixin {} 32 + mixin(AsTsDsl, AsMixin, ExprMixin); 32 33 33 34 registerLazyAccessAsFactory((...args) => new AsTsDsl(...args));
+29 -9
packages/openapi-ts/src/ts-dsl/attr.ts
··· 1 1 /* eslint-disable @typescript-eslint/no-unsafe-declaration-merging */ 2 2 import ts from 'typescript'; 3 3 4 + import { validTypescriptIdentifierRegExp } from '~/utils/regexp'; 5 + 4 6 import type { MaybeTsDsl } from './base'; 5 7 import { TsDsl } from './base'; 8 + import { LiteralTsDsl } from './literal'; 6 9 import { mixin } from './mixins/apply'; 10 + import { AsMixin } from './mixins/as'; 7 11 import { AssignmentMixin } from './mixins/assignment'; 8 12 import { ExprMixin, registerLazyAccessAttrFactory } from './mixins/expr'; 9 13 import { OperatorMixin } from './mixins/operator'; ··· 26 30 27 31 $render(): ts.PropertyAccessExpression | ts.ElementAccessExpression { 28 32 const leftNode = this.$node(this.left); 29 - if (typeof this.right === 'number') { 30 - if (this.isOptional) { 33 + validTypescriptIdentifierRegExp.lastIndex = 0; 34 + const questionToken = this.isOptional 35 + ? ts.factory.createToken(ts.SyntaxKind.QuestionDotToken) 36 + : undefined; 37 + if ( 38 + typeof this.right === 'number' || 39 + (typeof this.right === 'string' && 40 + !validTypescriptIdentifierRegExp.test(this.right)) 41 + ) { 42 + if (questionToken) { 31 43 return ts.factory.createElementAccessChain( 32 44 leftNode, 33 - ts.factory.createToken(ts.SyntaxKind.QuestionDotToken), 34 - ts.factory.createNumericLiteral(this.right), 45 + questionToken, 46 + this.$node(new LiteralTsDsl(this.right)), 35 47 ); 36 48 } 37 49 return ts.factory.createElementAccessExpression( 38 50 leftNode, 39 - ts.factory.createNumericLiteral(this.right), 51 + this.$node(new LiteralTsDsl(this.right)), 40 52 ); 41 53 } 42 - if (this.isOptional) { 54 + if (questionToken) { 43 55 return ts.factory.createPropertyAccessChain( 44 56 leftNode, 45 - ts.factory.createToken(ts.SyntaxKind.QuestionDotToken), 57 + questionToken, 46 58 this.$maybeId(this.right), 47 59 ); 48 60 } ··· 54 66 } 55 67 56 68 export interface AttrTsDsl 57 - extends AssignmentMixin, 69 + extends AsMixin, 70 + AssignmentMixin, 58 71 ExprMixin, 59 72 OperatorMixin, 60 73 OptionalMixin {} 61 - mixin(AttrTsDsl, AssignmentMixin, ExprMixin, OperatorMixin, OptionalMixin); 74 + mixin( 75 + AttrTsDsl, 76 + AsMixin, 77 + AssignmentMixin, 78 + ExprMixin, 79 + OperatorMixin, 80 + OptionalMixin, 81 + ); 62 82 63 83 registerLazyAccessAttrFactory((...args) => new AttrTsDsl(...args));
+3 -3
packages/openapi-ts/src/ts-dsl/base.ts
··· 1 1 import ts from 'typescript'; 2 2 3 + import { toStmt } from './toStmt'; 4 + 3 5 export type MaybeArray<T> = T | ReadonlyArray<T>; 4 6 5 7 export interface ITsDsl<T extends ts.Node = ts.Node> { ··· 116 118 return arr.map((item) => { 117 119 const node = 118 120 typeof item === 'string' ? this.$id(item) : this._render(item); 119 - return ts.isExpression(node) 120 - ? ts.factory.createExpressionStatement(node) 121 - : node; 121 + return toStmt(node); 122 122 }); 123 123 } 124 124
+4 -3
packages/openapi-ts/src/ts-dsl/binary.ts
··· 1 - /* eslint-disable @typescript-eslint/no-empty-object-type, @typescript-eslint/no-unsafe-declaration-merging */ 1 + /* eslint-disable @typescript-eslint/no-unsafe-declaration-merging */ 2 2 import ts from 'typescript'; 3 3 4 4 import type { MaybeTsDsl } from './base'; 5 5 import { TsDsl } from './base'; 6 6 import { mixin } from './mixins/apply'; 7 + import { AsMixin } from './mixins/as'; 7 8 import { ExprMixin } from './mixins/expr'; 8 9 9 10 type Operator = ··· 83 84 } 84 85 } 85 86 86 - export interface BinaryTsDsl extends ExprMixin {} 87 - mixin(BinaryTsDsl, ExprMixin); 87 + export interface BinaryTsDsl extends AsMixin, ExprMixin {} 88 + mixin(BinaryTsDsl, AsMixin, ExprMixin);
+7 -2
packages/openapi-ts/src/ts-dsl/call.ts
··· 5 5 import { TsDsl } from './base'; 6 6 import { mixin } from './mixins/apply'; 7 7 import { ArgsMixin } from './mixins/args'; 8 + import { AsMixin } from './mixins/as'; 8 9 import { ExprMixin, registerLazyAccessCallFactory } from './mixins/expr'; 9 10 import { TypeArgsMixin } from './mixins/type-args'; 10 11 ··· 31 32 } 32 33 } 33 34 34 - export interface CallTsDsl extends ArgsMixin, ExprMixin, TypeArgsMixin {} 35 - mixin(CallTsDsl, ArgsMixin, ExprMixin, TypeArgsMixin); 35 + export interface CallTsDsl 36 + extends ArgsMixin, 37 + AsMixin, 38 + ExprMixin, 39 + TypeArgsMixin {} 40 + mixin(CallTsDsl, ArgsMixin, AsMixin, ExprMixin, TypeArgsMixin); 36 41 37 42 registerLazyAccessCallFactory((expr, args) => new CallTsDsl(expr, ...args));
+1 -1
packages/openapi-ts/src/ts-dsl/class.ts
··· 102 102 AbstractMixin, 103 103 DecoratorMixin, 104 104 DefaultMixin, 105 - [DocMixin, { overrideRender: true }], 105 + DocMixin, 106 106 ExportMixin, 107 107 TypeParamsMixin, 108 108 );
+16 -2
packages/openapi-ts/src/ts-dsl/expr.ts
··· 4 4 import type { MaybeTsDsl } from './base'; 5 5 import { TsDsl } from './base'; 6 6 import { mixin } from './mixins/apply'; 7 + import { AsMixin } from './mixins/as'; 8 + import { AssignmentMixin } from './mixins/assignment'; 7 9 import { ExprMixin } from './mixins/expr'; 8 10 import { OperatorMixin } from './mixins/operator'; 9 11 import { TypeExprMixin } from './mixins/type-expr'; ··· 21 23 } 22 24 } 23 25 24 - export interface ExprTsDsl extends ExprMixin, OperatorMixin, TypeExprMixin {} 25 - mixin(ExprTsDsl, ExprMixin, OperatorMixin, TypeExprMixin); 26 + export interface ExprTsDsl 27 + extends AsMixin, 28 + AssignmentMixin, 29 + ExprMixin, 30 + OperatorMixin, 31 + TypeExprMixin {} 32 + mixin( 33 + ExprTsDsl, 34 + AsMixin, 35 + AssignmentMixin, 36 + ExprMixin, 37 + OperatorMixin, 38 + TypeExprMixin, 39 + );
+1 -1
packages/openapi-ts/src/ts-dsl/field.ts
··· 57 57 mixin( 58 58 FieldTsDsl, 59 59 DecoratorMixin, 60 - [DocMixin, { overrideRender: true }], 60 + DocMixin, 61 61 PrivateMixin, 62 62 ProtectedMixin, 63 63 PublicMixin,
+4 -1
packages/openapi-ts/src/ts-dsl/func.ts
··· 3 3 4 4 import { TsDsl, TypeTsDsl } from './base'; 5 5 import { mixin } from './mixins/apply'; 6 + import { AsMixin } from './mixins/as'; 6 7 import { DecoratorMixin } from './mixins/decorator'; 7 8 import { DoMixin } from './mixins/do'; 8 9 import { DocMixin } from './mixins/doc'; ··· 126 127 127 128 interface ImplFuncTsDsl 128 129 extends AbstractMixin, 130 + AsMixin, 129 131 AsyncMixin, 130 132 DecoratorMixin, 131 133 DoMixin, ··· 140 142 mixin( 141 143 ImplFuncTsDsl, 142 144 AbstractMixin, 145 + AsMixin, 143 146 AsyncMixin, 144 147 DecoratorMixin, 145 148 DoMixin, 146 - [DocMixin, { overrideRender: true }], 149 + DocMixin, 147 150 OptionalMixin, 148 151 ParamMixin, 149 152 PrivateMixin,
+1 -1
packages/openapi-ts/src/ts-dsl/getter.ts
··· 54 54 AbstractMixin, 55 55 DecoratorMixin, 56 56 DoMixin, 57 - [DocMixin, { overrideRender: true }], 57 + DocMixin, 58 58 ParamMixin, 59 59 PrivateMixin, 60 60 ProtectedMixin,
+10 -1
packages/openapi-ts/src/ts-dsl/index.ts
··· 29 29 import { TemplateTsDsl } from './template'; 30 30 import { TernaryTsDsl } from './ternary'; 31 31 import { ThrowTsDsl } from './throw'; 32 + import { toExpr } from './toExpr'; 33 + import { toStmt } from './toStmt'; 32 34 import { TypeAliasTsDsl } from './type/alias'; 33 35 import { TypeAndTsDsl } from './type/and'; 34 36 import { TypeAttrTsDsl } from './type/attr'; 35 37 import { TypeExprTsDsl } from './type/expr'; 38 + import { TypeFuncTsDsl } from './type/func'; 36 39 import { TypeIdxTsDsl } from './type/idx'; 37 40 import { TypeLiteralTsDsl } from './type/literal'; 38 41 import { TypeObjectTsDsl } from './type/object'; ··· 41 44 import { TypeQueryTsDsl } from './type/query'; 42 45 import { TypeTupleTsDsl } from './type/tuple'; 43 46 import { TypeOfExprTsDsl } from './typeof'; 44 - import { toExpr } from './utils'; 45 47 import { VarTsDsl } from './var'; 46 48 47 49 const base = { ··· 199 201 /** Converts a runtime value into a corresponding expression node. */ 200 202 toExpr: (...args: Parameters<typeof toExpr>) => toExpr(...args), 201 203 204 + /** Converts a runtime value into a corresponding statement node. */ 205 + toStmt: (...args: Parameters<typeof toStmt>) => toStmt(...args), 206 + 202 207 /** Creates a basic type reference or type expression (e.g. Foo or Foo<T>). */ 203 208 type: Object.assign( 204 209 (...args: ConstructorParameters<typeof TypeExprTsDsl>) => ··· 219 224 /** Creates a basic type reference or type expression (e.g. Foo or Foo<T>). */ 220 225 expr: (...args: ConstructorParameters<typeof TypeExprTsDsl>) => 221 226 new TypeExprTsDsl(...args), 227 + 228 + /** Creates a function type node (e.g. `(a: string) => number`). */ 229 + func: (...args: ConstructorParameters<typeof TypeFuncTsDsl>) => 230 + new TypeFuncTsDsl(...args), 222 231 223 232 /** Creates an indexed-access type (e.g. `Foo<T>[K]`). */ 224 233 idx: (...args: ConstructorParameters<typeof TypeIdxTsDsl>) =>
+1 -1
packages/openapi-ts/src/ts-dsl/init.ts
··· 44 44 InitTsDsl, 45 45 DecoratorMixin, 46 46 DoMixin, 47 - [DocMixin, { overrideRender: true }], 47 + DocMixin, 48 48 ParamMixin, 49 49 PrivateMixin, 50 50 ProtectedMixin,
+6
packages/openapi-ts/src/ts-dsl/literal.ts
··· 1 + /* eslint-disable @typescript-eslint/no-unsafe-declaration-merging, @typescript-eslint/no-empty-object-type */ 1 2 import ts from 'typescript'; 2 3 3 4 import { TsDsl } from './base'; 5 + import { mixin } from './mixins/apply'; 6 + import { AsMixin } from './mixins/as'; 4 7 import { PrefixTsDsl } from './prefix'; 5 8 6 9 export class LiteralTsDsl extends TsDsl<ts.LiteralTypeNode['literal']> { ··· 28 31 throw new Error(`Unsupported literal: ${String(this.value)}`); 29 32 } 30 33 } 34 + 35 + export interface LiteralTsDsl extends AsMixin {} 36 + mixin(LiteralTsDsl, AsMixin);
+1 -1
packages/openapi-ts/src/ts-dsl/method.ts
··· 71 71 AsyncMixin, 72 72 DecoratorMixin, 73 73 DoMixin, 74 - [DocMixin, { overrideRender: true }], 74 + DocMixin, 75 75 OptionalMixin, 76 76 ParamMixin, 77 77 PrivateMixin,
+5 -9
packages/openapi-ts/src/ts-dsl/mixins/apply.ts
··· 1 1 /* eslint-disable @typescript-eslint/no-unsafe-function-type */ 2 - export function mixin( 3 - target: Function, 4 - ...sources: ReadonlyArray<Function | [Function, { overrideRender?: boolean }]> 5 - ) { 2 + export function mixin(target: Function, ...sources: ReadonlyArray<Function>) { 6 3 const targetProto = target.prototype; 7 4 for (const src of sources) { 8 - const [source, options] = src instanceof Array ? src : [src]; 9 - let resolvedSource = source; 10 - if (typeof source === 'function') { 5 + let resolvedSource = src; 6 + if (typeof src === 'function') { 11 7 try { 12 - const candidate = source(target); 8 + const candidate = src(target); 13 9 if (candidate?.prototype) { 14 10 resolvedSource = candidate; 15 11 } ··· 23 19 Object.getOwnPropertyDescriptors(sourceProto), 24 20 )) { 25 21 if (key === 'constructor') continue; 26 - if (key === '$render' && !options?.overrideRender) continue; 22 + if (key === '$render' && !descriptor.value.mixin) continue; 27 23 Object.defineProperty(targetProto, key, descriptor); 28 24 } 29 25 }
+24
packages/openapi-ts/src/ts-dsl/mixins/as.ts
··· 1 + import type ts from 'typescript'; 2 + 3 + import type { AsTsDsl } from '../as'; 4 + import type { MaybeTsDsl, TypeTsDsl } from '../base'; 5 + 6 + type AsFactory = ( 7 + expr: string | MaybeTsDsl<ts.Expression>, 8 + type: string | TypeTsDsl, 9 + ) => AsTsDsl; 10 + let asFactory: AsFactory | undefined; 11 + /** Registers the As DSL factory after its module has finished evaluating. */ 12 + export function registerLazyAccessAsFactory(factory: AsFactory): void { 13 + asFactory = factory; 14 + } 15 + 16 + export class AsMixin { 17 + /** Creates an `as` type assertion expression (e.g. `value as Type`). */ 18 + as( 19 + this: string | MaybeTsDsl<ts.Expression>, 20 + type: string | TypeTsDsl, 21 + ): AsTsDsl { 22 + return asFactory!(this, type); 23 + } 24 + }
+10 -7
packages/openapi-ts/src/ts-dsl/mixins/doc.ts
··· 4 4 export function DocMixin< 5 5 TBase extends new (...args: ReadonlyArray<any>) => ITsDsl, 6 6 >(Base: TBase) { 7 - const Mixin = class extends Base { 7 + const $renderBase = Base.prototype.$render; 8 + 9 + class Mixin extends Base { 8 10 _doc?: DocTsDsl; 9 11 10 12 doc(lines?: MaybeArray<string>, fn?: (d: DocTsDsl) => void): this { 11 13 this._doc = new DocTsDsl(lines, fn); 12 14 return this; 13 15 } 14 - }; 15 16 16 - const originalFn = Base.prototype.$render; 17 + override $render(...args: Parameters<ITsDsl['$render']>) { 18 + const node = $renderBase.apply(this, args); 19 + return this._doc ? this._doc.apply(node) : node; 20 + } 21 + } 17 22 18 - Mixin.prototype.$render = function (...args: Parameters<ITsDsl['$render']>) { 19 - const node = originalFn.apply(this, args); 20 - return this._doc ? this._doc.apply(node) : node; 21 - }; 23 + // @ts-expect-error 24 + Mixin.prototype.$render.mixin = true; 22 25 23 26 return Mixin; 24 27 }
+1 -25
packages/openapi-ts/src/ts-dsl/mixins/expr.ts
··· 1 1 import type ts from 'typescript'; 2 2 3 - import type { AsTsDsl } from '../as'; 4 3 import type { AttrTsDsl } from '../attr'; 5 4 import type { AwaitTsDsl } from '../await'; 6 - import type { MaybeTsDsl, TypeTsDsl } from '../base'; 5 + import type { MaybeTsDsl } from '../base'; 7 6 import type { CallTsDsl } from '../call'; 8 7 import type { ReturnTsDsl } from '../return'; 9 - 10 - /** 11 - * Lazily register factory callbacks to avoid circular imports and 12 - * ensure predictable mixin application order. 13 - */ 14 - 15 - type AsFactory = ( 16 - expr: string | MaybeTsDsl<ts.Expression>, 17 - type: string | TypeTsDsl, 18 - ) => AsTsDsl; 19 - let asFactory: AsFactory | undefined; 20 - /** Registers the As DSL factory after its module has finished evaluating. */ 21 - export function registerLazyAccessAsFactory(factory: AsFactory): void { 22 - asFactory = factory; 23 - } 24 8 25 9 type AttrFactory = ( 26 10 expr: string | MaybeTsDsl<ts.Expression>, ··· 57 41 } 58 42 59 43 export class ExprMixin { 60 - /** Creates an `as` type assertion expression (e.g. `value as Type`). */ 61 - as( 62 - this: string | MaybeTsDsl<ts.Expression>, 63 - type: string | TypeTsDsl, 64 - ): AsTsDsl { 65 - return asFactory!(this, type); 66 - } 67 - 68 44 /** Accesses a property on the current expression (e.g. `this.foo`). */ 69 45 attr( 70 46 this: string | MaybeTsDsl<ts.Expression>,
+10 -7
packages/openapi-ts/src/ts-dsl/mixins/hint.ts
··· 4 4 export function HintMixin< 5 5 TBase extends new (...args: ReadonlyArray<any>) => ITsDsl, 6 6 >(Base: TBase) { 7 - const Mixin = class extends Base { 7 + const $renderBase = Base.prototype.$render; 8 + 9 + class Mixin extends Base { 8 10 _hint?: HintTsDsl; 9 11 10 12 hint(lines?: MaybeArray<string>, fn?: (h: HintTsDsl) => void): this { 11 13 this._hint = new HintTsDsl(lines, fn); 12 14 return this; 13 15 } 14 - }; 15 16 16 - const originalFn = Base.prototype.$render; 17 + override $render(...args: Parameters<ITsDsl['$render']>) { 18 + const node = $renderBase.apply(this, args); 19 + return this._hint ? this._hint.apply(node) : node; 20 + } 21 + } 17 22 18 - Mixin.prototype.$render = function (...args: Parameters<ITsDsl['$render']>) { 19 - const node = originalFn.apply(this, args); 20 - return this._hint ? this._hint.apply(node) : node; 21 - }; 23 + // @ts-expect-error 24 + Mixin.prototype.$render.mixin = true; 22 25 23 26 return Mixin; 24 27 }
+10 -7
packages/openapi-ts/src/ts-dsl/mixins/note.ts
··· 4 4 export function NoteMixin< 5 5 TBase extends new (...args: ReadonlyArray<any>) => ITsDsl, 6 6 >(Base: TBase) { 7 - const Mixin = class extends Base { 7 + const $renderBase = Base.prototype.$render; 8 + 9 + class Mixin extends Base { 8 10 _note?: NoteTsDsl; 9 11 10 12 note(lines?: MaybeArray<string>, fn?: (h: NoteTsDsl) => void): this { 11 13 this._note = new NoteTsDsl(lines, fn); 12 14 return this; 13 15 } 14 - }; 15 16 16 - const originalFn = Base.prototype.$render; 17 + override $render(...args: Parameters<ITsDsl['$render']>) { 18 + const node = $renderBase.apply(this, args); 19 + return this._note ? this._note.apply(node) : node; 20 + } 21 + } 17 22 18 - Mixin.prototype.$render = function (...args: Parameters<ITsDsl['$render']>) { 19 - const node = originalFn.apply(this, args); 20 - return this._note ? this._note.apply(node) : node; 21 - }; 23 + // @ts-expect-error 24 + Mixin.prototype.$render.mixin = true; 22 25 23 26 return Mixin; 24 27 }
-5
packages/openapi-ts/src/ts-dsl/mixins/type-expr.ts
··· 5 5 import type { TypeQueryTsDsl } from '../type/query'; 6 6 import type { TypeOfExprTsDsl } from '../typeof'; 7 7 8 - /** 9 - * Lazily register factory callbacks to avoid circular imports and 10 - * ensure predictable mixin application order. 11 - */ 12 - 13 8 type TypeExprFactory = ( 14 9 nameOrFn?: string | ((t: TypeExprTsDsl) => void), 15 10 fn?: (t: TypeExprTsDsl) => void,
+7 -7
packages/openapi-ts/src/ts-dsl/object.ts
··· 7 7 import { TsDsl } from './base'; 8 8 import { GetterTsDsl } from './getter'; 9 9 import { mixin } from './mixins/apply'; 10 + import { AsMixin } from './mixins/as'; 10 11 import { ExprMixin } from './mixins/expr'; 11 12 import { HintMixin } from './mixins/hint'; 12 13 import { LayoutMixin } from './mixins/layout'; ··· 143 144 } 144 145 } 145 146 146 - export interface ObjectTsDsl extends ExprMixin, HintMixin, LayoutMixin {} 147 - mixin( 148 - ObjectTsDsl, 149 - ExprMixin, 150 - [HintMixin, { overrideRender: true }], 151 - LayoutMixin, 152 - ); 147 + export interface ObjectTsDsl 148 + extends AsMixin, 149 + ExprMixin, 150 + HintMixin, 151 + LayoutMixin {} 152 + mixin(ObjectTsDsl, AsMixin, ExprMixin, HintMixin, LayoutMixin);
+1 -1
packages/openapi-ts/src/ts-dsl/setter.ts
··· 53 53 AbstractMixin, 54 54 DecoratorMixin, 55 55 DoMixin, 56 - [DocMixin, { overrideRender: true }], 56 + DocMixin, 57 57 ParamMixin, 58 58 PrivateMixin, 59 59 ProtectedMixin,
+4
packages/openapi-ts/src/ts-dsl/toStmt.ts
··· 1 + import ts from 'typescript'; 2 + 3 + export const toStmt = (value: ts.Expression | ts.Statement): ts.Statement => 4 + ts.isExpression(value) ? ts.factory.createExpressionStatement(value) : value;
+33
packages/openapi-ts/src/ts-dsl/type/func.ts
··· 1 + /* eslint-disable @typescript-eslint/no-unsafe-declaration-merging */ 2 + import ts from 'typescript'; 3 + 4 + import { TypeTsDsl } from '../base'; 5 + import { mixin } from '../mixins/apply'; 6 + import { DocMixin } from '../mixins/doc'; 7 + import { ParamMixin } from '../mixins/param'; 8 + import { TypeParamsMixin } from '../mixins/type-params'; 9 + import { TypeExprTsDsl } from './expr'; 10 + 11 + export class TypeFuncTsDsl extends TypeTsDsl<ts.FunctionTypeNode> { 12 + private _returns?: TypeTsDsl; 13 + 14 + /** Sets the return type. */ 15 + returns(type: string | TypeTsDsl): this { 16 + this._returns = type instanceof TypeTsDsl ? type : new TypeExprTsDsl(type); 17 + return this; 18 + } 19 + 20 + $render(): ts.FunctionTypeNode { 21 + if (this._returns === undefined) { 22 + throw new Error('Missing return type in function type DSL'); 23 + } 24 + return ts.factory.createFunctionTypeNode( 25 + this.$generics(), 26 + this.$params(), 27 + this.$type(this._returns), 28 + ); 29 + } 30 + } 31 + 32 + export interface TypeFuncTsDsl extends DocMixin, ParamMixin, TypeParamsMixin {} 33 + mixin(TypeFuncTsDsl, DocMixin, ParamMixin, TypeParamsMixin);
+1 -1
packages/openapi-ts/src/ts-dsl/type/object.ts
··· 63 63 } 64 64 65 65 interface TypePropTsDsl extends DocMixin, OptionalMixin {} 66 - mixin(TypePropTsDsl, [DocMixin, { overrideRender: true }], OptionalMixin); 66 + mixin(TypePropTsDsl, DocMixin, OptionalMixin);
+11 -3
packages/openapi-ts/src/ts-dsl/utils.ts packages/openapi-ts/src/ts-dsl/toExpr.ts
··· 5 5 import { LiteralTsDsl } from './literal'; 6 6 import { ObjectTsDsl } from './object'; 7 7 8 - export const toExpr = (value: unknown): TsDsl<ts.Expression> | undefined => { 8 + export const toExpr = ( 9 + value: unknown, 10 + options?: { 11 + layout?: 'pretty'; 12 + }, 13 + ): TsDsl<ts.Expression> | undefined => { 9 14 if (value instanceof TsDsl) { 10 15 return value; 11 16 } ··· 23 28 } 24 29 25 30 if (value instanceof Array) { 26 - return new ArrayTsDsl(...value.map((v) => toExpr(v) ?? v)); 31 + const arr = new ArrayTsDsl(...value.map((v) => toExpr(v, options) ?? v)); 32 + if (options?.layout === 'pretty') arr.pretty(); 33 + return arr; 27 34 } 28 35 29 36 if (typeof value === 'object') { 30 37 const obj = new ObjectTsDsl(); 31 38 for (const [key, val] of Object.entries(value)) { 32 - const expr = toExpr(val); 39 + const expr = toExpr(val, options); 33 40 if (expr) obj.prop(key, expr); 34 41 } 42 + if (options?.layout === 'pretty') obj.pretty(); 35 43 return obj; 36 44 } 37 45
+2 -2
packages/openapi-ts/src/ts-dsl/var.ts
··· 77 77 mixin( 78 78 VarTsDsl, 79 79 DefaultMixin, 80 - [DocMixin, { overrideRender: true }], 80 + DocMixin, 81 81 ExportMixin, 82 - [HintMixin, { overrideRender: true }], 82 + HintMixin, 83 83 PatternMixin, 84 84 ValueMixin, 85 85 );