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

Configure Feed

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

Merge pull request #2079 from hey-api/fix/validator-comments

fix(validators): generate JSDoc comments for validator schemas

authored by

Lubos and committed by
GitHub
c130b984 e514a138

+3800 -24
+5
.changeset/light-carrots-roll.md
··· 1 + --- 2 + '@hey-api/openapi-ts': patch 3 + --- 4 + 5 + fix(validators): generate JSDoc comments for validator schemas
+3
packages/openapi-ts-tests/test/__snapshots__/2.0.x/plugins/@hey-api/transformers/type-format-valibot/valibot.gen.ts
··· 12 12 foo: v.pipe(v.number(), v.integer()) 13 13 }); 14 14 15 + /** 16 + * OK 17 + */ 15 18 export const vPostFooResponse = vFoo;
+3
packages/openapi-ts-tests/test/__snapshots__/2.0.x/plugins/@hey-api/transformers/type-format-zod/zod.gen.ts
··· 12 12 foo: z.number().int() 13 13 }); 14 14 15 + /** 16 + * OK 17 + */ 15 18 export const zPostFooResponse = zFoo;
+165
packages/openapi-ts-tests/test/__snapshots__/2.0.x/plugins/valibot/default/valibot.gen.ts
··· 2 2 3 3 import * as v from 'valibot'; 4 4 5 + /** 6 + * Testing multiline comments in string: First line 7 + * Second line 8 + * 9 + * Fourth line 10 + */ 5 11 export const vCommentWithBreaks = v.pipe(v.number(), v.integer()); 6 12 13 + /** 14 + * Testing backticks in string: `backticks` and ```multiple backticks``` should work 15 + */ 7 16 export const vCommentWithBackticks = v.pipe(v.number(), v.integer()); 8 17 18 + /** 19 + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work 20 + */ 9 21 export const vCommentWithBackticksAndQuotes = v.pipe(v.number(), v.integer()); 10 22 23 + /** 24 + * Testing slashes in string: \backwards\\\ and /forwards/// should work 25 + */ 11 26 export const vCommentWithSlashes = v.pipe(v.number(), v.integer()); 12 27 28 + /** 29 + * Testing expression placeholders in string: ${expression} should work 30 + */ 13 31 export const vCommentWithExpressionPlaceholders = v.pipe(v.number(), v.integer()); 14 32 33 + /** 34 + * Testing quotes in string: 'single quote''' and "double quotes""" should work 35 + */ 15 36 export const vCommentWithQuotes = v.pipe(v.number(), v.integer()); 16 37 38 + /** 39 + * Testing reserved characters in string: * inline * and ** inline ** should work 40 + */ 17 41 export const vCommentWithReservedCharacters = v.pipe(v.number(), v.integer()); 18 42 43 + /** 44 + * This is a simple number 45 + */ 19 46 export const vSimpleInteger = v.pipe(v.number(), v.integer()); 20 47 48 + /** 49 + * This is a simple boolean 50 + */ 21 51 export const vSimpleBoolean = v.boolean(); 22 52 53 + /** 54 + * This is a simple string 55 + */ 23 56 export const vSimpleString = v.string(); 24 57 58 + /** 59 + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) 60 + */ 25 61 export const vNonAsciiStringæøåÆøÅöôêÊ字符串 = v.string(); 26 62 63 + /** 64 + * This is a simple file 65 + */ 27 66 export const vSimpleFile = v.string(); 28 67 68 + /** 69 + * This is a model with one string property 70 + */ 29 71 export const vModelWithString = v.object({ 30 72 prop: v.optional(v.string()) 31 73 }); 32 74 33 75 export const vSimpleReference = vModelWithString; 34 76 77 + /** 78 + * This is a simple string 79 + */ 35 80 export const vSimpleStringWithPattern = v.pipe(v.string(), v.maxLength(64), v.regex(/^[a-zA-Z0-9_]*$/)); 36 81 82 + /** 83 + * This is a simple enum with strings 84 + */ 37 85 export const vEnumWithStrings = v.picklist([ 38 86 'Success', 39 87 'Warning', ··· 43 91 'Non-ascii: øæåôöØÆÅÔÖ字符串' 44 92 ]); 45 93 94 + /** 95 + * This is a simple enum with numbers 96 + */ 46 97 export const vEnumWithNumbers = v.unknown(); 47 98 99 + /** 100 + * Success=1,Warning=2,Error=3 101 + */ 48 102 export const vEnumFromDescription = v.number(); 49 103 104 + /** 105 + * This is a simple enum with numbers 106 + */ 50 107 export const vEnumWithExtensions = v.unknown(); 51 108 109 + /** 110 + * This is a simple array with numbers 111 + */ 52 112 export const vArrayWithNumbers = v.array(v.pipe(v.number(), v.integer())); 53 113 114 + /** 115 + * This is a simple array with booleans 116 + */ 54 117 export const vArrayWithBooleans = v.array(v.boolean()); 55 118 119 + /** 120 + * This is a simple array with strings 121 + */ 56 122 export const vArrayWithStrings = v.array(v.string()); 57 123 124 + /** 125 + * This is a simple array with references 126 + */ 58 127 export const vArrayWithReferences = v.array(vModelWithString); 59 128 129 + /** 130 + * This is a simple array containing an array 131 + */ 60 132 export const vArrayWithArray = v.array(v.array(vModelWithString)); 61 133 134 + /** 135 + * This is a simple array with properties 136 + */ 62 137 export const vArrayWithProperties = v.array(v.object({ 63 138 foo: v.optional(v.string()), 64 139 bar: v.optional(v.string()) 65 140 })); 66 141 142 + /** 143 + * This is a string dictionary 144 + */ 67 145 export const vDictionaryWithString = v.object({}); 68 146 147 + /** 148 + * This is a string reference 149 + */ 69 150 export const vDictionaryWithReference = v.object({}); 70 151 152 + /** 153 + * This is a complex dictionary 154 + */ 71 155 export const vDictionaryWithArray = v.object({}); 72 156 157 + /** 158 + * This is a string dictionary 159 + */ 73 160 export const vDictionaryWithDictionary = v.object({}); 74 161 162 + /** 163 + * This is a complex dictionary 164 + */ 75 165 export const vDictionaryWithProperties = v.object({}); 76 166 167 + /** 168 + * This is a type-only model that defines Date as a string 169 + */ 77 170 export const vDate = v.string(); 78 171 172 + /** 173 + * This is a model with one number property 174 + */ 79 175 export const vModelWithInteger = v.object({ 80 176 prop: v.optional(v.pipe(v.number(), v.integer())) 81 177 }); 82 178 179 + /** 180 + * This is a model with one boolean property 181 + */ 83 182 export const vModelWithBoolean = v.object({ 84 183 prop: v.optional(v.boolean()) 85 184 }); 86 185 186 + /** 187 + * This is a model with one string property 188 + */ 87 189 export const vModelWithStringError = v.object({ 88 190 prop: v.optional(v.string()) 89 191 }); 90 192 193 + /** 194 + * This is a model with one string property 195 + */ 91 196 export const vModelWithNullableString = v.object({ 92 197 nullableProp: v.optional(v.union([ 93 198 v.string(), ··· 99 204 ]) 100 205 }); 101 206 207 + /** 208 + * This is a model with one enum 209 + */ 102 210 export const vModelWithEnum = v.object({ 103 211 test: v.optional(v.picklist([ 104 212 'Success', ··· 117 225 bool: v.optional(v.unknown()) 118 226 }); 119 227 228 + /** 229 + * This is a model with one enum 230 + */ 120 231 export const vModelWithEnumFromDescription = v.object({ 121 232 test: v.optional(v.pipe(v.number(), v.integer())) 122 233 }); 123 234 235 + /** 236 + * This is a model with nested enums 237 + */ 124 238 export const vModelWithNestedEnums = v.object({ 125 239 dictionaryWithEnum: v.optional(v.object({})), 126 240 dictionaryWithEnumFromDescription: v.optional(v.object({})), ··· 132 246 arrayWithDescription: v.optional(v.array(v.pipe(v.number(), v.integer()))) 133 247 }); 134 248 249 + /** 250 + * This is a model with one nested property 251 + */ 135 252 export const vModelWithProperties = v.object({ 136 253 required: v.string(), 137 254 requiredAndReadOnly: v.pipe(v.string(), v.readonly()), ··· 146 263 '@namespace.integer': v.optional(v.pipe(v.pipe(v.number(), v.integer()), v.readonly())) 147 264 }); 148 265 266 + /** 267 + * This is a model with one property containing a reference 268 + */ 149 269 export const vModelWithReference = v.object({ 150 270 prop: v.optional(vModelWithProperties) 151 271 }); 152 272 273 + /** 274 + * This is a model with one property containing an array 275 + */ 153 276 export const vModelWithArray = v.object({ 154 277 prop: v.optional(v.array(vModelWithString)), 155 278 propWithFile: v.optional(v.array(v.string())), 156 279 propWithNumber: v.optional(v.array(v.number())) 157 280 }); 158 281 282 + /** 283 + * This is a model with one property containing a dictionary 284 + */ 159 285 export const vModelWithDictionary = v.object({ 160 286 prop: v.optional(v.object({})) 161 287 }); 162 288 289 + /** 290 + * This is a model with one property containing a circular reference 291 + */ 163 292 export const vModelWithCircularReference: v.GenericSchema = v.object({ 164 293 prop: v.optional(v.lazy(() => { 165 294 return vModelWithCircularReference; 166 295 })) 167 296 }); 168 297 298 + /** 299 + * This is a model with one nested property 300 + */ 169 301 export const vModelWithNestedProperties = v.object({ 170 302 first: v.pipe(v.object({ 171 303 second: v.pipe(v.object({ ··· 174 306 }), v.readonly()) 175 307 }); 176 308 309 + /** 310 + * This is a model with duplicated properties 311 + */ 177 312 export const vModelWithDuplicateProperties = v.object({ 178 313 prop: v.optional(vModelWithString) 179 314 }); 180 315 316 + /** 317 + * This is a model with ordered properties 318 + */ 181 319 export const vModelWithOrderedProperties = v.object({ 182 320 zebra: v.optional(v.string()), 183 321 apple: v.optional(v.string()), 184 322 hawaii: v.optional(v.string()) 185 323 }); 186 324 325 + /** 326 + * This is a model with duplicated imports 327 + */ 187 328 export const vModelWithDuplicateImports = v.object({ 188 329 propA: v.optional(vModelWithString), 189 330 propB: v.optional(vModelWithString), 190 331 propC: v.optional(vModelWithString) 191 332 }); 192 333 334 + /** 335 + * This is a model that extends another model 336 + */ 193 337 export const vModelThatExtends = v.intersect([ 194 338 vModelWithString, 195 339 v.object({ ··· 198 342 }) 199 343 ]); 200 344 345 + /** 346 + * This is a model that extends another model 347 + */ 201 348 export const vModelThatExtendsExtends = v.intersect([ 202 349 vModelWithString, 203 350 vModelThatExtends, ··· 211 358 name: v.optional(v.string()) 212 359 }); 213 360 361 + /** 362 + * This is a model that contains a some patterns 363 + */ 214 364 export const vModelWithPattern = v.object({ 215 365 key: v.pipe(v.string(), v.maxLength(64), v.regex(/^[a-zA-Z0-9_]*$/)), 216 366 name: v.pipe(v.string(), v.maxLength(255)), ··· 250 400 v.unknown() 251 401 ]); 252 402 403 + /** 404 + * Message for default response 405 + */ 253 406 export const vCallWithResponseResponse = vModelWithString; 254 407 408 + /** 409 + * Message for 201 response 410 + */ 255 411 export const vCallWithDuplicateResponsesResponse = vModelWithString; 256 412 257 413 export const vCallWithResponsesResponse = v.union([ ··· 271 427 v.object({}) 272 428 ]); 273 429 430 + /** 431 + * Successful response 432 + */ 274 433 export const vComplexTypesResponse = v.array(vModelWithString); 275 434 435 + /** 436 + * Successful response 437 + */ 276 438 export const vNonAsciiæøåÆøÅöôêÊ字符串Response = vNonAsciiStringæøåÆøÅöôêÊ字符串; 277 439 440 + /** 441 + * OK 442 + */ 278 443 export const vPostApiVbyApiVersionBodyResponse = vResponsePostActivityResponse;
+165
packages/openapi-ts-tests/test/__snapshots__/2.0.x/plugins/zod/default/zod.gen.ts
··· 2 2 3 3 import { z } from 'zod'; 4 4 5 + /** 6 + * Testing multiline comments in string: First line 7 + * Second line 8 + * 9 + * Fourth line 10 + */ 5 11 export const zCommentWithBreaks = z.number().int(); 6 12 13 + /** 14 + * Testing backticks in string: `backticks` and ```multiple backticks``` should work 15 + */ 7 16 export const zCommentWithBackticks = z.number().int(); 8 17 18 + /** 19 + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work 20 + */ 9 21 export const zCommentWithBackticksAndQuotes = z.number().int(); 10 22 23 + /** 24 + * Testing slashes in string: \backwards\\\ and /forwards/// should work 25 + */ 11 26 export const zCommentWithSlashes = z.number().int(); 12 27 28 + /** 29 + * Testing expression placeholders in string: ${expression} should work 30 + */ 13 31 export const zCommentWithExpressionPlaceholders = z.number().int(); 14 32 33 + /** 34 + * Testing quotes in string: 'single quote''' and "double quotes""" should work 35 + */ 15 36 export const zCommentWithQuotes = z.number().int(); 16 37 38 + /** 39 + * Testing reserved characters in string: * inline * and ** inline ** should work 40 + */ 17 41 export const zCommentWithReservedCharacters = z.number().int(); 18 42 43 + /** 44 + * This is a simple number 45 + */ 19 46 export const zSimpleInteger = z.number().int(); 20 47 48 + /** 49 + * This is a simple boolean 50 + */ 21 51 export const zSimpleBoolean = z.boolean(); 22 52 53 + /** 54 + * This is a simple string 55 + */ 23 56 export const zSimpleString = z.string(); 24 57 58 + /** 59 + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) 60 + */ 25 61 export const zNonAsciiStringæøåÆøÅöôêÊ字符串 = z.string(); 26 62 63 + /** 64 + * This is a simple file 65 + */ 27 66 export const zSimpleFile = z.string(); 28 67 68 + /** 69 + * This is a model with one string property 70 + */ 29 71 export const zModelWithString = z.object({ 30 72 prop: z.string().optional() 31 73 }); 32 74 33 75 export const zSimpleReference = zModelWithString; 34 76 77 + /** 78 + * This is a simple string 79 + */ 35 80 export const zSimpleStringWithPattern = z.string().max(64).regex(/^[a-zA-Z0-9_]*$/); 36 81 82 + /** 83 + * This is a simple enum with strings 84 + */ 37 85 export const zEnumWithStrings = z.enum([ 38 86 'Success', 39 87 'Warning', ··· 43 91 'Non-ascii: øæåôöØÆÅÔÖ字符串' 44 92 ]); 45 93 94 + /** 95 + * This is a simple enum with numbers 96 + */ 46 97 export const zEnumWithNumbers = z.unknown(); 47 98 99 + /** 100 + * Success=1,Warning=2,Error=3 101 + */ 48 102 export const zEnumFromDescription = z.number(); 49 103 104 + /** 105 + * This is a simple enum with numbers 106 + */ 50 107 export const zEnumWithExtensions = z.unknown(); 51 108 109 + /** 110 + * This is a simple array with numbers 111 + */ 52 112 export const zArrayWithNumbers = z.array(z.number().int()); 53 113 114 + /** 115 + * This is a simple array with booleans 116 + */ 54 117 export const zArrayWithBooleans = z.array(z.boolean()); 55 118 119 + /** 120 + * This is a simple array with strings 121 + */ 56 122 export const zArrayWithStrings = z.array(z.string()); 57 123 124 + /** 125 + * This is a simple array with references 126 + */ 58 127 export const zArrayWithReferences = z.array(zModelWithString); 59 128 129 + /** 130 + * This is a simple array containing an array 131 + */ 60 132 export const zArrayWithArray = z.array(z.array(zModelWithString)); 61 133 134 + /** 135 + * This is a simple array with properties 136 + */ 62 137 export const zArrayWithProperties = z.array(z.object({ 63 138 foo: z.string().optional(), 64 139 bar: z.string().optional() 65 140 })); 66 141 142 + /** 143 + * This is a string dictionary 144 + */ 67 145 export const zDictionaryWithString = z.object({}); 68 146 147 + /** 148 + * This is a string reference 149 + */ 69 150 export const zDictionaryWithReference = z.object({}); 70 151 152 + /** 153 + * This is a complex dictionary 154 + */ 71 155 export const zDictionaryWithArray = z.object({}); 72 156 157 + /** 158 + * This is a string dictionary 159 + */ 73 160 export const zDictionaryWithDictionary = z.object({}); 74 161 162 + /** 163 + * This is a complex dictionary 164 + */ 75 165 export const zDictionaryWithProperties = z.object({}); 76 166 167 + /** 168 + * This is a type-only model that defines Date as a string 169 + */ 77 170 export const zDate = z.string(); 78 171 172 + /** 173 + * This is a model with one number property 174 + */ 79 175 export const zModelWithInteger = z.object({ 80 176 prop: z.number().int().optional() 81 177 }); 82 178 179 + /** 180 + * This is a model with one boolean property 181 + */ 83 182 export const zModelWithBoolean = z.object({ 84 183 prop: z.boolean().optional() 85 184 }); 86 185 186 + /** 187 + * This is a model with one string property 188 + */ 87 189 export const zModelWithStringError = z.object({ 88 190 prop: z.string().optional() 89 191 }); 90 192 193 + /** 194 + * This is a model with one string property 195 + */ 91 196 export const zModelWithNullableString = z.object({ 92 197 nullableProp: z.union([ 93 198 z.string(), ··· 99 204 ]) 100 205 }); 101 206 207 + /** 208 + * This is a model with one enum 209 + */ 102 210 export const zModelWithEnum = z.object({ 103 211 test: z.enum([ 104 212 'Success', ··· 117 225 bool: z.unknown().optional() 118 226 }); 119 227 228 + /** 229 + * This is a model with one enum 230 + */ 120 231 export const zModelWithEnumFromDescription = z.object({ 121 232 test: z.number().int().optional() 122 233 }); 123 234 235 + /** 236 + * This is a model with nested enums 237 + */ 124 238 export const zModelWithNestedEnums = z.object({ 125 239 dictionaryWithEnum: z.object({}).optional(), 126 240 dictionaryWithEnumFromDescription: z.object({}).optional(), ··· 132 246 arrayWithDescription: z.array(z.number().int()).optional() 133 247 }); 134 248 249 + /** 250 + * This is a model with one nested property 251 + */ 135 252 export const zModelWithProperties = z.object({ 136 253 required: z.string(), 137 254 requiredAndReadOnly: z.string().readonly(), ··· 146 263 '@namespace.integer': z.number().int().readonly().optional() 147 264 }); 148 265 266 + /** 267 + * This is a model with one property containing a reference 268 + */ 149 269 export const zModelWithReference = z.object({ 150 270 prop: zModelWithProperties.optional() 151 271 }); 152 272 273 + /** 274 + * This is a model with one property containing an array 275 + */ 153 276 export const zModelWithArray = z.object({ 154 277 prop: z.array(zModelWithString).optional(), 155 278 propWithFile: z.array(z.string()).optional(), 156 279 propWithNumber: z.array(z.number()).optional() 157 280 }); 158 281 282 + /** 283 + * This is a model with one property containing a dictionary 284 + */ 159 285 export const zModelWithDictionary = z.object({ 160 286 prop: z.object({}).optional() 161 287 }); 162 288 289 + /** 290 + * This is a model with one property containing a circular reference 291 + */ 163 292 export const zModelWithCircularReference: z.AnyZodObject = z.object({ 164 293 prop: z.lazy(() => { 165 294 return zModelWithCircularReference; 166 295 }).optional() 167 296 }); 168 297 298 + /** 299 + * This is a model with one nested property 300 + */ 169 301 export const zModelWithNestedProperties = z.object({ 170 302 first: z.object({ 171 303 second: z.object({ ··· 174 306 }).readonly() 175 307 }); 176 308 309 + /** 310 + * This is a model with duplicated properties 311 + */ 177 312 export const zModelWithDuplicateProperties = z.object({ 178 313 prop: zModelWithString.optional() 179 314 }); 180 315 316 + /** 317 + * This is a model with ordered properties 318 + */ 181 319 export const zModelWithOrderedProperties = z.object({ 182 320 zebra: z.string().optional(), 183 321 apple: z.string().optional(), 184 322 hawaii: z.string().optional() 185 323 }); 186 324 325 + /** 326 + * This is a model with duplicated imports 327 + */ 187 328 export const zModelWithDuplicateImports = z.object({ 188 329 propA: zModelWithString.optional(), 189 330 propB: zModelWithString.optional(), 190 331 propC: zModelWithString.optional() 191 332 }); 192 333 334 + /** 335 + * This is a model that extends another model 336 + */ 193 337 export const zModelThatExtends = zModelWithString.and(z.object({ 194 338 propExtendsA: z.string().optional(), 195 339 propExtendsB: zModelWithString.optional() 196 340 })); 197 341 342 + /** 343 + * This is a model that extends another model 344 + */ 198 345 export const zModelThatExtendsExtends = zModelWithString.and(zModelThatExtends).and(z.object({ 199 346 propExtendsC: z.string().optional(), 200 347 propExtendsD: zModelWithString.optional() ··· 204 351 name: z.string().optional() 205 352 }); 206 353 354 + /** 355 + * This is a model that contains a some patterns 356 + */ 207 357 export const zModelWithPattern = z.object({ 208 358 key: z.string().max(64).regex(/^[a-zA-Z0-9_]*$/), 209 359 name: z.string().max(255), ··· 243 393 z.unknown() 244 394 ]); 245 395 396 + /** 397 + * Message for default response 398 + */ 246 399 export const zCallWithResponseResponse = zModelWithString; 247 400 401 + /** 402 + * Message for 201 response 403 + */ 248 404 export const zCallWithDuplicateResponsesResponse = zModelWithString; 249 405 250 406 export const zCallWithResponsesResponse = z.union([ ··· 264 420 z.object({}) 265 421 ]); 266 422 423 + /** 424 + * Successful response 425 + */ 267 426 export const zComplexTypesResponse = z.array(zModelWithString); 268 427 428 + /** 429 + * Successful response 430 + */ 269 431 export const zNonAsciiæøåÆøÅöôêÊ字符串Response = zNonAsciiStringæøåÆøÅöôêÊ字符串; 270 432 433 + /** 434 + * OK 435 + */ 271 436 export const zPostApiVbyApiVersionBodyResponse = zResponsePostActivityResponse;
+21
packages/openapi-ts-tests/test/__snapshots__/3.0.x/plugins/@hey-api/sdk/default/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 666 669 }; 667 670 668 671 export type FileReadable = { 672 + /** 673 + * Id 674 + */ 669 675 readonly id?: string; 676 + /** 677 + * Updated at 678 + */ 670 679 readonly updated_at?: string; 680 + /** 681 + * Created at 682 + */ 671 683 readonly created_at?: string; 684 + /** 685 + * Mime 686 + */ 672 687 mime: string; 688 + /** 689 + * File 690 + */ 673 691 readonly file?: string; 674 692 }; 675 693 676 694 export type FileWritable = { 695 + /** 696 + * Mime 697 + */ 677 698 mime: string; 678 699 }; 679 700
+21
packages/openapi-ts-tests/test/__snapshots__/3.0.x/plugins/@hey-api/sdk/throwOnError/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 666 669 }; 667 670 668 671 export type FileReadable = { 672 + /** 673 + * Id 674 + */ 669 675 readonly id?: string; 676 + /** 677 + * Updated at 678 + */ 670 679 readonly updated_at?: string; 680 + /** 681 + * Created at 682 + */ 671 683 readonly created_at?: string; 684 + /** 685 + * Mime 686 + */ 672 687 mime: string; 688 + /** 689 + * File 690 + */ 673 691 readonly file?: string; 674 692 }; 675 693 676 694 export type FileWritable = { 695 + /** 696 + * Mime 697 + */ 677 698 mime: string; 678 699 }; 679 700
+3
packages/openapi-ts-tests/test/__snapshots__/3.0.x/plugins/@hey-api/transformers/type-format-valibot/valibot.gen.ts
··· 12 12 foo: v.pipe(v.number(), v.integer()) 13 13 }); 14 14 15 + /** 16 + * OK 17 + */ 15 18 export const vPostFooResponse = vFoo;
+3
packages/openapi-ts-tests/test/__snapshots__/3.0.x/plugins/@hey-api/transformers/type-format-zod/zod.gen.ts
··· 12 12 foo: z.number().int() 13 13 }); 14 14 15 + /** 16 + * OK 17 + */ 15 18 export const zPostFooResponse = zFoo;
+21
packages/openapi-ts-tests/test/__snapshots__/3.0.x/plugins/@tanstack/angular-query-experimental/asClass/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 666 669 }; 667 670 668 671 export type FileReadable = { 672 + /** 673 + * Id 674 + */ 669 675 readonly id?: string; 676 + /** 677 + * Updated at 678 + */ 670 679 readonly updated_at?: string; 680 + /** 681 + * Created at 682 + */ 671 683 readonly created_at?: string; 684 + /** 685 + * Mime 686 + */ 672 687 mime: string; 688 + /** 689 + * File 690 + */ 673 691 readonly file?: string; 674 692 }; 675 693 676 694 export type FileWritable = { 695 + /** 696 + * Mime 697 + */ 677 698 mime: string; 678 699 }; 679 700
+21
packages/openapi-ts-tests/test/__snapshots__/3.0.x/plugins/@tanstack/angular-query-experimental/axios/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 666 669 }; 667 670 668 671 export type FileReadable = { 672 + /** 673 + * Id 674 + */ 669 675 readonly id?: string; 676 + /** 677 + * Updated at 678 + */ 670 679 readonly updated_at?: string; 680 + /** 681 + * Created at 682 + */ 671 683 readonly created_at?: string; 684 + /** 685 + * Mime 686 + */ 672 687 mime: string; 688 + /** 689 + * File 690 + */ 673 691 readonly file?: string; 674 692 }; 675 693 676 694 export type FileWritable = { 695 + /** 696 + * Mime 697 + */ 677 698 mime: string; 678 699 }; 679 700
+21
packages/openapi-ts-tests/test/__snapshots__/3.0.x/plugins/@tanstack/angular-query-experimental/fetch/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 666 669 }; 667 670 668 671 export type FileReadable = { 672 + /** 673 + * Id 674 + */ 669 675 readonly id?: string; 676 + /** 677 + * Updated at 678 + */ 670 679 readonly updated_at?: string; 680 + /** 681 + * Created at 682 + */ 671 683 readonly created_at?: string; 684 + /** 685 + * Mime 686 + */ 672 687 mime: string; 688 + /** 689 + * File 690 + */ 673 691 readonly file?: string; 674 692 }; 675 693 676 694 export type FileWritable = { 695 + /** 696 + * Mime 697 + */ 677 698 mime: string; 678 699 }; 679 700
+21
packages/openapi-ts-tests/test/__snapshots__/3.0.x/plugins/@tanstack/react-query/asClass/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 666 669 }; 667 670 668 671 export type FileReadable = { 672 + /** 673 + * Id 674 + */ 669 675 readonly id?: string; 676 + /** 677 + * Updated at 678 + */ 670 679 readonly updated_at?: string; 680 + /** 681 + * Created at 682 + */ 671 683 readonly created_at?: string; 684 + /** 685 + * Mime 686 + */ 672 687 mime: string; 688 + /** 689 + * File 690 + */ 673 691 readonly file?: string; 674 692 }; 675 693 676 694 export type FileWritable = { 695 + /** 696 + * Mime 697 + */ 677 698 mime: string; 678 699 }; 679 700
+21
packages/openapi-ts-tests/test/__snapshots__/3.0.x/plugins/@tanstack/react-query/axios/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 666 669 }; 667 670 668 671 export type FileReadable = { 672 + /** 673 + * Id 674 + */ 669 675 readonly id?: string; 676 + /** 677 + * Updated at 678 + */ 670 679 readonly updated_at?: string; 680 + /** 681 + * Created at 682 + */ 671 683 readonly created_at?: string; 684 + /** 685 + * Mime 686 + */ 672 687 mime: string; 688 + /** 689 + * File 690 + */ 673 691 readonly file?: string; 674 692 }; 675 693 676 694 export type FileWritable = { 695 + /** 696 + * Mime 697 + */ 677 698 mime: string; 678 699 }; 679 700
+21
packages/openapi-ts-tests/test/__snapshots__/3.0.x/plugins/@tanstack/react-query/fetch/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 666 669 }; 667 670 668 671 export type FileReadable = { 672 + /** 673 + * Id 674 + */ 669 675 readonly id?: string; 676 + /** 677 + * Updated at 678 + */ 670 679 readonly updated_at?: string; 680 + /** 681 + * Created at 682 + */ 671 683 readonly created_at?: string; 684 + /** 685 + * Mime 686 + */ 672 687 mime: string; 688 + /** 689 + * File 690 + */ 673 691 readonly file?: string; 674 692 }; 675 693 676 694 export type FileWritable = { 695 + /** 696 + * Mime 697 + */ 677 698 mime: string; 678 699 }; 679 700
+21
packages/openapi-ts-tests/test/__snapshots__/3.0.x/plugins/@tanstack/solid-query/asClass/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 666 669 }; 667 670 668 671 export type FileReadable = { 672 + /** 673 + * Id 674 + */ 669 675 readonly id?: string; 676 + /** 677 + * Updated at 678 + */ 670 679 readonly updated_at?: string; 680 + /** 681 + * Created at 682 + */ 671 683 readonly created_at?: string; 684 + /** 685 + * Mime 686 + */ 672 687 mime: string; 688 + /** 689 + * File 690 + */ 673 691 readonly file?: string; 674 692 }; 675 693 676 694 export type FileWritable = { 695 + /** 696 + * Mime 697 + */ 677 698 mime: string; 678 699 }; 679 700
+21
packages/openapi-ts-tests/test/__snapshots__/3.0.x/plugins/@tanstack/solid-query/axios/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 666 669 }; 667 670 668 671 export type FileReadable = { 672 + /** 673 + * Id 674 + */ 669 675 readonly id?: string; 676 + /** 677 + * Updated at 678 + */ 670 679 readonly updated_at?: string; 680 + /** 681 + * Created at 682 + */ 671 683 readonly created_at?: string; 684 + /** 685 + * Mime 686 + */ 672 687 mime: string; 688 + /** 689 + * File 690 + */ 673 691 readonly file?: string; 674 692 }; 675 693 676 694 export type FileWritable = { 695 + /** 696 + * Mime 697 + */ 677 698 mime: string; 678 699 }; 679 700
+21
packages/openapi-ts-tests/test/__snapshots__/3.0.x/plugins/@tanstack/solid-query/fetch/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 666 669 }; 667 670 668 671 export type FileReadable = { 672 + /** 673 + * Id 674 + */ 669 675 readonly id?: string; 676 + /** 677 + * Updated at 678 + */ 670 679 readonly updated_at?: string; 680 + /** 681 + * Created at 682 + */ 671 683 readonly created_at?: string; 684 + /** 685 + * Mime 686 + */ 672 687 mime: string; 688 + /** 689 + * File 690 + */ 673 691 readonly file?: string; 674 692 }; 675 693 676 694 export type FileWritable = { 695 + /** 696 + * Mime 697 + */ 677 698 mime: string; 678 699 }; 679 700
+21
packages/openapi-ts-tests/test/__snapshots__/3.0.x/plugins/@tanstack/svelte-query/asClass/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 666 669 }; 667 670 668 671 export type FileReadable = { 672 + /** 673 + * Id 674 + */ 669 675 readonly id?: string; 676 + /** 677 + * Updated at 678 + */ 670 679 readonly updated_at?: string; 680 + /** 681 + * Created at 682 + */ 671 683 readonly created_at?: string; 684 + /** 685 + * Mime 686 + */ 672 687 mime: string; 688 + /** 689 + * File 690 + */ 673 691 readonly file?: string; 674 692 }; 675 693 676 694 export type FileWritable = { 695 + /** 696 + * Mime 697 + */ 677 698 mime: string; 678 699 }; 679 700
+21
packages/openapi-ts-tests/test/__snapshots__/3.0.x/plugins/@tanstack/svelte-query/axios/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 666 669 }; 667 670 668 671 export type FileReadable = { 672 + /** 673 + * Id 674 + */ 669 675 readonly id?: string; 676 + /** 677 + * Updated at 678 + */ 670 679 readonly updated_at?: string; 680 + /** 681 + * Created at 682 + */ 671 683 readonly created_at?: string; 684 + /** 685 + * Mime 686 + */ 672 687 mime: string; 688 + /** 689 + * File 690 + */ 673 691 readonly file?: string; 674 692 }; 675 693 676 694 export type FileWritable = { 695 + /** 696 + * Mime 697 + */ 677 698 mime: string; 678 699 }; 679 700
+21
packages/openapi-ts-tests/test/__snapshots__/3.0.x/plugins/@tanstack/svelte-query/fetch/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 666 669 }; 667 670 668 671 export type FileReadable = { 672 + /** 673 + * Id 674 + */ 669 675 readonly id?: string; 676 + /** 677 + * Updated at 678 + */ 670 679 readonly updated_at?: string; 680 + /** 681 + * Created at 682 + */ 671 683 readonly created_at?: string; 684 + /** 685 + * Mime 686 + */ 672 687 mime: string; 688 + /** 689 + * File 690 + */ 673 691 readonly file?: string; 674 692 }; 675 693 676 694 export type FileWritable = { 695 + /** 696 + * Mime 697 + */ 677 698 mime: string; 678 699 }; 679 700
+21
packages/openapi-ts-tests/test/__snapshots__/3.0.x/plugins/@tanstack/vue-query/asClass/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 666 669 }; 667 670 668 671 export type FileReadable = { 672 + /** 673 + * Id 674 + */ 669 675 readonly id?: string; 676 + /** 677 + * Updated at 678 + */ 670 679 readonly updated_at?: string; 680 + /** 681 + * Created at 682 + */ 671 683 readonly created_at?: string; 684 + /** 685 + * Mime 686 + */ 672 687 mime: string; 688 + /** 689 + * File 690 + */ 673 691 readonly file?: string; 674 692 }; 675 693 676 694 export type FileWritable = { 695 + /** 696 + * Mime 697 + */ 677 698 mime: string; 678 699 }; 679 700
+21
packages/openapi-ts-tests/test/__snapshots__/3.0.x/plugins/@tanstack/vue-query/axios/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 666 669 }; 667 670 668 671 export type FileReadable = { 672 + /** 673 + * Id 674 + */ 669 675 readonly id?: string; 676 + /** 677 + * Updated at 678 + */ 670 679 readonly updated_at?: string; 680 + /** 681 + * Created at 682 + */ 671 683 readonly created_at?: string; 684 + /** 685 + * Mime 686 + */ 672 687 mime: string; 688 + /** 689 + * File 690 + */ 673 691 readonly file?: string; 674 692 }; 675 693 676 694 export type FileWritable = { 695 + /** 696 + * Mime 697 + */ 677 698 mime: string; 678 699 }; 679 700
+21
packages/openapi-ts-tests/test/__snapshots__/3.0.x/plugins/@tanstack/vue-query/fetch/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 666 669 }; 667 670 668 671 export type FileReadable = { 672 + /** 673 + * Id 674 + */ 669 675 readonly id?: string; 676 + /** 677 + * Updated at 678 + */ 670 679 readonly updated_at?: string; 680 + /** 681 + * Created at 682 + */ 671 683 readonly created_at?: string; 684 + /** 685 + * Mime 686 + */ 672 687 mime: string; 688 + /** 689 + * File 690 + */ 673 691 readonly file?: string; 674 692 }; 675 693 676 694 export type FileWritable = { 695 + /** 696 + * Mime 697 + */ 677 698 mime: string; 678 699 }; 679 700
+21
packages/openapi-ts-tests/test/__snapshots__/3.0.x/plugins/fastify/default/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 666 669 }; 667 670 668 671 export type FileReadable = { 672 + /** 673 + * Id 674 + */ 669 675 readonly id?: string; 676 + /** 677 + * Updated at 678 + */ 670 679 readonly updated_at?: string; 680 + /** 681 + * Created at 682 + */ 671 683 readonly created_at?: string; 684 + /** 685 + * Mime 686 + */ 672 687 mime: string; 688 + /** 689 + * File 690 + */ 673 691 readonly file?: string; 674 692 }; 675 693 676 694 export type FileWritable = { 695 + /** 696 + * Mime 697 + */ 677 698 mime: string; 678 699 }; 679 700
+304
packages/openapi-ts-tests/test/__snapshots__/3.0.x/plugins/valibot/default/valibot.gen.ts
··· 2 2 3 3 import * as v from 'valibot'; 4 4 5 + /** 6 + * Model with number-only name 7 + */ 5 8 export const v400 = v.string(); 6 9 10 + /** 11 + * Testing multiline comments in string: First line 12 + * Second line 13 + * 14 + * Fourth line 15 + */ 7 16 export const vCamelCaseCommentWithBreaks = v.pipe(v.number(), v.integer()); 8 17 18 + /** 19 + * Testing multiline comments in string: First line 20 + * Second line 21 + * 22 + * Fourth line 23 + */ 9 24 export const vCommentWithBreaks = v.pipe(v.number(), v.integer()); 10 25 26 + /** 27 + * Testing backticks in string: `backticks` and ```multiple backticks``` should work 28 + */ 11 29 export const vCommentWithBackticks = v.pipe(v.number(), v.integer()); 12 30 31 + /** 32 + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work 33 + */ 13 34 export const vCommentWithBackticksAndQuotes = v.pipe(v.number(), v.integer()); 14 35 36 + /** 37 + * Testing slashes in string: \backwards\\\ and /forwards/// should work 38 + */ 15 39 export const vCommentWithSlashes = v.pipe(v.number(), v.integer()); 16 40 41 + /** 42 + * Testing expression placeholders in string: ${expression} should work 43 + */ 17 44 export const vCommentWithExpressionPlaceholders = v.pipe(v.number(), v.integer()); 18 45 46 + /** 47 + * Testing quotes in string: 'single quote''' and "double quotes""" should work 48 + */ 19 49 export const vCommentWithQuotes = v.pipe(v.number(), v.integer()); 20 50 51 + /** 52 + * Testing reserved characters in string: * inline * and ** inline ** should work 53 + */ 21 54 export const vCommentWithReservedCharacters = v.pipe(v.number(), v.integer()); 22 55 56 + /** 57 + * This is a simple number 58 + */ 23 59 export const vSimpleInteger = v.pipe(v.number(), v.integer()); 24 60 61 + /** 62 + * This is a simple boolean 63 + */ 25 64 export const vSimpleBoolean = v.boolean(); 26 65 66 + /** 67 + * This is a simple string 68 + */ 27 69 export const vSimpleString = v.string(); 28 70 71 + /** 72 + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) 73 + */ 29 74 export const vNonAsciiStringæøåÆøÅöôêÊ字符串 = v.string(); 30 75 76 + /** 77 + * This is a simple file 78 + */ 31 79 export const vSimpleFile = v.string(); 32 80 81 + /** 82 + * This is a model with one string property 83 + */ 33 84 export const vModelWithString = v.object({ 34 85 prop: v.optional(v.string()) 35 86 }); 36 87 88 + /** 89 + * This is a simple reference 90 + */ 37 91 export const vSimpleReference = vModelWithString; 38 92 93 + /** 94 + * This is a simple string 95 + */ 39 96 export const vSimpleStringWithPattern = v.union([ 40 97 v.pipe(v.string(), v.maxLength(64), v.regex(/^[a-zA-Z0-9_]*$/)), 41 98 v.null() 42 99 ]); 43 100 101 + /** 102 + * This is a simple enum with strings 103 + */ 44 104 export const vEnumWithStrings = v.picklist([ 45 105 'Success', 46 106 'Warning', ··· 57 117 '' 58 118 ]); 59 119 120 + /** 121 + * This is a simple enum with numbers 122 + */ 60 123 export const vEnumWithNumbers = v.unknown(); 61 124 125 + /** 126 + * Success=1,Warning=2,Error=3 127 + */ 62 128 export const vEnumFromDescription = v.number(); 63 129 130 + /** 131 + * This is a simple enum with numbers 132 + */ 64 133 export const vEnumWithExtensions = v.unknown(); 65 134 66 135 export const vEnumWithXEnumNames = v.unknown(); 67 136 137 + /** 138 + * This is a simple array with numbers 139 + */ 68 140 export const vArrayWithNumbers = v.array(v.pipe(v.number(), v.integer())); 69 141 142 + /** 143 + * This is a simple array with booleans 144 + */ 70 145 export const vArrayWithBooleans = v.array(v.boolean()); 71 146 147 + /** 148 + * This is a simple array with strings 149 + */ 72 150 export const vArrayWithStrings = v.optional(v.array(v.string()), ['test']); 73 151 152 + /** 153 + * This is a simple array with references 154 + */ 74 155 export const vArrayWithReferences = v.array(vModelWithString); 75 156 157 + /** 158 + * This is a simple array containing an array 159 + */ 76 160 export const vArrayWithArray = v.array(v.array(vModelWithString)); 77 161 162 + /** 163 + * This is a simple array with properties 164 + */ 78 165 export const vArrayWithProperties = v.array(v.object({ 79 166 '16x16': v.optional(vCamelCaseCommentWithBreaks), 80 167 bar: v.optional(v.string()) 81 168 })); 82 169 170 + /** 171 + * This is a simple array with any of properties 172 + */ 83 173 export const vArrayWithAnyOfProperties = v.array(v.unknown()); 84 174 85 175 export const vAnyOfAnyAndNull = v.object({ 86 176 data: v.optional(v.unknown()) 87 177 }); 88 178 179 + /** 180 + * This is a simple array with any of properties 181 + */ 89 182 export const vAnyOfArrays = v.object({ 90 183 results: v.optional(v.array(v.unknown())) 91 184 }); 92 185 186 + /** 187 + * This is a string dictionary 188 + */ 93 189 export const vDictionaryWithString = v.object({}); 94 190 95 191 export const vDictionaryWithPropertiesAndAdditionalProperties = v.object({ ··· 97 193 bar: v.optional(v.boolean()) 98 194 }); 99 195 196 + /** 197 + * This is a string reference 198 + */ 100 199 export const vDictionaryWithReference = v.object({}); 101 200 201 + /** 202 + * This is a complex dictionary 203 + */ 102 204 export const vDictionaryWithArray = v.object({}); 103 205 206 + /** 207 + * This is a string dictionary 208 + */ 104 209 export const vDictionaryWithDictionary = v.object({}); 105 210 211 + /** 212 + * This is a complex dictionary 213 + */ 106 214 export const vDictionaryWithProperties = v.object({}); 107 215 216 + /** 217 + * This is a model with one number property 218 + */ 108 219 export const vModelWithInteger = v.object({ 109 220 prop: v.optional(v.pipe(v.number(), v.integer())) 110 221 }); 111 222 223 + /** 224 + * This is a model with one boolean property 225 + */ 112 226 export const vModelWithBoolean = v.object({ 113 227 prop: v.optional(v.boolean()) 114 228 }); 115 229 230 + /** 231 + * This is a model with one string property 232 + */ 116 233 export const vModelWithStringError = v.object({ 117 234 prop: v.optional(v.string()) 118 235 }); 119 236 237 + /** 238 + * `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) 239 + */ 120 240 export const vModelFromZendesk = v.string(); 121 241 242 + /** 243 + * This is a model with one string property 244 + */ 122 245 export const vModelWithNullableString = v.object({ 123 246 nullableProp1: v.optional(v.union([ 124 247 v.string(), ··· 144 267 ])) 145 268 }); 146 269 270 + /** 271 + * This is a model with one enum 272 + */ 147 273 export const vModelWithEnum = v.object({ 148 274 'foo_bar-enum': v.optional(v.picklist([ 149 275 'Success', ··· 162 288 bool: v.optional(v.unknown()) 163 289 }); 164 290 291 + /** 292 + * This is a model with one enum with escaped name 293 + */ 165 294 export const vModelWithEnumWithHyphen = v.object({ 166 295 'foo-bar-baz-qux': v.optional(v.picklist([ 167 296 '3.0' 168 297 ])) 169 298 }); 170 299 300 + /** 301 + * This is a model with one enum 302 + */ 171 303 export const vModelWithEnumFromDescription = v.object({ 172 304 test: v.optional(v.pipe(v.number(), v.integer())) 173 305 }); 174 306 307 + /** 308 + * This is a model with nested enums 309 + */ 175 310 export const vModelWithNestedEnums = v.object({ 176 311 dictionaryWithEnum: v.optional(v.object({})), 177 312 dictionaryWithEnumFromDescription: v.optional(v.object({})), ··· 189 324 ])) 190 325 }); 191 326 327 + /** 328 + * This is a model with one nested property 329 + */ 192 330 export const vModelWithProperties = v.object({ 193 331 required: v.string(), 194 332 requiredAndReadOnly: v.pipe(v.string(), v.readonly()), ··· 207 345 '@namespace.integer': v.optional(v.pipe(v.pipe(v.number(), v.integer()), v.readonly())) 208 346 }); 209 347 348 + /** 349 + * This is a model with one property containing a reference 350 + */ 210 351 export const vModelWithReference = v.object({ 211 352 prop: v.optional(vModelWithProperties) 212 353 }); ··· 217 358 baz: v.string() 218 359 }); 219 360 361 + /** 362 + * This is a model with one property containing an array 363 + */ 220 364 export const vModelWithArrayReadOnlyAndWriteOnly = v.object({ 221 365 prop: v.optional(v.array(vModelWithReadOnlyAndWriteOnly)), 222 366 propWithFile: v.optional(v.array(v.string())), 223 367 propWithNumber: v.optional(v.array(v.number())) 224 368 }); 225 369 370 + /** 371 + * This is a model with one property containing an array 372 + */ 226 373 export const vModelWithArray = v.object({ 227 374 prop: v.optional(v.array(vModelWithString)), 228 375 propWithFile: v.optional(v.array(v.string())), 229 376 propWithNumber: v.optional(v.array(v.number())) 230 377 }); 231 378 379 + /** 380 + * This is a model with one property containing a dictionary 381 + */ 232 382 export const vModelWithDictionary = v.object({ 233 383 prop: v.optional(v.object({})) 234 384 }); 235 385 386 + /** 387 + * This is a deprecated model with a deprecated property 388 + * @deprecated 389 + */ 236 390 export const vDeprecatedModel = v.object({ 237 391 prop: v.optional(v.string()) 238 392 }); 239 393 394 + /** 395 + * This is a model with one property containing a circular reference 396 + */ 240 397 export const vModelWithCircularReference: v.GenericSchema = v.object({ 241 398 prop: v.optional(v.lazy(() => { 242 399 return vModelWithCircularReference; 243 400 })) 244 401 }); 245 402 403 + /** 404 + * This is a model with one property with a 'one of' relationship 405 + */ 246 406 export const vCompositionWithOneOf = v.object({ 247 407 propA: v.optional(v.union([ 248 408 vModelWithString, ··· 252 412 ])) 253 413 }); 254 414 415 + /** 416 + * This is a model with one property with a 'one of' relationship where the options are not $ref 417 + */ 255 418 export const vCompositionWithOneOfAnonymous = v.object({ 256 419 propA: v.optional(v.union([ 257 420 v.object({ ··· 262 425 ])) 263 426 }); 264 427 428 + /** 429 + * Circle 430 + */ 265 431 export const vModelCircle = v.object({ 266 432 kind: v.string(), 267 433 radius: v.optional(v.number()) 268 434 }); 269 435 436 + /** 437 + * Square 438 + */ 270 439 export const vModelSquare = v.object({ 271 440 kind: v.string(), 272 441 sideLength: v.optional(v.number()) 273 442 }); 274 443 444 + /** 445 + * This is a model with one property with a 'one of' relationship where the options are not $ref 446 + */ 275 447 export const vCompositionWithOneOfDiscriminator = v.union([ 276 448 v.intersect([ 277 449 v.object({ ··· 287 459 ]) 288 460 ]); 289 461 462 + /** 463 + * This is a model with one property with a 'any of' relationship 464 + */ 290 465 export const vCompositionWithAnyOf = v.object({ 291 466 propA: v.optional(v.union([ 292 467 vModelWithString, ··· 296 471 ])) 297 472 }); 298 473 474 + /** 475 + * This is a model with one property with a 'any of' relationship where the options are not $ref 476 + */ 299 477 export const vCompositionWithAnyOfAnonymous = v.object({ 300 478 propA: v.optional(v.union([ 301 479 v.object({ ··· 306 484 ])) 307 485 }); 308 486 487 + /** 488 + * This is a model with nested 'any of' property with a type null 489 + */ 309 490 export const vCompositionWithNestedAnyAndTypeNull = v.object({ 310 491 propA: v.optional(v.union([ 311 492 v.array(v.union([ ··· 328 509 'ConstValue' 329 510 ]); 330 511 512 + /** 513 + * This is a model with one property with a 'any of' relationship where the options are not $ref 514 + */ 331 515 export const vCompositionWithNestedAnyOfAndNull = v.object({ 332 516 propA: v.optional(v.union([ 333 517 v.array(v.unknown()), ··· 335 519 ])) 336 520 }); 337 521 522 + /** 523 + * This is a model with one property with a 'one of' relationship 524 + */ 338 525 export const vCompositionWithOneOfAndNullable = v.object({ 339 526 propA: v.optional(v.union([ 340 527 v.object({ ··· 347 534 ])) 348 535 }); 349 536 537 + /** 538 + * This is a model that contains a simple dictionary within composition 539 + */ 350 540 export const vCompositionWithOneOfAndSimpleDictionary = v.object({ 351 541 propA: v.optional(v.union([ 352 542 v.boolean(), ··· 354 544 ])) 355 545 }); 356 546 547 + /** 548 + * This is a model that contains a dictionary of simple arrays within composition 549 + */ 357 550 export const vCompositionWithOneOfAndSimpleArrayDictionary = v.object({ 358 551 propA: v.optional(v.union([ 359 552 v.boolean(), ··· 361 554 ])) 362 555 }); 363 556 557 + /** 558 + * This is a model that contains a dictionary of complex arrays (composited) within composition 559 + */ 364 560 export const vCompositionWithOneOfAndComplexArrayDictionary = v.object({ 365 561 propA: v.optional(v.union([ 366 562 v.boolean(), ··· 368 564 ])) 369 565 }); 370 566 567 + /** 568 + * This is a model with one property with a 'all of' relationship 569 + */ 371 570 export const vCompositionWithAllOfAndNullable = v.object({ 372 571 propA: v.optional(v.union([ 373 572 v.intersect([ ··· 382 581 ])) 383 582 }); 384 583 584 + /** 585 + * This is a model with one property with a 'any of' relationship 586 + */ 385 587 export const vCompositionWithAnyOfAndNullable = v.object({ 386 588 propA: v.optional(v.union([ 387 589 v.object({ ··· 394 596 ])) 395 597 }); 396 598 599 + /** 600 + * This is a base model with two simple optional properties 601 + */ 397 602 export const vCompositionBaseModel = v.object({ 398 603 firstName: v.optional(v.string()), 399 604 lastname: v.optional(v.string()) 400 605 }); 401 606 607 + /** 608 + * This is a model that extends the base model 609 + */ 402 610 export const vCompositionExtendedModel = v.intersect([ 403 611 vCompositionBaseModel, 404 612 v.object({ ··· 408 616 }) 409 617 ]); 410 618 619 + /** 620 + * This is a model with one nested property 621 + */ 411 622 export const vModelWithNestedProperties = v.object({ 412 623 first: v.pipe(v.union([ 413 624 v.pipe(v.object({ ··· 425 636 ]), v.readonly()) 426 637 }); 427 638 639 + /** 640 + * This is a model with duplicated properties 641 + */ 428 642 export const vModelWithDuplicateProperties = v.object({ 429 643 prop: v.optional(vModelWithString) 430 644 }); 431 645 646 + /** 647 + * This is a model with ordered properties 648 + */ 432 649 export const vModelWithOrderedProperties = v.object({ 433 650 zebra: v.optional(v.string()), 434 651 apple: v.optional(v.string()), 435 652 hawaii: v.optional(v.string()) 436 653 }); 437 654 655 + /** 656 + * This is a model with duplicated imports 657 + */ 438 658 export const vModelWithDuplicateImports = v.object({ 439 659 propA: v.optional(vModelWithString), 440 660 propB: v.optional(vModelWithString), 441 661 propC: v.optional(vModelWithString) 442 662 }); 443 663 664 + /** 665 + * This is a model that extends another model 666 + */ 444 667 export const vModelThatExtends = v.intersect([ 445 668 vModelWithString, 446 669 v.object({ ··· 449 672 }) 450 673 ]); 451 674 675 + /** 676 + * This is a model that extends another model 677 + */ 452 678 export const vModelThatExtendsExtends = v.intersect([ 453 679 vModelWithString, 454 680 vModelThatExtends, ··· 458 684 }) 459 685 ]); 460 686 687 + /** 688 + * This is a model that contains a some patterns 689 + */ 461 690 export const vModelWithPattern = v.object({ 462 691 key: v.pipe(v.string(), v.maxLength(64), v.regex(/^[a-zA-Z0-9_]*$/)), 463 692 name: v.pipe(v.string(), v.maxLength(255)), ··· 488 717 sort: v.optional(v.array(v.string())) 489 718 }); 490 719 720 + /** 721 + * This is a free-form object without additionalProperties. 722 + */ 491 723 export const vFreeFormObjectWithoutAdditionalProperties = v.object({}); 492 724 725 + /** 726 + * This is a free-form object with additionalProperties: true. 727 + */ 493 728 export const vFreeFormObjectWithAdditionalPropertiesEqTrue = v.object({}); 494 729 730 + /** 731 + * This is a free-form object with additionalProperties: {}. 732 + */ 495 733 export const vFreeFormObjectWithAdditionalPropertiesEqEmptyObject = v.object({}); 496 734 497 735 export const vModelWithConst = v.object({ ··· 505 743 ])) 506 744 }); 507 745 746 + /** 747 + * This is a model with one property and additionalProperties: true 748 + */ 508 749 export const vModelWithAdditionalPropertiesEqTrue = v.object({ 509 750 prop: v.optional(v.string()) 510 751 }); ··· 516 757 ])) 517 758 }); 518 759 760 + /** 761 + * This is a reusable parameter 762 + */ 519 763 export const vSimpleParameter = v.unknown(); 520 764 521 765 export const vCompositionWithOneOfAndProperties = v.intersect([ ··· 536 780 }) 537 781 ]); 538 782 783 + /** 784 + * An object that can be null 785 + */ 539 786 export const vNullableObject = v.optional(v.union([ 540 787 v.object({ 541 788 foo: v.optional(v.string()) ··· 543 790 v.null() 544 791 ]), null); 545 792 793 + /** 794 + * Some % character 795 + */ 546 796 export const vCharactersInDescription = v.string(); 547 797 548 798 export const vModelWithNullableObject = v.object({ ··· 646 896 ]) 647 897 ]); 648 898 899 + /** 900 + * Model with restricted keyword name 901 + */ 649 902 export const vImport = v.string(); 650 903 651 904 export const vModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = v.tuple([ ··· 674 927 value: v.optional(v.unknown()) 675 928 }); 676 929 930 + /** 931 + * Some description with `back ticks` 932 + */ 677 933 export const vModelWithBackticksInDescription = v.object({ 678 934 template: v.optional(v.string()) 679 935 }); ··· 692 948 }) 693 949 ]); 694 950 951 + /** 952 + * Model used to test deduplication strategy (unused) 953 + */ 695 954 export const vParameterSimpleParameterUnused = v.string(); 696 955 956 + /** 957 + * Model used to test deduplication strategy 958 + */ 697 959 export const vPostServiceWithEmptyTagResponse = v.string(); 698 960 961 + /** 962 + * Model used to test deduplication strategy 963 + */ 699 964 export const vPostServiceWithEmptyTagResponse2 = v.string(); 700 965 966 + /** 967 + * Model used to test deduplication strategy 968 + */ 701 969 export const vDeleteFooData = v.string(); 702 970 971 + /** 972 + * Model used to test deduplication strategy 973 + */ 703 974 export const vDeleteFooData2 = v.string(); 704 975 705 976 export const vSchemaWithFormRestrictedKeys = v.object({ ··· 724 995 }))) 725 996 }); 726 997 998 + /** 999 + * This schema was giving PascalCase transformations a hard time 1000 + */ 727 1001 export const vIoK8sApimachineryPkgApisMetaV1Preconditions = v.object({ 728 1002 resourceVersion: v.optional(v.string()), 729 1003 uid: v.optional(v.string()) 730 1004 }); 731 1005 1006 + /** 1007 + * This schema was giving PascalCase transformations a hard time 1008 + */ 732 1009 export const vIoK8sApimachineryPkgApisMetaV1DeleteOptions = v.object({ 733 1010 preconditions: v.optional(vIoK8sApimachineryPkgApisMetaV1Preconditions) 734 1011 }); ··· 786 1063 vModelWithReadOnlyAndWriteOnly 787 1064 ]); 788 1065 1066 + /** 1067 + * Success 1068 + */ 789 1069 export const vApiVVersionODataControllerCountResponse = vModelFromZendesk; 790 1070 1071 + /** 1072 + * Response is a simple number 1073 + */ 791 1074 export const vGetApiVbyApiVersionSimpleOperationResponse = v.number(); 792 1075 793 1076 export const vPostCallWithOptionalParamResponse = v.union([ ··· 795 1078 v.void() 796 1079 ]); 797 1080 1081 + /** 1082 + * Success 1083 + */ 798 1084 export const vCallWithNoContentResponseResponse = v.void(); 799 1085 800 1086 export const vCallWithResponseAndNoContentResponseResponse = v.union([ ··· 804 1090 805 1091 export const vDummyAResponse = v400; 806 1092 1093 + /** 1094 + * Success 1095 + */ 807 1096 export const vDummyBResponse = v.void(); 808 1097 809 1098 export const vCallWithResponseResponse = vImport; ··· 835 1124 836 1125 export const vUploadFileResponse = v.boolean(); 837 1126 1127 + /** 1128 + * Success 1129 + */ 838 1130 export const vFileResponseResponse = v.string(); 839 1131 1132 + /** 1133 + * Successful response 1134 + */ 840 1135 export const vComplexTypesResponse = v.array(vModelWithString); 841 1136 1137 + /** 1138 + * OK 1139 + */ 842 1140 export const vMultipartResponseResponse = v.object({ 843 1141 file: v.optional(v.string()), 844 1142 metadata: v.optional(v.object({ ··· 847 1145 })) 848 1146 }); 849 1147 1148 + /** 1149 + * Success 1150 + */ 850 1151 export const vComplexParamsResponse = vModelWithString; 851 1152 1153 + /** 1154 + * Successful response 1155 + */ 852 1156 export const vNonAsciiæøåÆøÅöôêÊ字符串Response = v.array(vNonAsciiStringæøåÆøÅöôêÊ字符串);
+304
packages/openapi-ts-tests/test/__snapshots__/3.0.x/plugins/zod/default/zod.gen.ts
··· 2 2 3 3 import { z } from 'zod'; 4 4 5 + /** 6 + * Model with number-only name 7 + */ 5 8 export const z400 = z.string(); 6 9 10 + /** 11 + * Testing multiline comments in string: First line 12 + * Second line 13 + * 14 + * Fourth line 15 + */ 7 16 export const zCamelCaseCommentWithBreaks = z.number().int(); 8 17 18 + /** 19 + * Testing multiline comments in string: First line 20 + * Second line 21 + * 22 + * Fourth line 23 + */ 9 24 export const zCommentWithBreaks = z.number().int(); 10 25 26 + /** 27 + * Testing backticks in string: `backticks` and ```multiple backticks``` should work 28 + */ 11 29 export const zCommentWithBackticks = z.number().int(); 12 30 31 + /** 32 + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work 33 + */ 13 34 export const zCommentWithBackticksAndQuotes = z.number().int(); 14 35 36 + /** 37 + * Testing slashes in string: \backwards\\\ and /forwards/// should work 38 + */ 15 39 export const zCommentWithSlashes = z.number().int(); 16 40 41 + /** 42 + * Testing expression placeholders in string: ${expression} should work 43 + */ 17 44 export const zCommentWithExpressionPlaceholders = z.number().int(); 18 45 46 + /** 47 + * Testing quotes in string: 'single quote''' and "double quotes""" should work 48 + */ 19 49 export const zCommentWithQuotes = z.number().int(); 20 50 51 + /** 52 + * Testing reserved characters in string: * inline * and ** inline ** should work 53 + */ 21 54 export const zCommentWithReservedCharacters = z.number().int(); 22 55 56 + /** 57 + * This is a simple number 58 + */ 23 59 export const zSimpleInteger = z.number().int(); 24 60 61 + /** 62 + * This is a simple boolean 63 + */ 25 64 export const zSimpleBoolean = z.boolean(); 26 65 66 + /** 67 + * This is a simple string 68 + */ 27 69 export const zSimpleString = z.string(); 28 70 71 + /** 72 + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) 73 + */ 29 74 export const zNonAsciiStringæøåÆøÅöôêÊ字符串 = z.string(); 30 75 76 + /** 77 + * This is a simple file 78 + */ 31 79 export const zSimpleFile = z.string(); 32 80 81 + /** 82 + * This is a model with one string property 83 + */ 33 84 export const zModelWithString = z.object({ 34 85 prop: z.string().optional() 35 86 }); 36 87 88 + /** 89 + * This is a simple reference 90 + */ 37 91 export const zSimpleReference = zModelWithString; 38 92 93 + /** 94 + * This is a simple string 95 + */ 39 96 export const zSimpleStringWithPattern = z.union([ 40 97 z.string().max(64).regex(/^[a-zA-Z0-9_]*$/), 41 98 z.null() 42 99 ]); 43 100 101 + /** 102 + * This is a simple enum with strings 103 + */ 44 104 export const zEnumWithStrings = z.enum([ 45 105 'Success', 46 106 'Warning', ··· 57 117 '' 58 118 ]); 59 119 120 + /** 121 + * This is a simple enum with numbers 122 + */ 60 123 export const zEnumWithNumbers = z.unknown(); 61 124 125 + /** 126 + * Success=1,Warning=2,Error=3 127 + */ 62 128 export const zEnumFromDescription = z.number(); 63 129 130 + /** 131 + * This is a simple enum with numbers 132 + */ 64 133 export const zEnumWithExtensions = z.unknown(); 65 134 66 135 export const zEnumWithXEnumNames = z.unknown(); 67 136 137 + /** 138 + * This is a simple array with numbers 139 + */ 68 140 export const zArrayWithNumbers = z.array(z.number().int()); 69 141 142 + /** 143 + * This is a simple array with booleans 144 + */ 70 145 export const zArrayWithBooleans = z.array(z.boolean()); 71 146 147 + /** 148 + * This is a simple array with strings 149 + */ 72 150 export const zArrayWithStrings = z.array(z.string()).default(['test']); 73 151 152 + /** 153 + * This is a simple array with references 154 + */ 74 155 export const zArrayWithReferences = z.array(zModelWithString); 75 156 157 + /** 158 + * This is a simple array containing an array 159 + */ 76 160 export const zArrayWithArray = z.array(z.array(zModelWithString)); 77 161 162 + /** 163 + * This is a simple array with properties 164 + */ 78 165 export const zArrayWithProperties = z.array(z.object({ 79 166 '16x16': zCamelCaseCommentWithBreaks.optional(), 80 167 bar: z.string().optional() 81 168 })); 82 169 170 + /** 171 + * This is a simple array with any of properties 172 + */ 83 173 export const zArrayWithAnyOfProperties = z.array(z.unknown()); 84 174 85 175 export const zAnyOfAnyAndNull = z.object({ 86 176 data: z.unknown().optional() 87 177 }); 88 178 179 + /** 180 + * This is a simple array with any of properties 181 + */ 89 182 export const zAnyOfArrays = z.object({ 90 183 results: z.array(z.unknown()).optional() 91 184 }); 92 185 186 + /** 187 + * This is a string dictionary 188 + */ 93 189 export const zDictionaryWithString = z.object({}); 94 190 95 191 export const zDictionaryWithPropertiesAndAdditionalProperties = z.object({ ··· 97 193 bar: z.boolean().optional() 98 194 }); 99 195 196 + /** 197 + * This is a string reference 198 + */ 100 199 export const zDictionaryWithReference = z.object({}); 101 200 201 + /** 202 + * This is a complex dictionary 203 + */ 102 204 export const zDictionaryWithArray = z.object({}); 103 205 206 + /** 207 + * This is a string dictionary 208 + */ 104 209 export const zDictionaryWithDictionary = z.object({}); 105 210 211 + /** 212 + * This is a complex dictionary 213 + */ 106 214 export const zDictionaryWithProperties = z.object({}); 107 215 216 + /** 217 + * This is a model with one number property 218 + */ 108 219 export const zModelWithInteger = z.object({ 109 220 prop: z.number().int().optional() 110 221 }); 111 222 223 + /** 224 + * This is a model with one boolean property 225 + */ 112 226 export const zModelWithBoolean = z.object({ 113 227 prop: z.boolean().optional() 114 228 }); 115 229 230 + /** 231 + * This is a model with one string property 232 + */ 116 233 export const zModelWithStringError = z.object({ 117 234 prop: z.string().optional() 118 235 }); 119 236 237 + /** 238 + * `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) 239 + */ 120 240 export const zModelFromZendesk = z.string(); 121 241 242 + /** 243 + * This is a model with one string property 244 + */ 122 245 export const zModelWithNullableString = z.object({ 123 246 nullableProp1: z.union([ 124 247 z.string(), ··· 144 267 ]).optional() 145 268 }); 146 269 270 + /** 271 + * This is a model with one enum 272 + */ 147 273 export const zModelWithEnum = z.object({ 148 274 'foo_bar-enum': z.enum([ 149 275 'Success', ··· 162 288 bool: z.unknown().optional() 163 289 }); 164 290 291 + /** 292 + * This is a model with one enum with escaped name 293 + */ 165 294 export const zModelWithEnumWithHyphen = z.object({ 166 295 'foo-bar-baz-qux': z.enum([ 167 296 '3.0' 168 297 ]).optional() 169 298 }); 170 299 300 + /** 301 + * This is a model with one enum 302 + */ 171 303 export const zModelWithEnumFromDescription = z.object({ 172 304 test: z.number().int().optional() 173 305 }); 174 306 307 + /** 308 + * This is a model with nested enums 309 + */ 175 310 export const zModelWithNestedEnums = z.object({ 176 311 dictionaryWithEnum: z.object({}).optional(), 177 312 dictionaryWithEnumFromDescription: z.object({}).optional(), ··· 189 324 ]).optional() 190 325 }); 191 326 327 + /** 328 + * This is a model with one nested property 329 + */ 192 330 export const zModelWithProperties = z.object({ 193 331 required: z.string(), 194 332 requiredAndReadOnly: z.string().readonly(), ··· 207 345 '@namespace.integer': z.number().int().readonly().optional() 208 346 }); 209 347 348 + /** 349 + * This is a model with one property containing a reference 350 + */ 210 351 export const zModelWithReference = z.object({ 211 352 prop: zModelWithProperties.optional() 212 353 }); ··· 217 358 baz: z.string() 218 359 }); 219 360 361 + /** 362 + * This is a model with one property containing an array 363 + */ 220 364 export const zModelWithArrayReadOnlyAndWriteOnly = z.object({ 221 365 prop: z.array(zModelWithReadOnlyAndWriteOnly).optional(), 222 366 propWithFile: z.array(z.string()).optional(), 223 367 propWithNumber: z.array(z.number()).optional() 224 368 }); 225 369 370 + /** 371 + * This is a model with one property containing an array 372 + */ 226 373 export const zModelWithArray = z.object({ 227 374 prop: z.array(zModelWithString).optional(), 228 375 propWithFile: z.array(z.string()).optional(), 229 376 propWithNumber: z.array(z.number()).optional() 230 377 }); 231 378 379 + /** 380 + * This is a model with one property containing a dictionary 381 + */ 232 382 export const zModelWithDictionary = z.object({ 233 383 prop: z.object({}).optional() 234 384 }); 235 385 386 + /** 387 + * This is a deprecated model with a deprecated property 388 + * @deprecated 389 + */ 236 390 export const zDeprecatedModel = z.object({ 237 391 prop: z.string().optional() 238 392 }); 239 393 394 + /** 395 + * This is a model with one property containing a circular reference 396 + */ 240 397 export const zModelWithCircularReference: z.AnyZodObject = z.object({ 241 398 prop: z.lazy(() => { 242 399 return zModelWithCircularReference; 243 400 }).optional() 244 401 }); 245 402 403 + /** 404 + * This is a model with one property with a 'one of' relationship 405 + */ 246 406 export const zCompositionWithOneOf = z.object({ 247 407 propA: z.union([ 248 408 zModelWithString, ··· 252 412 ]).optional() 253 413 }); 254 414 415 + /** 416 + * This is a model with one property with a 'one of' relationship where the options are not $ref 417 + */ 255 418 export const zCompositionWithOneOfAnonymous = z.object({ 256 419 propA: z.union([ 257 420 z.object({ ··· 262 425 ]).optional() 263 426 }); 264 427 428 + /** 429 + * Circle 430 + */ 265 431 export const zModelCircle = z.object({ 266 432 kind: z.string(), 267 433 radius: z.number().optional() 268 434 }); 269 435 436 + /** 437 + * Square 438 + */ 270 439 export const zModelSquare = z.object({ 271 440 kind: z.string(), 272 441 sideLength: z.number().optional() 273 442 }); 274 443 444 + /** 445 + * This is a model with one property with a 'one of' relationship where the options are not $ref 446 + */ 275 447 export const zCompositionWithOneOfDiscriminator = z.union([ 276 448 z.object({ 277 449 kind: z.literal('circle') ··· 281 453 }).and(zModelSquare) 282 454 ]); 283 455 456 + /** 457 + * This is a model with one property with a 'any of' relationship 458 + */ 284 459 export const zCompositionWithAnyOf = z.object({ 285 460 propA: z.union([ 286 461 zModelWithString, ··· 290 465 ]).optional() 291 466 }); 292 467 468 + /** 469 + * This is a model with one property with a 'any of' relationship where the options are not $ref 470 + */ 293 471 export const zCompositionWithAnyOfAnonymous = z.object({ 294 472 propA: z.union([ 295 473 z.object({ ··· 300 478 ]).optional() 301 479 }); 302 480 481 + /** 482 + * This is a model with nested 'any of' property with a type null 483 + */ 303 484 export const zCompositionWithNestedAnyAndTypeNull = z.object({ 304 485 propA: z.union([ 305 486 z.array(z.union([ ··· 322 503 'ConstValue' 323 504 ]); 324 505 506 + /** 507 + * This is a model with one property with a 'any of' relationship where the options are not $ref 508 + */ 325 509 export const zCompositionWithNestedAnyOfAndNull = z.object({ 326 510 propA: z.union([ 327 511 z.array(z.unknown()), ··· 329 513 ]).optional() 330 514 }); 331 515 516 + /** 517 + * This is a model with one property with a 'one of' relationship 518 + */ 332 519 export const zCompositionWithOneOfAndNullable = z.object({ 333 520 propA: z.union([ 334 521 z.object({ ··· 341 528 ]).optional() 342 529 }); 343 530 531 + /** 532 + * This is a model that contains a simple dictionary within composition 533 + */ 344 534 export const zCompositionWithOneOfAndSimpleDictionary = z.object({ 345 535 propA: z.union([ 346 536 z.boolean(), ··· 348 538 ]).optional() 349 539 }); 350 540 541 + /** 542 + * This is a model that contains a dictionary of simple arrays within composition 543 + */ 351 544 export const zCompositionWithOneOfAndSimpleArrayDictionary = z.object({ 352 545 propA: z.union([ 353 546 z.boolean(), ··· 355 548 ]).optional() 356 549 }); 357 550 551 + /** 552 + * This is a model that contains a dictionary of complex arrays (composited) within composition 553 + */ 358 554 export const zCompositionWithOneOfAndComplexArrayDictionary = z.object({ 359 555 propA: z.union([ 360 556 z.boolean(), ··· 362 558 ]).optional() 363 559 }); 364 560 561 + /** 562 + * This is a model with one property with a 'all of' relationship 563 + */ 365 564 export const zCompositionWithAllOfAndNullable = z.object({ 366 565 propA: z.union([ 367 566 z.object({ ··· 371 570 ]).optional() 372 571 }); 373 572 573 + /** 574 + * This is a model with one property with a 'any of' relationship 575 + */ 374 576 export const zCompositionWithAnyOfAndNullable = z.object({ 375 577 propA: z.union([ 376 578 z.object({ ··· 383 585 ]).optional() 384 586 }); 385 587 588 + /** 589 + * This is a base model with two simple optional properties 590 + */ 386 591 export const zCompositionBaseModel = z.object({ 387 592 firstName: z.string().optional(), 388 593 lastname: z.string().optional() 389 594 }); 390 595 596 + /** 597 + * This is a model that extends the base model 598 + */ 391 599 export const zCompositionExtendedModel = zCompositionBaseModel.and(z.object({ 392 600 age: z.number(), 393 601 firstName: z.string(), 394 602 lastname: z.string() 395 603 })); 396 604 605 + /** 606 + * This is a model with one nested property 607 + */ 397 608 export const zModelWithNestedProperties = z.object({ 398 609 first: z.union([ 399 610 z.object({ ··· 411 622 ]).readonly() 412 623 }); 413 624 625 + /** 626 + * This is a model with duplicated properties 627 + */ 414 628 export const zModelWithDuplicateProperties = z.object({ 415 629 prop: zModelWithString.optional() 416 630 }); 417 631 632 + /** 633 + * This is a model with ordered properties 634 + */ 418 635 export const zModelWithOrderedProperties = z.object({ 419 636 zebra: z.string().optional(), 420 637 apple: z.string().optional(), 421 638 hawaii: z.string().optional() 422 639 }); 423 640 641 + /** 642 + * This is a model with duplicated imports 643 + */ 424 644 export const zModelWithDuplicateImports = z.object({ 425 645 propA: zModelWithString.optional(), 426 646 propB: zModelWithString.optional(), 427 647 propC: zModelWithString.optional() 428 648 }); 429 649 650 + /** 651 + * This is a model that extends another model 652 + */ 430 653 export const zModelThatExtends = zModelWithString.and(z.object({ 431 654 propExtendsA: z.string().optional(), 432 655 propExtendsB: zModelWithString.optional() 433 656 })); 434 657 658 + /** 659 + * This is a model that extends another model 660 + */ 435 661 export const zModelThatExtendsExtends = zModelWithString.and(zModelThatExtends).and(z.object({ 436 662 propExtendsC: z.string().optional(), 437 663 propExtendsD: zModelWithString.optional() 438 664 })); 439 665 666 + /** 667 + * This is a model that contains a some patterns 668 + */ 440 669 export const zModelWithPattern = z.object({ 441 670 key: z.string().max(64).regex(/^[a-zA-Z0-9_]*$/), 442 671 name: z.string().max(255), ··· 467 696 sort: z.array(z.string()).optional() 468 697 }); 469 698 699 + /** 700 + * This is a free-form object without additionalProperties. 701 + */ 470 702 export const zFreeFormObjectWithoutAdditionalProperties = z.object({}); 471 703 704 + /** 705 + * This is a free-form object with additionalProperties: true. 706 + */ 472 707 export const zFreeFormObjectWithAdditionalPropertiesEqTrue = z.object({}); 473 708 709 + /** 710 + * This is a free-form object with additionalProperties: {}. 711 + */ 474 712 export const zFreeFormObjectWithAdditionalPropertiesEqEmptyObject = z.object({}); 475 713 476 714 export const zModelWithConst = z.object({ ··· 484 722 ]).optional() 485 723 }); 486 724 725 + /** 726 + * This is a model with one property and additionalProperties: true 727 + */ 487 728 export const zModelWithAdditionalPropertiesEqTrue = z.object({ 488 729 prop: z.string().optional() 489 730 }); ··· 495 736 ]).optional() 496 737 }); 497 738 739 + /** 740 + * This is a reusable parameter 741 + */ 498 742 export const zSimpleParameter = z.unknown(); 499 743 500 744 export const zCompositionWithOneOfAndProperties = z.intersection(z.union([ ··· 512 756 qux: z.number().int().gte(0) 513 757 })); 514 758 759 + /** 760 + * An object that can be null 761 + */ 515 762 export const zNullableObject = z.union([ 516 763 z.object({ 517 764 foo: z.string().optional() ··· 519 766 z.null() 520 767 ]).default(null); 521 768 769 + /** 770 + * Some % character 771 + */ 522 772 export const zCharactersInDescription = z.string(); 523 773 524 774 export const zModelWithNullableObject = z.object({ ··· 595 845 value: z.unknown().optional() 596 846 }); 597 847 848 + /** 849 + * Some description with `back ticks` 850 + */ 598 851 export const zModelWithBackticksInDescription = z.object({ 599 852 template: z.string().optional() 600 853 }); ··· 610 863 qux: z.number().int().gte(0) 611 864 })); 612 865 866 + /** 867 + * Model used to test deduplication strategy (unused) 868 + */ 613 869 export const zParameterSimpleParameterUnused = z.string(); 614 870 871 + /** 872 + * Model used to test deduplication strategy 873 + */ 615 874 export const zPostServiceWithEmptyTagResponse = z.string(); 616 875 876 + /** 877 + * Model used to test deduplication strategy 878 + */ 617 879 export const zPostServiceWithEmptyTagResponse2 = z.string(); 618 880 881 + /** 882 + * Model used to test deduplication strategy 883 + */ 619 884 export const zDeleteFooData = z.string(); 620 885 886 + /** 887 + * Model used to test deduplication strategy 888 + */ 621 889 export const zDeleteFooData2 = z.string(); 622 890 891 + /** 892 + * Model with restricted keyword name 893 + */ 623 894 export const zImport = z.string(); 624 895 625 896 export const zSchemaWithFormRestrictedKeys = z.object({ ··· 644 915 })).optional() 645 916 }); 646 917 918 + /** 919 + * This schema was giving PascalCase transformations a hard time 920 + */ 647 921 export const zIoK8sApimachineryPkgApisMetaV1Preconditions = z.object({ 648 922 resourceVersion: z.string().optional(), 649 923 uid: z.string().optional() 650 924 }); 651 925 926 + /** 927 + * This schema was giving PascalCase transformations a hard time 928 + */ 652 929 export const zIoK8sApimachineryPkgApisMetaV1DeleteOptions = z.object({ 653 930 preconditions: zIoK8sApimachineryPkgApisMetaV1Preconditions.optional() 654 931 }); ··· 700 977 zModelWithReadOnlyAndWriteOnly 701 978 ]); 702 979 980 + /** 981 + * Success 982 + */ 703 983 export const zApiVVersionODataControllerCountResponse = zModelFromZendesk; 704 984 985 + /** 986 + * Response is a simple number 987 + */ 705 988 export const zGetApiVbyApiVersionSimpleOperationResponse = z.number(); 706 989 707 990 export const zPostCallWithOptionalParamResponse = z.union([ ··· 709 992 z.void() 710 993 ]); 711 994 995 + /** 996 + * Success 997 + */ 712 998 export const zCallWithNoContentResponseResponse = z.void(); 713 999 714 1000 export const zCallWithResponseAndNoContentResponseResponse = z.union([ ··· 718 1004 719 1005 export const zDummyAResponse = z400; 720 1006 1007 + /** 1008 + * Success 1009 + */ 721 1010 export const zDummyBResponse = z.void(); 722 1011 723 1012 export const zCallWithResponseResponse = zImport; ··· 746 1035 747 1036 export const zUploadFileResponse = z.boolean(); 748 1037 1038 + /** 1039 + * Success 1040 + */ 749 1041 export const zFileResponseResponse = z.string(); 750 1042 1043 + /** 1044 + * Successful response 1045 + */ 751 1046 export const zComplexTypesResponse = z.array(zModelWithString); 752 1047 1048 + /** 1049 + * OK 1050 + */ 753 1051 export const zMultipartResponseResponse = z.object({ 754 1052 file: z.string().optional(), 755 1053 metadata: z.object({ ··· 758 1056 }).optional() 759 1057 }); 760 1058 1059 + /** 1060 + * Success 1061 + */ 761 1062 export const zComplexParamsResponse = zModelWithString; 762 1063 1064 + /** 1065 + * Successful response 1066 + */ 763 1067 export const zNonAsciiæøåÆøÅöôêÊ字符串Response = z.array(zNonAsciiStringæøåÆøÅöôêÊ字符串);
+24
packages/openapi-ts-tests/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/base-url-false/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 478 481 * This is a model with one property with a 'any of' relationship where the options are not $ref 479 482 */ 480 483 export type CompositionWithNestedAnyOfAndNull = { 484 + /** 485 + * Scopes 486 + */ 481 487 propA?: Array<_3eNum1Период | ConstValue> | null; 482 488 }; 483 489 ··· 666 672 }; 667 673 668 674 export type FileReadable = { 675 + /** 676 + * Id 677 + */ 669 678 readonly id?: string; 679 + /** 680 + * Updated at 681 + */ 670 682 readonly updated_at?: string; 683 + /** 684 + * Created at 685 + */ 671 686 readonly created_at?: string; 687 + /** 688 + * Mime 689 + */ 672 690 mime: string; 691 + /** 692 + * File 693 + */ 673 694 readonly file?: string; 674 695 }; 675 696 676 697 export type FileWritable = { 698 + /** 699 + * Mime 700 + */ 677 701 mime: string; 678 702 }; 679 703
+24
packages/openapi-ts-tests/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/base-url-number/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 478 481 * This is a model with one property with a 'any of' relationship where the options are not $ref 479 482 */ 480 483 export type CompositionWithNestedAnyOfAndNull = { 484 + /** 485 + * Scopes 486 + */ 481 487 propA?: Array<_3eNum1Период | ConstValue> | null; 482 488 }; 483 489 ··· 666 672 }; 667 673 668 674 export type FileReadable = { 675 + /** 676 + * Id 677 + */ 669 678 readonly id?: string; 679 + /** 680 + * Updated at 681 + */ 670 682 readonly updated_at?: string; 683 + /** 684 + * Created at 685 + */ 671 686 readonly created_at?: string; 687 + /** 688 + * Mime 689 + */ 672 690 mime: string; 691 + /** 692 + * File 693 + */ 673 694 readonly file?: string; 674 695 }; 675 696 676 697 export type FileWritable = { 698 + /** 699 + * Mime 700 + */ 677 701 mime: string; 678 702 }; 679 703
+24
packages/openapi-ts-tests/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/base-url-strict/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 478 481 * This is a model with one property with a 'any of' relationship where the options are not $ref 479 482 */ 480 483 export type CompositionWithNestedAnyOfAndNull = { 484 + /** 485 + * Scopes 486 + */ 481 487 propA?: Array<_3eNum1Период | ConstValue> | null; 482 488 }; 483 489 ··· 666 672 }; 667 673 668 674 export type FileReadable = { 675 + /** 676 + * Id 677 + */ 669 678 readonly id?: string; 679 + /** 680 + * Updated at 681 + */ 670 682 readonly updated_at?: string; 683 + /** 684 + * Created at 685 + */ 671 686 readonly created_at?: string; 687 + /** 688 + * Mime 689 + */ 672 690 mime: string; 691 + /** 692 + * File 693 + */ 673 694 readonly file?: string; 674 695 }; 675 696 676 697 export type FileWritable = { 698 + /** 699 + * Mime 700 + */ 677 701 mime: string; 678 702 }; 679 703
+24
packages/openapi-ts-tests/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/base-url-string/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 478 481 * This is a model with one property with a 'any of' relationship where the options are not $ref 479 482 */ 480 483 export type CompositionWithNestedAnyOfAndNull = { 484 + /** 485 + * Scopes 486 + */ 481 487 propA?: Array<_3eNum1Период | ConstValue> | null; 482 488 }; 483 489 ··· 666 672 }; 667 673 668 674 export type FileReadable = { 675 + /** 676 + * Id 677 + */ 669 678 readonly id?: string; 679 + /** 680 + * Updated at 681 + */ 670 682 readonly updated_at?: string; 683 + /** 684 + * Created at 685 + */ 671 686 readonly created_at?: string; 687 + /** 688 + * Mime 689 + */ 672 690 mime: string; 691 + /** 692 + * File 693 + */ 673 694 readonly file?: string; 674 695 }; 675 696 676 697 export type FileWritable = { 698 + /** 699 + * Mime 700 + */ 677 701 mime: string; 678 702 }; 679 703
+24
packages/openapi-ts-tests/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/bundle/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 478 481 * This is a model with one property with a 'any of' relationship where the options are not $ref 479 482 */ 480 483 export type CompositionWithNestedAnyOfAndNull = { 484 + /** 485 + * Scopes 486 + */ 481 487 propA?: Array<_3eNum1Период | ConstValue> | null; 482 488 }; 483 489 ··· 666 672 }; 667 673 668 674 export type FileReadable = { 675 + /** 676 + * Id 677 + */ 669 678 readonly id?: string; 679 + /** 680 + * Updated at 681 + */ 670 682 readonly updated_at?: string; 683 + /** 684 + * Created at 685 + */ 671 686 readonly created_at?: string; 687 + /** 688 + * Mime 689 + */ 672 690 mime: string; 691 + /** 692 + * File 693 + */ 673 694 readonly file?: string; 674 695 }; 675 696 676 697 export type FileWritable = { 698 + /** 699 + * Mime 700 + */ 677 701 mime: string; 678 702 }; 679 703
+24
packages/openapi-ts-tests/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/default/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 478 481 * This is a model with one property with a 'any of' relationship where the options are not $ref 479 482 */ 480 483 export type CompositionWithNestedAnyOfAndNull = { 484 + /** 485 + * Scopes 486 + */ 481 487 propA?: Array<_3eNum1Период | ConstValue> | null; 482 488 }; 483 489 ··· 666 672 }; 667 673 668 674 export type FileReadable = { 675 + /** 676 + * Id 677 + */ 669 678 readonly id?: string; 679 + /** 680 + * Updated at 681 + */ 670 682 readonly updated_at?: string; 683 + /** 684 + * Created at 685 + */ 671 686 readonly created_at?: string; 687 + /** 688 + * Mime 689 + */ 672 690 mime: string; 691 + /** 692 + * File 693 + */ 673 694 readonly file?: string; 674 695 }; 675 696 676 697 export type FileWritable = { 698 + /** 699 + * Mime 700 + */ 677 701 mime: string; 678 702 }; 679 703
+24
packages/openapi-ts-tests/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/sdk-client-optional/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 478 481 * This is a model with one property with a 'any of' relationship where the options are not $ref 479 482 */ 480 483 export type CompositionWithNestedAnyOfAndNull = { 484 + /** 485 + * Scopes 486 + */ 481 487 propA?: Array<_3eNum1Период | ConstValue> | null; 482 488 }; 483 489 ··· 666 672 }; 667 673 668 674 export type FileReadable = { 675 + /** 676 + * Id 677 + */ 669 678 readonly id?: string; 679 + /** 680 + * Updated at 681 + */ 670 682 readonly updated_at?: string; 683 + /** 684 + * Created at 685 + */ 671 686 readonly created_at?: string; 687 + /** 688 + * Mime 689 + */ 672 690 mime: string; 691 + /** 692 + * File 693 + */ 673 694 readonly file?: string; 674 695 }; 675 696 676 697 export type FileWritable = { 698 + /** 699 + * Mime 700 + */ 677 701 mime: string; 678 702 }; 679 703
+24
packages/openapi-ts-tests/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/sdk-client-required/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 478 481 * This is a model with one property with a 'any of' relationship where the options are not $ref 479 482 */ 480 483 export type CompositionWithNestedAnyOfAndNull = { 484 + /** 485 + * Scopes 486 + */ 481 487 propA?: Array<_3eNum1Период | ConstValue> | null; 482 488 }; 483 489 ··· 666 672 }; 667 673 668 674 export type FileReadable = { 675 + /** 676 + * Id 677 + */ 669 678 readonly id?: string; 679 + /** 680 + * Updated at 681 + */ 670 682 readonly updated_at?: string; 683 + /** 684 + * Created at 685 + */ 671 686 readonly created_at?: string; 687 + /** 688 + * Mime 689 + */ 672 690 mime: string; 691 + /** 692 + * File 693 + */ 673 694 readonly file?: string; 674 695 }; 675 696 676 697 export type FileWritable = { 698 + /** 699 + * Mime 700 + */ 677 701 mime: string; 678 702 }; 679 703
+24
packages/openapi-ts-tests/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/tsconfig-nodenext-sdk/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 478 481 * This is a model with one property with a 'any of' relationship where the options are not $ref 479 482 */ 480 483 export type CompositionWithNestedAnyOfAndNull = { 484 + /** 485 + * Scopes 486 + */ 481 487 propA?: Array<_3eNum1Период | ConstValue> | null; 482 488 }; 483 489 ··· 666 672 }; 667 673 668 674 export type FileReadable = { 675 + /** 676 + * Id 677 + */ 669 678 readonly id?: string; 679 + /** 680 + * Updated at 681 + */ 670 682 readonly updated_at?: string; 683 + /** 684 + * Created at 685 + */ 671 686 readonly created_at?: string; 687 + /** 688 + * Mime 689 + */ 672 690 mime: string; 691 + /** 692 + * File 693 + */ 673 694 readonly file?: string; 674 695 }; 675 696 676 697 export type FileWritable = { 698 + /** 699 + * Mime 700 + */ 677 701 mime: string; 678 702 }; 679 703
+24
packages/openapi-ts-tests/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/base-url-false/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 478 481 * This is a model with one property with a 'any of' relationship where the options are not $ref 479 482 */ 480 483 export type CompositionWithNestedAnyOfAndNull = { 484 + /** 485 + * Scopes 486 + */ 481 487 propA?: Array<_3eNum1Период | ConstValue> | null; 482 488 }; 483 489 ··· 666 672 }; 667 673 668 674 export type FileReadable = { 675 + /** 676 + * Id 677 + */ 669 678 readonly id?: string; 679 + /** 680 + * Updated at 681 + */ 670 682 readonly updated_at?: string; 683 + /** 684 + * Created at 685 + */ 671 686 readonly created_at?: string; 687 + /** 688 + * Mime 689 + */ 672 690 mime: string; 691 + /** 692 + * File 693 + */ 673 694 readonly file?: string; 674 695 }; 675 696 676 697 export type FileWritable = { 698 + /** 699 + * Mime 700 + */ 677 701 mime: string; 678 702 }; 679 703
+24
packages/openapi-ts-tests/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/base-url-number/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 478 481 * This is a model with one property with a 'any of' relationship where the options are not $ref 479 482 */ 480 483 export type CompositionWithNestedAnyOfAndNull = { 484 + /** 485 + * Scopes 486 + */ 481 487 propA?: Array<_3eNum1Период | ConstValue> | null; 482 488 }; 483 489 ··· 666 672 }; 667 673 668 674 export type FileReadable = { 675 + /** 676 + * Id 677 + */ 669 678 readonly id?: string; 679 + /** 680 + * Updated at 681 + */ 670 682 readonly updated_at?: string; 683 + /** 684 + * Created at 685 + */ 671 686 readonly created_at?: string; 687 + /** 688 + * Mime 689 + */ 672 690 mime: string; 691 + /** 692 + * File 693 + */ 673 694 readonly file?: string; 674 695 }; 675 696 676 697 export type FileWritable = { 698 + /** 699 + * Mime 700 + */ 677 701 mime: string; 678 702 }; 679 703
+24
packages/openapi-ts-tests/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/base-url-strict/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 478 481 * This is a model with one property with a 'any of' relationship where the options are not $ref 479 482 */ 480 483 export type CompositionWithNestedAnyOfAndNull = { 484 + /** 485 + * Scopes 486 + */ 481 487 propA?: Array<_3eNum1Период | ConstValue> | null; 482 488 }; 483 489 ··· 666 672 }; 667 673 668 674 export type FileReadable = { 675 + /** 676 + * Id 677 + */ 669 678 readonly id?: string; 679 + /** 680 + * Updated at 681 + */ 670 682 readonly updated_at?: string; 683 + /** 684 + * Created at 685 + */ 671 686 readonly created_at?: string; 687 + /** 688 + * Mime 689 + */ 672 690 mime: string; 691 + /** 692 + * File 693 + */ 673 694 readonly file?: string; 674 695 }; 675 696 676 697 export type FileWritable = { 698 + /** 699 + * Mime 700 + */ 677 701 mime: string; 678 702 }; 679 703
+24
packages/openapi-ts-tests/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/base-url-string/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 478 481 * This is a model with one property with a 'any of' relationship where the options are not $ref 479 482 */ 480 483 export type CompositionWithNestedAnyOfAndNull = { 484 + /** 485 + * Scopes 486 + */ 481 487 propA?: Array<_3eNum1Период | ConstValue> | null; 482 488 }; 483 489 ··· 666 672 }; 667 673 668 674 export type FileReadable = { 675 + /** 676 + * Id 677 + */ 669 678 readonly id?: string; 679 + /** 680 + * Updated at 681 + */ 670 682 readonly updated_at?: string; 683 + /** 684 + * Created at 685 + */ 671 686 readonly created_at?: string; 687 + /** 688 + * Mime 689 + */ 672 690 mime: string; 691 + /** 692 + * File 693 + */ 673 694 readonly file?: string; 674 695 }; 675 696 676 697 export type FileWritable = { 698 + /** 699 + * Mime 700 + */ 677 701 mime: string; 678 702 }; 679 703
+24
packages/openapi-ts-tests/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/bundle/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 478 481 * This is a model with one property with a 'any of' relationship where the options are not $ref 479 482 */ 480 483 export type CompositionWithNestedAnyOfAndNull = { 484 + /** 485 + * Scopes 486 + */ 481 487 propA?: Array<_3eNum1Период | ConstValue> | null; 482 488 }; 483 489 ··· 666 672 }; 667 673 668 674 export type FileReadable = { 675 + /** 676 + * Id 677 + */ 669 678 readonly id?: string; 679 + /** 680 + * Updated at 681 + */ 670 682 readonly updated_at?: string; 683 + /** 684 + * Created at 685 + */ 671 686 readonly created_at?: string; 687 + /** 688 + * Mime 689 + */ 672 690 mime: string; 691 + /** 692 + * File 693 + */ 673 694 readonly file?: string; 674 695 }; 675 696 676 697 export type FileWritable = { 698 + /** 699 + * Mime 700 + */ 677 701 mime: string; 678 702 }; 679 703
+24
packages/openapi-ts-tests/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/default/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 478 481 * This is a model with one property with a 'any of' relationship where the options are not $ref 479 482 */ 480 483 export type CompositionWithNestedAnyOfAndNull = { 484 + /** 485 + * Scopes 486 + */ 481 487 propA?: Array<_3eNum1Период | ConstValue> | null; 482 488 }; 483 489 ··· 666 672 }; 667 673 668 674 export type FileReadable = { 675 + /** 676 + * Id 677 + */ 669 678 readonly id?: string; 679 + /** 680 + * Updated at 681 + */ 670 682 readonly updated_at?: string; 683 + /** 684 + * Created at 685 + */ 671 686 readonly created_at?: string; 687 + /** 688 + * Mime 689 + */ 672 690 mime: string; 691 + /** 692 + * File 693 + */ 673 694 readonly file?: string; 674 695 }; 675 696 676 697 export type FileWritable = { 698 + /** 699 + * Mime 700 + */ 677 701 mime: string; 678 702 }; 679 703
+24
packages/openapi-ts-tests/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/sdk-client-optional/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 478 481 * This is a model with one property with a 'any of' relationship where the options are not $ref 479 482 */ 480 483 export type CompositionWithNestedAnyOfAndNull = { 484 + /** 485 + * Scopes 486 + */ 481 487 propA?: Array<_3eNum1Период | ConstValue> | null; 482 488 }; 483 489 ··· 666 672 }; 667 673 668 674 export type FileReadable = { 675 + /** 676 + * Id 677 + */ 669 678 readonly id?: string; 679 + /** 680 + * Updated at 681 + */ 670 682 readonly updated_at?: string; 683 + /** 684 + * Created at 685 + */ 671 686 readonly created_at?: string; 687 + /** 688 + * Mime 689 + */ 672 690 mime: string; 691 + /** 692 + * File 693 + */ 673 694 readonly file?: string; 674 695 }; 675 696 676 697 export type FileWritable = { 698 + /** 699 + * Mime 700 + */ 677 701 mime: string; 678 702 }; 679 703
+24
packages/openapi-ts-tests/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/sdk-client-required/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 478 481 * This is a model with one property with a 'any of' relationship where the options are not $ref 479 482 */ 480 483 export type CompositionWithNestedAnyOfAndNull = { 484 + /** 485 + * Scopes 486 + */ 481 487 propA?: Array<_3eNum1Период | ConstValue> | null; 482 488 }; 483 489 ··· 666 672 }; 667 673 668 674 export type FileReadable = { 675 + /** 676 + * Id 677 + */ 669 678 readonly id?: string; 679 + /** 680 + * Updated at 681 + */ 670 682 readonly updated_at?: string; 683 + /** 684 + * Created at 685 + */ 671 686 readonly created_at?: string; 687 + /** 688 + * Mime 689 + */ 672 690 mime: string; 691 + /** 692 + * File 693 + */ 673 694 readonly file?: string; 674 695 }; 675 696 676 697 export type FileWritable = { 698 + /** 699 + * Mime 700 + */ 677 701 mime: string; 678 702 }; 679 703
+24
packages/openapi-ts-tests/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/tsconfig-nodenext-sdk/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 478 481 * This is a model with one property with a 'any of' relationship where the options are not $ref 479 482 */ 480 483 export type CompositionWithNestedAnyOfAndNull = { 484 + /** 485 + * Scopes 486 + */ 481 487 propA?: Array<_3eNum1Период | ConstValue> | null; 482 488 }; 483 489 ··· 666 672 }; 667 673 668 674 export type FileReadable = { 675 + /** 676 + * Id 677 + */ 669 678 readonly id?: string; 679 + /** 680 + * Updated at 681 + */ 670 682 readonly updated_at?: string; 683 + /** 684 + * Created at 685 + */ 671 686 readonly created_at?: string; 687 + /** 688 + * Mime 689 + */ 672 690 mime: string; 691 + /** 692 + * File 693 + */ 673 694 readonly file?: string; 674 695 }; 675 696 676 697 export type FileWritable = { 698 + /** 699 + * Mime 700 + */ 677 701 mime: string; 678 702 }; 679 703
+24
packages/openapi-ts-tests/test/__snapshots__/3.1.x/clients/@hey-api/client-next/base-url-false/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 478 481 * This is a model with one property with a 'any of' relationship where the options are not $ref 479 482 */ 480 483 export type CompositionWithNestedAnyOfAndNull = { 484 + /** 485 + * Scopes 486 + */ 481 487 propA?: Array<_3eNum1Период | ConstValue> | null; 482 488 }; 483 489 ··· 666 672 }; 667 673 668 674 export type FileReadable = { 675 + /** 676 + * Id 677 + */ 669 678 readonly id?: string; 679 + /** 680 + * Updated at 681 + */ 670 682 readonly updated_at?: string; 683 + /** 684 + * Created at 685 + */ 671 686 readonly created_at?: string; 687 + /** 688 + * Mime 689 + */ 672 690 mime: string; 691 + /** 692 + * File 693 + */ 673 694 readonly file?: string; 674 695 }; 675 696 676 697 export type FileWritable = { 698 + /** 699 + * Mime 700 + */ 677 701 mime: string; 678 702 }; 679 703
+24
packages/openapi-ts-tests/test/__snapshots__/3.1.x/clients/@hey-api/client-next/base-url-number/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 478 481 * This is a model with one property with a 'any of' relationship where the options are not $ref 479 482 */ 480 483 export type CompositionWithNestedAnyOfAndNull = { 484 + /** 485 + * Scopes 486 + */ 481 487 propA?: Array<_3eNum1Период | ConstValue> | null; 482 488 }; 483 489 ··· 666 672 }; 667 673 668 674 export type FileReadable = { 675 + /** 676 + * Id 677 + */ 669 678 readonly id?: string; 679 + /** 680 + * Updated at 681 + */ 670 682 readonly updated_at?: string; 683 + /** 684 + * Created at 685 + */ 671 686 readonly created_at?: string; 687 + /** 688 + * Mime 689 + */ 672 690 mime: string; 691 + /** 692 + * File 693 + */ 673 694 readonly file?: string; 674 695 }; 675 696 676 697 export type FileWritable = { 698 + /** 699 + * Mime 700 + */ 677 701 mime: string; 678 702 }; 679 703
+24
packages/openapi-ts-tests/test/__snapshots__/3.1.x/clients/@hey-api/client-next/base-url-strict/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 478 481 * This is a model with one property with a 'any of' relationship where the options are not $ref 479 482 */ 480 483 export type CompositionWithNestedAnyOfAndNull = { 484 + /** 485 + * Scopes 486 + */ 481 487 propA?: Array<_3eNum1Период | ConstValue> | null; 482 488 }; 483 489 ··· 666 672 }; 667 673 668 674 export type FileReadable = { 675 + /** 676 + * Id 677 + */ 669 678 readonly id?: string; 679 + /** 680 + * Updated at 681 + */ 670 682 readonly updated_at?: string; 683 + /** 684 + * Created at 685 + */ 671 686 readonly created_at?: string; 687 + /** 688 + * Mime 689 + */ 672 690 mime: string; 691 + /** 692 + * File 693 + */ 673 694 readonly file?: string; 674 695 }; 675 696 676 697 export type FileWritable = { 698 + /** 699 + * Mime 700 + */ 677 701 mime: string; 678 702 }; 679 703
+24
packages/openapi-ts-tests/test/__snapshots__/3.1.x/clients/@hey-api/client-next/base-url-string/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 478 481 * This is a model with one property with a 'any of' relationship where the options are not $ref 479 482 */ 480 483 export type CompositionWithNestedAnyOfAndNull = { 484 + /** 485 + * Scopes 486 + */ 481 487 propA?: Array<_3eNum1Период | ConstValue> | null; 482 488 }; 483 489 ··· 666 672 }; 667 673 668 674 export type FileReadable = { 675 + /** 676 + * Id 677 + */ 669 678 readonly id?: string; 679 + /** 680 + * Updated at 681 + */ 670 682 readonly updated_at?: string; 683 + /** 684 + * Created at 685 + */ 671 686 readonly created_at?: string; 687 + /** 688 + * Mime 689 + */ 672 690 mime: string; 691 + /** 692 + * File 693 + */ 673 694 readonly file?: string; 674 695 }; 675 696 676 697 export type FileWritable = { 698 + /** 699 + * Mime 700 + */ 677 701 mime: string; 678 702 }; 679 703
+24
packages/openapi-ts-tests/test/__snapshots__/3.1.x/clients/@hey-api/client-next/bundle/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 478 481 * This is a model with one property with a 'any of' relationship where the options are not $ref 479 482 */ 480 483 export type CompositionWithNestedAnyOfAndNull = { 484 + /** 485 + * Scopes 486 + */ 481 487 propA?: Array<_3eNum1Период | ConstValue> | null; 482 488 }; 483 489 ··· 666 672 }; 667 673 668 674 export type FileReadable = { 675 + /** 676 + * Id 677 + */ 669 678 readonly id?: string; 679 + /** 680 + * Updated at 681 + */ 670 682 readonly updated_at?: string; 683 + /** 684 + * Created at 685 + */ 671 686 readonly created_at?: string; 687 + /** 688 + * Mime 689 + */ 672 690 mime: string; 691 + /** 692 + * File 693 + */ 673 694 readonly file?: string; 674 695 }; 675 696 676 697 export type FileWritable = { 698 + /** 699 + * Mime 700 + */ 677 701 mime: string; 678 702 }; 679 703
+24
packages/openapi-ts-tests/test/__snapshots__/3.1.x/clients/@hey-api/client-next/default/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 478 481 * This is a model with one property with a 'any of' relationship where the options are not $ref 479 482 */ 480 483 export type CompositionWithNestedAnyOfAndNull = { 484 + /** 485 + * Scopes 486 + */ 481 487 propA?: Array<_3eNum1Период | ConstValue> | null; 482 488 }; 483 489 ··· 666 672 }; 667 673 668 674 export type FileReadable = { 675 + /** 676 + * Id 677 + */ 669 678 readonly id?: string; 679 + /** 680 + * Updated at 681 + */ 670 682 readonly updated_at?: string; 683 + /** 684 + * Created at 685 + */ 671 686 readonly created_at?: string; 687 + /** 688 + * Mime 689 + */ 672 690 mime: string; 691 + /** 692 + * File 693 + */ 673 694 readonly file?: string; 674 695 }; 675 696 676 697 export type FileWritable = { 698 + /** 699 + * Mime 700 + */ 677 701 mime: string; 678 702 }; 679 703
+24
packages/openapi-ts-tests/test/__snapshots__/3.1.x/clients/@hey-api/client-next/sdk-client-optional/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 478 481 * This is a model with one property with a 'any of' relationship where the options are not $ref 479 482 */ 480 483 export type CompositionWithNestedAnyOfAndNull = { 484 + /** 485 + * Scopes 486 + */ 481 487 propA?: Array<_3eNum1Период | ConstValue> | null; 482 488 }; 483 489 ··· 666 672 }; 667 673 668 674 export type FileReadable = { 675 + /** 676 + * Id 677 + */ 669 678 readonly id?: string; 679 + /** 680 + * Updated at 681 + */ 670 682 readonly updated_at?: string; 683 + /** 684 + * Created at 685 + */ 671 686 readonly created_at?: string; 687 + /** 688 + * Mime 689 + */ 672 690 mime: string; 691 + /** 692 + * File 693 + */ 673 694 readonly file?: string; 674 695 }; 675 696 676 697 export type FileWritable = { 698 + /** 699 + * Mime 700 + */ 677 701 mime: string; 678 702 }; 679 703
+24
packages/openapi-ts-tests/test/__snapshots__/3.1.x/clients/@hey-api/client-next/sdk-client-required/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 478 481 * This is a model with one property with a 'any of' relationship where the options are not $ref 479 482 */ 480 483 export type CompositionWithNestedAnyOfAndNull = { 484 + /** 485 + * Scopes 486 + */ 481 487 propA?: Array<_3eNum1Период | ConstValue> | null; 482 488 }; 483 489 ··· 666 672 }; 667 673 668 674 export type FileReadable = { 675 + /** 676 + * Id 677 + */ 669 678 readonly id?: string; 679 + /** 680 + * Updated at 681 + */ 670 682 readonly updated_at?: string; 683 + /** 684 + * Created at 685 + */ 671 686 readonly created_at?: string; 687 + /** 688 + * Mime 689 + */ 672 690 mime: string; 691 + /** 692 + * File 693 + */ 673 694 readonly file?: string; 674 695 }; 675 696 676 697 export type FileWritable = { 698 + /** 699 + * Mime 700 + */ 677 701 mime: string; 678 702 }; 679 703
+24
packages/openapi-ts-tests/test/__snapshots__/3.1.x/clients/@hey-api/client-next/tsconfig-nodenext-sdk/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 478 481 * This is a model with one property with a 'any of' relationship where the options are not $ref 479 482 */ 480 483 export type CompositionWithNestedAnyOfAndNull = { 484 + /** 485 + * Scopes 486 + */ 481 487 propA?: Array<_3eNum1Период | ConstValue> | null; 482 488 }; 483 489 ··· 666 672 }; 667 673 668 674 export type FileReadable = { 675 + /** 676 + * Id 677 + */ 669 678 readonly id?: string; 679 + /** 680 + * Updated at 681 + */ 670 682 readonly updated_at?: string; 683 + /** 684 + * Created at 685 + */ 671 686 readonly created_at?: string; 687 + /** 688 + * Mime 689 + */ 672 690 mime: string; 691 + /** 692 + * File 693 + */ 673 694 readonly file?: string; 674 695 }; 675 696 676 697 export type FileWritable = { 698 + /** 699 + * Mime 700 + */ 677 701 mime: string; 678 702 }; 679 703
+24
packages/openapi-ts-tests/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/base-url-false/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 478 481 * This is a model with one property with a 'any of' relationship where the options are not $ref 479 482 */ 480 483 export type CompositionWithNestedAnyOfAndNull = { 484 + /** 485 + * Scopes 486 + */ 481 487 propA?: Array<_3eNum1Период | ConstValue> | null; 482 488 }; 483 489 ··· 666 672 }; 667 673 668 674 export type FileReadable = { 675 + /** 676 + * Id 677 + */ 669 678 readonly id?: string; 679 + /** 680 + * Updated at 681 + */ 670 682 readonly updated_at?: string; 683 + /** 684 + * Created at 685 + */ 671 686 readonly created_at?: string; 687 + /** 688 + * Mime 689 + */ 672 690 mime: string; 691 + /** 692 + * File 693 + */ 673 694 readonly file?: string; 674 695 }; 675 696 676 697 export type FileWritable = { 698 + /** 699 + * Mime 700 + */ 677 701 mime: string; 678 702 }; 679 703
+24
packages/openapi-ts-tests/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/base-url-number/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 478 481 * This is a model with one property with a 'any of' relationship where the options are not $ref 479 482 */ 480 483 export type CompositionWithNestedAnyOfAndNull = { 484 + /** 485 + * Scopes 486 + */ 481 487 propA?: Array<_3eNum1Период | ConstValue> | null; 482 488 }; 483 489 ··· 666 672 }; 667 673 668 674 export type FileReadable = { 675 + /** 676 + * Id 677 + */ 669 678 readonly id?: string; 679 + /** 680 + * Updated at 681 + */ 670 682 readonly updated_at?: string; 683 + /** 684 + * Created at 685 + */ 671 686 readonly created_at?: string; 687 + /** 688 + * Mime 689 + */ 672 690 mime: string; 691 + /** 692 + * File 693 + */ 673 694 readonly file?: string; 674 695 }; 675 696 676 697 export type FileWritable = { 698 + /** 699 + * Mime 700 + */ 677 701 mime: string; 678 702 }; 679 703
+24
packages/openapi-ts-tests/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/base-url-strict/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 478 481 * This is a model with one property with a 'any of' relationship where the options are not $ref 479 482 */ 480 483 export type CompositionWithNestedAnyOfAndNull = { 484 + /** 485 + * Scopes 486 + */ 481 487 propA?: Array<_3eNum1Период | ConstValue> | null; 482 488 }; 483 489 ··· 666 672 }; 667 673 668 674 export type FileReadable = { 675 + /** 676 + * Id 677 + */ 669 678 readonly id?: string; 679 + /** 680 + * Updated at 681 + */ 670 682 readonly updated_at?: string; 683 + /** 684 + * Created at 685 + */ 671 686 readonly created_at?: string; 687 + /** 688 + * Mime 689 + */ 672 690 mime: string; 691 + /** 692 + * File 693 + */ 673 694 readonly file?: string; 674 695 }; 675 696 676 697 export type FileWritable = { 698 + /** 699 + * Mime 700 + */ 677 701 mime: string; 678 702 }; 679 703
+24
packages/openapi-ts-tests/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/base-url-string/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 478 481 * This is a model with one property with a 'any of' relationship where the options are not $ref 479 482 */ 480 483 export type CompositionWithNestedAnyOfAndNull = { 484 + /** 485 + * Scopes 486 + */ 481 487 propA?: Array<_3eNum1Период | ConstValue> | null; 482 488 }; 483 489 ··· 666 672 }; 667 673 668 674 export type FileReadable = { 675 + /** 676 + * Id 677 + */ 669 678 readonly id?: string; 679 + /** 680 + * Updated at 681 + */ 670 682 readonly updated_at?: string; 683 + /** 684 + * Created at 685 + */ 671 686 readonly created_at?: string; 687 + /** 688 + * Mime 689 + */ 672 690 mime: string; 691 + /** 692 + * File 693 + */ 673 694 readonly file?: string; 674 695 }; 675 696 676 697 export type FileWritable = { 698 + /** 699 + * Mime 700 + */ 677 701 mime: string; 678 702 }; 679 703
+24
packages/openapi-ts-tests/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/default/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 478 481 * This is a model with one property with a 'any of' relationship where the options are not $ref 479 482 */ 480 483 export type CompositionWithNestedAnyOfAndNull = { 484 + /** 485 + * Scopes 486 + */ 481 487 propA?: Array<_3eNum1Период | ConstValue> | null; 482 488 }; 483 489 ··· 666 672 }; 667 673 668 674 export type FileReadable = { 675 + /** 676 + * Id 677 + */ 669 678 readonly id?: string; 679 + /** 680 + * Updated at 681 + */ 670 682 readonly updated_at?: string; 683 + /** 684 + * Created at 685 + */ 671 686 readonly created_at?: string; 687 + /** 688 + * Mime 689 + */ 672 690 mime: string; 691 + /** 692 + * File 693 + */ 673 694 readonly file?: string; 674 695 }; 675 696 676 697 export type FileWritable = { 698 + /** 699 + * Mime 700 + */ 677 701 mime: string; 678 702 }; 679 703
+24
packages/openapi-ts-tests/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/sdk-client-optional/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 478 481 * This is a model with one property with a 'any of' relationship where the options are not $ref 479 482 */ 480 483 export type CompositionWithNestedAnyOfAndNull = { 484 + /** 485 + * Scopes 486 + */ 481 487 propA?: Array<_3eNum1Период | ConstValue> | null; 482 488 }; 483 489 ··· 666 672 }; 667 673 668 674 export type FileReadable = { 675 + /** 676 + * Id 677 + */ 669 678 readonly id?: string; 679 + /** 680 + * Updated at 681 + */ 670 682 readonly updated_at?: string; 683 + /** 684 + * Created at 685 + */ 671 686 readonly created_at?: string; 687 + /** 688 + * Mime 689 + */ 672 690 mime: string; 691 + /** 692 + * File 693 + */ 673 694 readonly file?: string; 674 695 }; 675 696 676 697 export type FileWritable = { 698 + /** 699 + * Mime 700 + */ 677 701 mime: string; 678 702 }; 679 703
+24
packages/openapi-ts-tests/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/sdk-client-required/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 478 481 * This is a model with one property with a 'any of' relationship where the options are not $ref 479 482 */ 480 483 export type CompositionWithNestedAnyOfAndNull = { 484 + /** 485 + * Scopes 486 + */ 481 487 propA?: Array<_3eNum1Период | ConstValue> | null; 482 488 }; 483 489 ··· 666 672 }; 667 673 668 674 export type FileReadable = { 675 + /** 676 + * Id 677 + */ 669 678 readonly id?: string; 679 + /** 680 + * Updated at 681 + */ 670 682 readonly updated_at?: string; 683 + /** 684 + * Created at 685 + */ 671 686 readonly created_at?: string; 687 + /** 688 + * Mime 689 + */ 672 690 mime: string; 691 + /** 692 + * File 693 + */ 673 694 readonly file?: string; 674 695 }; 675 696 676 697 export type FileWritable = { 698 + /** 699 + * Mime 700 + */ 677 701 mime: string; 678 702 }; 679 703
+24
packages/openapi-ts-tests/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/tsconfig-nodenext-sdk/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 478 481 * This is a model with one property with a 'any of' relationship where the options are not $ref 479 482 */ 480 483 export type CompositionWithNestedAnyOfAndNull = { 484 + /** 485 + * Scopes 486 + */ 481 487 propA?: Array<_3eNum1Период | ConstValue> | null; 482 488 }; 483 489 ··· 666 672 }; 667 673 668 674 export type FileReadable = { 675 + /** 676 + * Id 677 + */ 669 678 readonly id?: string; 679 + /** 680 + * Updated at 681 + */ 670 682 readonly updated_at?: string; 683 + /** 684 + * Created at 685 + */ 671 686 readonly created_at?: string; 687 + /** 688 + * Mime 689 + */ 672 690 mime: string; 691 + /** 692 + * File 693 + */ 673 694 readonly file?: string; 674 695 }; 675 696 676 697 export type FileWritable = { 698 + /** 699 + * Mime 700 + */ 677 701 mime: string; 678 702 }; 679 703
+24
packages/openapi-ts-tests/test/__snapshots__/3.1.x/clients/client-custom/base-url-false/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 478 481 * This is a model with one property with a 'any of' relationship where the options are not $ref 479 482 */ 480 483 export type CompositionWithNestedAnyOfAndNull = { 484 + /** 485 + * Scopes 486 + */ 481 487 propA?: Array<_3eNum1Период | ConstValue> | null; 482 488 }; 483 489 ··· 666 672 }; 667 673 668 674 export type FileReadable = { 675 + /** 676 + * Id 677 + */ 669 678 readonly id?: string; 679 + /** 680 + * Updated at 681 + */ 670 682 readonly updated_at?: string; 683 + /** 684 + * Created at 685 + */ 671 686 readonly created_at?: string; 687 + /** 688 + * Mime 689 + */ 672 690 mime: string; 691 + /** 692 + * File 693 + */ 673 694 readonly file?: string; 674 695 }; 675 696 676 697 export type FileWritable = { 698 + /** 699 + * Mime 700 + */ 677 701 mime: string; 678 702 }; 679 703
+24
packages/openapi-ts-tests/test/__snapshots__/3.1.x/clients/client-custom/base-url-number/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 478 481 * This is a model with one property with a 'any of' relationship where the options are not $ref 479 482 */ 480 483 export type CompositionWithNestedAnyOfAndNull = { 484 + /** 485 + * Scopes 486 + */ 481 487 propA?: Array<_3eNum1Период | ConstValue> | null; 482 488 }; 483 489 ··· 666 672 }; 667 673 668 674 export type FileReadable = { 675 + /** 676 + * Id 677 + */ 669 678 readonly id?: string; 679 + /** 680 + * Updated at 681 + */ 670 682 readonly updated_at?: string; 683 + /** 684 + * Created at 685 + */ 671 686 readonly created_at?: string; 687 + /** 688 + * Mime 689 + */ 672 690 mime: string; 691 + /** 692 + * File 693 + */ 673 694 readonly file?: string; 674 695 }; 675 696 676 697 export type FileWritable = { 698 + /** 699 + * Mime 700 + */ 677 701 mime: string; 678 702 }; 679 703
+24
packages/openapi-ts-tests/test/__snapshots__/3.1.x/clients/client-custom/base-url-strict/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 478 481 * This is a model with one property with a 'any of' relationship where the options are not $ref 479 482 */ 480 483 export type CompositionWithNestedAnyOfAndNull = { 484 + /** 485 + * Scopes 486 + */ 481 487 propA?: Array<_3eNum1Период | ConstValue> | null; 482 488 }; 483 489 ··· 666 672 }; 667 673 668 674 export type FileReadable = { 675 + /** 676 + * Id 677 + */ 669 678 readonly id?: string; 679 + /** 680 + * Updated at 681 + */ 670 682 readonly updated_at?: string; 683 + /** 684 + * Created at 685 + */ 671 686 readonly created_at?: string; 687 + /** 688 + * Mime 689 + */ 672 690 mime: string; 691 + /** 692 + * File 693 + */ 673 694 readonly file?: string; 674 695 }; 675 696 676 697 export type FileWritable = { 698 + /** 699 + * Mime 700 + */ 677 701 mime: string; 678 702 }; 679 703
+24
packages/openapi-ts-tests/test/__snapshots__/3.1.x/clients/client-custom/base-url-string/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 478 481 * This is a model with one property with a 'any of' relationship where the options are not $ref 479 482 */ 480 483 export type CompositionWithNestedAnyOfAndNull = { 484 + /** 485 + * Scopes 486 + */ 481 487 propA?: Array<_3eNum1Период | ConstValue> | null; 482 488 }; 483 489 ··· 666 672 }; 667 673 668 674 export type FileReadable = { 675 + /** 676 + * Id 677 + */ 669 678 readonly id?: string; 679 + /** 680 + * Updated at 681 + */ 670 682 readonly updated_at?: string; 683 + /** 684 + * Created at 685 + */ 671 686 readonly created_at?: string; 687 + /** 688 + * Mime 689 + */ 672 690 mime: string; 691 + /** 692 + * File 693 + */ 673 694 readonly file?: string; 674 695 }; 675 696 676 697 export type FileWritable = { 698 + /** 699 + * Mime 700 + */ 677 701 mime: string; 678 702 }; 679 703
+24
packages/openapi-ts-tests/test/__snapshots__/3.1.x/clients/client-custom/bundle/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 478 481 * This is a model with one property with a 'any of' relationship where the options are not $ref 479 482 */ 480 483 export type CompositionWithNestedAnyOfAndNull = { 484 + /** 485 + * Scopes 486 + */ 481 487 propA?: Array<_3eNum1Период | ConstValue> | null; 482 488 }; 483 489 ··· 666 672 }; 667 673 668 674 export type FileReadable = { 675 + /** 676 + * Id 677 + */ 669 678 readonly id?: string; 679 + /** 680 + * Updated at 681 + */ 670 682 readonly updated_at?: string; 683 + /** 684 + * Created at 685 + */ 671 686 readonly created_at?: string; 687 + /** 688 + * Mime 689 + */ 672 690 mime: string; 691 + /** 692 + * File 693 + */ 673 694 readonly file?: string; 674 695 }; 675 696 676 697 export type FileWritable = { 698 + /** 699 + * Mime 700 + */ 677 701 mime: string; 678 702 }; 679 703
+24
packages/openapi-ts-tests/test/__snapshots__/3.1.x/clients/client-custom/default/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 478 481 * This is a model with one property with a 'any of' relationship where the options are not $ref 479 482 */ 480 483 export type CompositionWithNestedAnyOfAndNull = { 484 + /** 485 + * Scopes 486 + */ 481 487 propA?: Array<_3eNum1Период | ConstValue> | null; 482 488 }; 483 489 ··· 666 672 }; 667 673 668 674 export type FileReadable = { 675 + /** 676 + * Id 677 + */ 669 678 readonly id?: string; 679 + /** 680 + * Updated at 681 + */ 670 682 readonly updated_at?: string; 683 + /** 684 + * Created at 685 + */ 671 686 readonly created_at?: string; 687 + /** 688 + * Mime 689 + */ 672 690 mime: string; 691 + /** 692 + * File 693 + */ 673 694 readonly file?: string; 674 695 }; 675 696 676 697 export type FileWritable = { 698 + /** 699 + * Mime 700 + */ 677 701 mime: string; 678 702 }; 679 703
+24
packages/openapi-ts-tests/test/__snapshots__/3.1.x/clients/client-custom/sdk-client-optional/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 478 481 * This is a model with one property with a 'any of' relationship where the options are not $ref 479 482 */ 480 483 export type CompositionWithNestedAnyOfAndNull = { 484 + /** 485 + * Scopes 486 + */ 481 487 propA?: Array<_3eNum1Период | ConstValue> | null; 482 488 }; 483 489 ··· 666 672 }; 667 673 668 674 export type FileReadable = { 675 + /** 676 + * Id 677 + */ 669 678 readonly id?: string; 679 + /** 680 + * Updated at 681 + */ 670 682 readonly updated_at?: string; 683 + /** 684 + * Created at 685 + */ 671 686 readonly created_at?: string; 687 + /** 688 + * Mime 689 + */ 672 690 mime: string; 691 + /** 692 + * File 693 + */ 673 694 readonly file?: string; 674 695 }; 675 696 676 697 export type FileWritable = { 698 + /** 699 + * Mime 700 + */ 677 701 mime: string; 678 702 }; 679 703
+24
packages/openapi-ts-tests/test/__snapshots__/3.1.x/clients/client-custom/sdk-client-required/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 478 481 * This is a model with one property with a 'any of' relationship where the options are not $ref 479 482 */ 480 483 export type CompositionWithNestedAnyOfAndNull = { 484 + /** 485 + * Scopes 486 + */ 481 487 propA?: Array<_3eNum1Период | ConstValue> | null; 482 488 }; 483 489 ··· 666 672 }; 667 673 668 674 export type FileReadable = { 675 + /** 676 + * Id 677 + */ 669 678 readonly id?: string; 679 + /** 680 + * Updated at 681 + */ 670 682 readonly updated_at?: string; 683 + /** 684 + * Created at 685 + */ 671 686 readonly created_at?: string; 687 + /** 688 + * Mime 689 + */ 672 690 mime: string; 691 + /** 692 + * File 693 + */ 673 694 readonly file?: string; 674 695 }; 675 696 676 697 export type FileWritable = { 698 + /** 699 + * Mime 700 + */ 677 701 mime: string; 678 702 }; 679 703
+24
packages/openapi-ts-tests/test/__snapshots__/3.1.x/clients/my-client/base-url-false/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 478 481 * This is a model with one property with a 'any of' relationship where the options are not $ref 479 482 */ 480 483 export type CompositionWithNestedAnyOfAndNull = { 484 + /** 485 + * Scopes 486 + */ 481 487 propA?: Array<_3eNum1Период | ConstValue> | null; 482 488 }; 483 489 ··· 666 672 }; 667 673 668 674 export type FileReadable = { 675 + /** 676 + * Id 677 + */ 669 678 readonly id?: string; 679 + /** 680 + * Updated at 681 + */ 670 682 readonly updated_at?: string; 683 + /** 684 + * Created at 685 + */ 671 686 readonly created_at?: string; 687 + /** 688 + * Mime 689 + */ 672 690 mime: string; 691 + /** 692 + * File 693 + */ 673 694 readonly file?: string; 674 695 }; 675 696 676 697 export type FileWritable = { 698 + /** 699 + * Mime 700 + */ 677 701 mime: string; 678 702 }; 679 703
+24
packages/openapi-ts-tests/test/__snapshots__/3.1.x/clients/my-client/base-url-number/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 478 481 * This is a model with one property with a 'any of' relationship where the options are not $ref 479 482 */ 480 483 export type CompositionWithNestedAnyOfAndNull = { 484 + /** 485 + * Scopes 486 + */ 481 487 propA?: Array<_3eNum1Период | ConstValue> | null; 482 488 }; 483 489 ··· 666 672 }; 667 673 668 674 export type FileReadable = { 675 + /** 676 + * Id 677 + */ 669 678 readonly id?: string; 679 + /** 680 + * Updated at 681 + */ 670 682 readonly updated_at?: string; 683 + /** 684 + * Created at 685 + */ 671 686 readonly created_at?: string; 687 + /** 688 + * Mime 689 + */ 672 690 mime: string; 691 + /** 692 + * File 693 + */ 673 694 readonly file?: string; 674 695 }; 675 696 676 697 export type FileWritable = { 698 + /** 699 + * Mime 700 + */ 677 701 mime: string; 678 702 }; 679 703
+24
packages/openapi-ts-tests/test/__snapshots__/3.1.x/clients/my-client/base-url-strict/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 478 481 * This is a model with one property with a 'any of' relationship where the options are not $ref 479 482 */ 480 483 export type CompositionWithNestedAnyOfAndNull = { 484 + /** 485 + * Scopes 486 + */ 481 487 propA?: Array<_3eNum1Период | ConstValue> | null; 482 488 }; 483 489 ··· 666 672 }; 667 673 668 674 export type FileReadable = { 675 + /** 676 + * Id 677 + */ 669 678 readonly id?: string; 679 + /** 680 + * Updated at 681 + */ 670 682 readonly updated_at?: string; 683 + /** 684 + * Created at 685 + */ 671 686 readonly created_at?: string; 687 + /** 688 + * Mime 689 + */ 672 690 mime: string; 691 + /** 692 + * File 693 + */ 673 694 readonly file?: string; 674 695 }; 675 696 676 697 export type FileWritable = { 698 + /** 699 + * Mime 700 + */ 677 701 mime: string; 678 702 }; 679 703
+24
packages/openapi-ts-tests/test/__snapshots__/3.1.x/clients/my-client/base-url-string/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 478 481 * This is a model with one property with a 'any of' relationship where the options are not $ref 479 482 */ 480 483 export type CompositionWithNestedAnyOfAndNull = { 484 + /** 485 + * Scopes 486 + */ 481 487 propA?: Array<_3eNum1Период | ConstValue> | null; 482 488 }; 483 489 ··· 666 672 }; 667 673 668 674 export type FileReadable = { 675 + /** 676 + * Id 677 + */ 669 678 readonly id?: string; 679 + /** 680 + * Updated at 681 + */ 670 682 readonly updated_at?: string; 683 + /** 684 + * Created at 685 + */ 671 686 readonly created_at?: string; 687 + /** 688 + * Mime 689 + */ 672 690 mime: string; 691 + /** 692 + * File 693 + */ 673 694 readonly file?: string; 674 695 }; 675 696 676 697 export type FileWritable = { 698 + /** 699 + * Mime 700 + */ 677 701 mime: string; 678 702 }; 679 703
+24
packages/openapi-ts-tests/test/__snapshots__/3.1.x/clients/my-client/bundle/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 478 481 * This is a model with one property with a 'any of' relationship where the options are not $ref 479 482 */ 480 483 export type CompositionWithNestedAnyOfAndNull = { 484 + /** 485 + * Scopes 486 + */ 481 487 propA?: Array<_3eNum1Период | ConstValue> | null; 482 488 }; 483 489 ··· 666 672 }; 667 673 668 674 export type FileReadable = { 675 + /** 676 + * Id 677 + */ 669 678 readonly id?: string; 679 + /** 680 + * Updated at 681 + */ 670 682 readonly updated_at?: string; 683 + /** 684 + * Created at 685 + */ 671 686 readonly created_at?: string; 687 + /** 688 + * Mime 689 + */ 672 690 mime: string; 691 + /** 692 + * File 693 + */ 673 694 readonly file?: string; 674 695 }; 675 696 676 697 export type FileWritable = { 698 + /** 699 + * Mime 700 + */ 677 701 mime: string; 678 702 }; 679 703
+24
packages/openapi-ts-tests/test/__snapshots__/3.1.x/clients/my-client/default/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 478 481 * This is a model with one property with a 'any of' relationship where the options are not $ref 479 482 */ 480 483 export type CompositionWithNestedAnyOfAndNull = { 484 + /** 485 + * Scopes 486 + */ 481 487 propA?: Array<_3eNum1Период | ConstValue> | null; 482 488 }; 483 489 ··· 666 672 }; 667 673 668 674 export type FileReadable = { 675 + /** 676 + * Id 677 + */ 669 678 readonly id?: string; 679 + /** 680 + * Updated at 681 + */ 670 682 readonly updated_at?: string; 683 + /** 684 + * Created at 685 + */ 671 686 readonly created_at?: string; 687 + /** 688 + * Mime 689 + */ 672 690 mime: string; 691 + /** 692 + * File 693 + */ 673 694 readonly file?: string; 674 695 }; 675 696 676 697 export type FileWritable = { 698 + /** 699 + * Mime 700 + */ 677 701 mime: string; 678 702 }; 679 703
+24
packages/openapi-ts-tests/test/__snapshots__/3.1.x/clients/my-client/sdk-client-optional/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 478 481 * This is a model with one property with a 'any of' relationship where the options are not $ref 479 482 */ 480 483 export type CompositionWithNestedAnyOfAndNull = { 484 + /** 485 + * Scopes 486 + */ 481 487 propA?: Array<_3eNum1Период | ConstValue> | null; 482 488 }; 483 489 ··· 666 672 }; 667 673 668 674 export type FileReadable = { 675 + /** 676 + * Id 677 + */ 669 678 readonly id?: string; 679 + /** 680 + * Updated at 681 + */ 670 682 readonly updated_at?: string; 683 + /** 684 + * Created at 685 + */ 671 686 readonly created_at?: string; 687 + /** 688 + * Mime 689 + */ 672 690 mime: string; 691 + /** 692 + * File 693 + */ 673 694 readonly file?: string; 674 695 }; 675 696 676 697 export type FileWritable = { 698 + /** 699 + * Mime 700 + */ 677 701 mime: string; 678 702 }; 679 703
+24
packages/openapi-ts-tests/test/__snapshots__/3.1.x/clients/my-client/sdk-client-required/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 478 481 * This is a model with one property with a 'any of' relationship where the options are not $ref 479 482 */ 480 483 export type CompositionWithNestedAnyOfAndNull = { 484 + /** 485 + * Scopes 486 + */ 481 487 propA?: Array<_3eNum1Период | ConstValue> | null; 482 488 }; 483 489 ··· 666 672 }; 667 673 668 674 export type FileReadable = { 675 + /** 676 + * Id 677 + */ 669 678 readonly id?: string; 679 + /** 680 + * Updated at 681 + */ 670 682 readonly updated_at?: string; 683 + /** 684 + * Created at 685 + */ 671 686 readonly created_at?: string; 687 + /** 688 + * Mime 689 + */ 672 690 mime: string; 691 + /** 692 + * File 693 + */ 673 694 readonly file?: string; 674 695 }; 675 696 676 697 export type FileWritable = { 698 + /** 699 + * Mime 700 + */ 677 701 mime: string; 678 702 }; 679 703
+3
packages/openapi-ts-tests/test/__snapshots__/3.1.x/negative-property-names/types.gen.ts
··· 1 1 // This file is auto-generated by @hey-api/openapi-ts 2 2 3 + /** 4 + * Reaction Rollup 5 + */ 3 6 export type ReactionRollup = { 4 7 url: string; 5 8 total_count: number;
+24
packages/openapi-ts-tests/test/__snapshots__/3.1.x/plugins/@hey-api/sdk/default/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 478 481 * This is a model with one property with a 'any of' relationship where the options are not $ref 479 482 */ 480 483 export type CompositionWithNestedAnyOfAndNull = { 484 + /** 485 + * Scopes 486 + */ 481 487 propA?: Array<_3eNum1Период | ConstValue> | null; 482 488 }; 483 489 ··· 666 672 }; 667 673 668 674 export type FileReadable = { 675 + /** 676 + * Id 677 + */ 669 678 readonly id?: string; 679 + /** 680 + * Updated at 681 + */ 670 682 readonly updated_at?: string; 683 + /** 684 + * Created at 685 + */ 671 686 readonly created_at?: string; 687 + /** 688 + * Mime 689 + */ 672 690 mime: string; 691 + /** 692 + * File 693 + */ 673 694 readonly file?: string; 674 695 }; 675 696 676 697 export type FileWritable = { 698 + /** 699 + * Mime 700 + */ 677 701 mime: string; 678 702 }; 679 703
+24
packages/openapi-ts-tests/test/__snapshots__/3.1.x/plugins/@hey-api/sdk/throwOnError/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 478 481 * This is a model with one property with a 'any of' relationship where the options are not $ref 479 482 */ 480 483 export type CompositionWithNestedAnyOfAndNull = { 484 + /** 485 + * Scopes 486 + */ 481 487 propA?: Array<_3eNum1Период | ConstValue> | null; 482 488 }; 483 489 ··· 666 672 }; 667 673 668 674 export type FileReadable = { 675 + /** 676 + * Id 677 + */ 669 678 readonly id?: string; 679 + /** 680 + * Updated at 681 + */ 670 682 readonly updated_at?: string; 683 + /** 684 + * Created at 685 + */ 671 686 readonly created_at?: string; 687 + /** 688 + * Mime 689 + */ 672 690 mime: string; 691 + /** 692 + * File 693 + */ 673 694 readonly file?: string; 674 695 }; 675 696 676 697 export type FileWritable = { 698 + /** 699 + * Mime 700 + */ 677 701 mime: string; 678 702 }; 679 703
+3
packages/openapi-ts-tests/test/__snapshots__/3.1.x/plugins/@hey-api/transformers/type-format-valibot/valibot.gen.ts
··· 12 12 foo: v.pipe(v.number(), v.integer()) 13 13 }); 14 14 15 + /** 16 + * OK 17 + */ 15 18 export const vPostFooResponse = vFoo;
+3
packages/openapi-ts-tests/test/__snapshots__/3.1.x/plugins/@hey-api/transformers/type-format-zod/zod.gen.ts
··· 12 12 foo: z.number().int() 13 13 }); 14 14 15 + /** 16 + * OK 17 + */ 15 18 export const zPostFooResponse = zFoo;
+24
packages/openapi-ts-tests/test/__snapshots__/3.1.x/plugins/@tanstack/angular-query-experimental/asClass/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 478 481 * This is a model with one property with a 'any of' relationship where the options are not $ref 479 482 */ 480 483 export type CompositionWithNestedAnyOfAndNull = { 484 + /** 485 + * Scopes 486 + */ 481 487 propA?: Array<_3eNum1Период | ConstValue> | null; 482 488 }; 483 489 ··· 666 672 }; 667 673 668 674 export type FileReadable = { 675 + /** 676 + * Id 677 + */ 669 678 readonly id?: string; 679 + /** 680 + * Updated at 681 + */ 670 682 readonly updated_at?: string; 683 + /** 684 + * Created at 685 + */ 671 686 readonly created_at?: string; 687 + /** 688 + * Mime 689 + */ 672 690 mime: string; 691 + /** 692 + * File 693 + */ 673 694 readonly file?: string; 674 695 }; 675 696 676 697 export type FileWritable = { 698 + /** 699 + * Mime 700 + */ 677 701 mime: string; 678 702 }; 679 703
+24
packages/openapi-ts-tests/test/__snapshots__/3.1.x/plugins/@tanstack/angular-query-experimental/axios/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 478 481 * This is a model with one property with a 'any of' relationship where the options are not $ref 479 482 */ 480 483 export type CompositionWithNestedAnyOfAndNull = { 484 + /** 485 + * Scopes 486 + */ 481 487 propA?: Array<_3eNum1Период | ConstValue> | null; 482 488 }; 483 489 ··· 666 672 }; 667 673 668 674 export type FileReadable = { 675 + /** 676 + * Id 677 + */ 669 678 readonly id?: string; 679 + /** 680 + * Updated at 681 + */ 670 682 readonly updated_at?: string; 683 + /** 684 + * Created at 685 + */ 671 686 readonly created_at?: string; 687 + /** 688 + * Mime 689 + */ 672 690 mime: string; 691 + /** 692 + * File 693 + */ 673 694 readonly file?: string; 674 695 }; 675 696 676 697 export type FileWritable = { 698 + /** 699 + * Mime 700 + */ 677 701 mime: string; 678 702 }; 679 703
+24
packages/openapi-ts-tests/test/__snapshots__/3.1.x/plugins/@tanstack/angular-query-experimental/fetch/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 478 481 * This is a model with one property with a 'any of' relationship where the options are not $ref 479 482 */ 480 483 export type CompositionWithNestedAnyOfAndNull = { 484 + /** 485 + * Scopes 486 + */ 481 487 propA?: Array<_3eNum1Период | ConstValue> | null; 482 488 }; 483 489 ··· 666 672 }; 667 673 668 674 export type FileReadable = { 675 + /** 676 + * Id 677 + */ 669 678 readonly id?: string; 679 + /** 680 + * Updated at 681 + */ 670 682 readonly updated_at?: string; 683 + /** 684 + * Created at 685 + */ 671 686 readonly created_at?: string; 687 + /** 688 + * Mime 689 + */ 672 690 mime: string; 691 + /** 692 + * File 693 + */ 673 694 readonly file?: string; 674 695 }; 675 696 676 697 export type FileWritable = { 698 + /** 699 + * Mime 700 + */ 677 701 mime: string; 678 702 }; 679 703
+24
packages/openapi-ts-tests/test/__snapshots__/3.1.x/plugins/@tanstack/react-query/asClass/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 478 481 * This is a model with one property with a 'any of' relationship where the options are not $ref 479 482 */ 480 483 export type CompositionWithNestedAnyOfAndNull = { 484 + /** 485 + * Scopes 486 + */ 481 487 propA?: Array<_3eNum1Период | ConstValue> | null; 482 488 }; 483 489 ··· 666 672 }; 667 673 668 674 export type FileReadable = { 675 + /** 676 + * Id 677 + */ 669 678 readonly id?: string; 679 + /** 680 + * Updated at 681 + */ 670 682 readonly updated_at?: string; 683 + /** 684 + * Created at 685 + */ 671 686 readonly created_at?: string; 687 + /** 688 + * Mime 689 + */ 672 690 mime: string; 691 + /** 692 + * File 693 + */ 673 694 readonly file?: string; 674 695 }; 675 696 676 697 export type FileWritable = { 698 + /** 699 + * Mime 700 + */ 677 701 mime: string; 678 702 }; 679 703
+24
packages/openapi-ts-tests/test/__snapshots__/3.1.x/plugins/@tanstack/react-query/axios/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 478 481 * This is a model with one property with a 'any of' relationship where the options are not $ref 479 482 */ 480 483 export type CompositionWithNestedAnyOfAndNull = { 484 + /** 485 + * Scopes 486 + */ 481 487 propA?: Array<_3eNum1Период | ConstValue> | null; 482 488 }; 483 489 ··· 666 672 }; 667 673 668 674 export type FileReadable = { 675 + /** 676 + * Id 677 + */ 669 678 readonly id?: string; 679 + /** 680 + * Updated at 681 + */ 670 682 readonly updated_at?: string; 683 + /** 684 + * Created at 685 + */ 671 686 readonly created_at?: string; 687 + /** 688 + * Mime 689 + */ 672 690 mime: string; 691 + /** 692 + * File 693 + */ 673 694 readonly file?: string; 674 695 }; 675 696 676 697 export type FileWritable = { 698 + /** 699 + * Mime 700 + */ 677 701 mime: string; 678 702 }; 679 703
+24
packages/openapi-ts-tests/test/__snapshots__/3.1.x/plugins/@tanstack/react-query/fetch/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 478 481 * This is a model with one property with a 'any of' relationship where the options are not $ref 479 482 */ 480 483 export type CompositionWithNestedAnyOfAndNull = { 484 + /** 485 + * Scopes 486 + */ 481 487 propA?: Array<_3eNum1Период | ConstValue> | null; 482 488 }; 483 489 ··· 666 672 }; 667 673 668 674 export type FileReadable = { 675 + /** 676 + * Id 677 + */ 669 678 readonly id?: string; 679 + /** 680 + * Updated at 681 + */ 670 682 readonly updated_at?: string; 683 + /** 684 + * Created at 685 + */ 671 686 readonly created_at?: string; 687 + /** 688 + * Mime 689 + */ 672 690 mime: string; 691 + /** 692 + * File 693 + */ 673 694 readonly file?: string; 674 695 }; 675 696 676 697 export type FileWritable = { 698 + /** 699 + * Mime 700 + */ 677 701 mime: string; 678 702 }; 679 703
+24
packages/openapi-ts-tests/test/__snapshots__/3.1.x/plugins/@tanstack/solid-query/asClass/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 478 481 * This is a model with one property with a 'any of' relationship where the options are not $ref 479 482 */ 480 483 export type CompositionWithNestedAnyOfAndNull = { 484 + /** 485 + * Scopes 486 + */ 481 487 propA?: Array<_3eNum1Период | ConstValue> | null; 482 488 }; 483 489 ··· 666 672 }; 667 673 668 674 export type FileReadable = { 675 + /** 676 + * Id 677 + */ 669 678 readonly id?: string; 679 + /** 680 + * Updated at 681 + */ 670 682 readonly updated_at?: string; 683 + /** 684 + * Created at 685 + */ 671 686 readonly created_at?: string; 687 + /** 688 + * Mime 689 + */ 672 690 mime: string; 691 + /** 692 + * File 693 + */ 673 694 readonly file?: string; 674 695 }; 675 696 676 697 export type FileWritable = { 698 + /** 699 + * Mime 700 + */ 677 701 mime: string; 678 702 }; 679 703
+24
packages/openapi-ts-tests/test/__snapshots__/3.1.x/plugins/@tanstack/solid-query/axios/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 478 481 * This is a model with one property with a 'any of' relationship where the options are not $ref 479 482 */ 480 483 export type CompositionWithNestedAnyOfAndNull = { 484 + /** 485 + * Scopes 486 + */ 481 487 propA?: Array<_3eNum1Период | ConstValue> | null; 482 488 }; 483 489 ··· 666 672 }; 667 673 668 674 export type FileReadable = { 675 + /** 676 + * Id 677 + */ 669 678 readonly id?: string; 679 + /** 680 + * Updated at 681 + */ 670 682 readonly updated_at?: string; 683 + /** 684 + * Created at 685 + */ 671 686 readonly created_at?: string; 687 + /** 688 + * Mime 689 + */ 672 690 mime: string; 691 + /** 692 + * File 693 + */ 673 694 readonly file?: string; 674 695 }; 675 696 676 697 export type FileWritable = { 698 + /** 699 + * Mime 700 + */ 677 701 mime: string; 678 702 }; 679 703
+24
packages/openapi-ts-tests/test/__snapshots__/3.1.x/plugins/@tanstack/solid-query/fetch/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 478 481 * This is a model with one property with a 'any of' relationship where the options are not $ref 479 482 */ 480 483 export type CompositionWithNestedAnyOfAndNull = { 484 + /** 485 + * Scopes 486 + */ 481 487 propA?: Array<_3eNum1Период | ConstValue> | null; 482 488 }; 483 489 ··· 666 672 }; 667 673 668 674 export type FileReadable = { 675 + /** 676 + * Id 677 + */ 669 678 readonly id?: string; 679 + /** 680 + * Updated at 681 + */ 670 682 readonly updated_at?: string; 683 + /** 684 + * Created at 685 + */ 671 686 readonly created_at?: string; 687 + /** 688 + * Mime 689 + */ 672 690 mime: string; 691 + /** 692 + * File 693 + */ 673 694 readonly file?: string; 674 695 }; 675 696 676 697 export type FileWritable = { 698 + /** 699 + * Mime 700 + */ 677 701 mime: string; 678 702 }; 679 703
+24
packages/openapi-ts-tests/test/__snapshots__/3.1.x/plugins/@tanstack/svelte-query/asClass/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 478 481 * This is a model with one property with a 'any of' relationship where the options are not $ref 479 482 */ 480 483 export type CompositionWithNestedAnyOfAndNull = { 484 + /** 485 + * Scopes 486 + */ 481 487 propA?: Array<_3eNum1Период | ConstValue> | null; 482 488 }; 483 489 ··· 666 672 }; 667 673 668 674 export type FileReadable = { 675 + /** 676 + * Id 677 + */ 669 678 readonly id?: string; 679 + /** 680 + * Updated at 681 + */ 670 682 readonly updated_at?: string; 683 + /** 684 + * Created at 685 + */ 671 686 readonly created_at?: string; 687 + /** 688 + * Mime 689 + */ 672 690 mime: string; 691 + /** 692 + * File 693 + */ 673 694 readonly file?: string; 674 695 }; 675 696 676 697 export type FileWritable = { 698 + /** 699 + * Mime 700 + */ 677 701 mime: string; 678 702 }; 679 703
+24
packages/openapi-ts-tests/test/__snapshots__/3.1.x/plugins/@tanstack/svelte-query/axios/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 478 481 * This is a model with one property with a 'any of' relationship where the options are not $ref 479 482 */ 480 483 export type CompositionWithNestedAnyOfAndNull = { 484 + /** 485 + * Scopes 486 + */ 481 487 propA?: Array<_3eNum1Период | ConstValue> | null; 482 488 }; 483 489 ··· 666 672 }; 667 673 668 674 export type FileReadable = { 675 + /** 676 + * Id 677 + */ 669 678 readonly id?: string; 679 + /** 680 + * Updated at 681 + */ 670 682 readonly updated_at?: string; 683 + /** 684 + * Created at 685 + */ 671 686 readonly created_at?: string; 687 + /** 688 + * Mime 689 + */ 672 690 mime: string; 691 + /** 692 + * File 693 + */ 673 694 readonly file?: string; 674 695 }; 675 696 676 697 export type FileWritable = { 698 + /** 699 + * Mime 700 + */ 677 701 mime: string; 678 702 }; 679 703
+24
packages/openapi-ts-tests/test/__snapshots__/3.1.x/plugins/@tanstack/svelte-query/fetch/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 478 481 * This is a model with one property with a 'any of' relationship where the options are not $ref 479 482 */ 480 483 export type CompositionWithNestedAnyOfAndNull = { 484 + /** 485 + * Scopes 486 + */ 481 487 propA?: Array<_3eNum1Период | ConstValue> | null; 482 488 }; 483 489 ··· 666 672 }; 667 673 668 674 export type FileReadable = { 675 + /** 676 + * Id 677 + */ 669 678 readonly id?: string; 679 + /** 680 + * Updated at 681 + */ 670 682 readonly updated_at?: string; 683 + /** 684 + * Created at 685 + */ 671 686 readonly created_at?: string; 687 + /** 688 + * Mime 689 + */ 672 690 mime: string; 691 + /** 692 + * File 693 + */ 673 694 readonly file?: string; 674 695 }; 675 696 676 697 export type FileWritable = { 698 + /** 699 + * Mime 700 + */ 677 701 mime: string; 678 702 }; 679 703
+24
packages/openapi-ts-tests/test/__snapshots__/3.1.x/plugins/@tanstack/vue-query/asClass/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 478 481 * This is a model with one property with a 'any of' relationship where the options are not $ref 479 482 */ 480 483 export type CompositionWithNestedAnyOfAndNull = { 484 + /** 485 + * Scopes 486 + */ 481 487 propA?: Array<_3eNum1Период | ConstValue> | null; 482 488 }; 483 489 ··· 666 672 }; 667 673 668 674 export type FileReadable = { 675 + /** 676 + * Id 677 + */ 669 678 readonly id?: string; 679 + /** 680 + * Updated at 681 + */ 670 682 readonly updated_at?: string; 683 + /** 684 + * Created at 685 + */ 671 686 readonly created_at?: string; 687 + /** 688 + * Mime 689 + */ 672 690 mime: string; 691 + /** 692 + * File 693 + */ 673 694 readonly file?: string; 674 695 }; 675 696 676 697 export type FileWritable = { 698 + /** 699 + * Mime 700 + */ 677 701 mime: string; 678 702 }; 679 703
+24
packages/openapi-ts-tests/test/__snapshots__/3.1.x/plugins/@tanstack/vue-query/axios/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 478 481 * This is a model with one property with a 'any of' relationship where the options are not $ref 479 482 */ 480 483 export type CompositionWithNestedAnyOfAndNull = { 484 + /** 485 + * Scopes 486 + */ 481 487 propA?: Array<_3eNum1Период | ConstValue> | null; 482 488 }; 483 489 ··· 666 672 }; 667 673 668 674 export type FileReadable = { 675 + /** 676 + * Id 677 + */ 669 678 readonly id?: string; 679 + /** 680 + * Updated at 681 + */ 670 682 readonly updated_at?: string; 683 + /** 684 + * Created at 685 + */ 671 686 readonly created_at?: string; 687 + /** 688 + * Mime 689 + */ 672 690 mime: string; 691 + /** 692 + * File 693 + */ 673 694 readonly file?: string; 674 695 }; 675 696 676 697 export type FileWritable = { 698 + /** 699 + * Mime 700 + */ 677 701 mime: string; 678 702 }; 679 703
+24
packages/openapi-ts-tests/test/__snapshots__/3.1.x/plugins/@tanstack/vue-query/fetch/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 478 481 * This is a model with one property with a 'any of' relationship where the options are not $ref 479 482 */ 480 483 export type CompositionWithNestedAnyOfAndNull = { 484 + /** 485 + * Scopes 486 + */ 481 487 propA?: Array<_3eNum1Период | ConstValue> | null; 482 488 }; 483 489 ··· 666 672 }; 667 673 668 674 export type FileReadable = { 675 + /** 676 + * Id 677 + */ 669 678 readonly id?: string; 679 + /** 680 + * Updated at 681 + */ 670 682 readonly updated_at?: string; 683 + /** 684 + * Created at 685 + */ 671 686 readonly created_at?: string; 687 + /** 688 + * Mime 689 + */ 672 690 mime: string; 691 + /** 692 + * File 693 + */ 673 694 readonly file?: string; 674 695 }; 675 696 676 697 export type FileWritable = { 698 + /** 699 + * Mime 700 + */ 677 701 mime: string; 678 702 }; 679 703
+24
packages/openapi-ts-tests/test/__snapshots__/3.1.x/plugins/fastify/default/types.gen.ts
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 478 481 * This is a model with one property with a 'any of' relationship where the options are not $ref 479 482 */ 480 483 export type CompositionWithNestedAnyOfAndNull = { 484 + /** 485 + * Scopes 486 + */ 481 487 propA?: Array<_3eNum1Период | ConstValue> | null; 482 488 }; 483 489 ··· 666 672 }; 667 673 668 674 export type FileReadable = { 675 + /** 676 + * Id 677 + */ 669 678 readonly id?: string; 679 + /** 680 + * Updated at 681 + */ 670 682 readonly updated_at?: string; 683 + /** 684 + * Created at 685 + */ 671 686 readonly created_at?: string; 687 + /** 688 + * Mime 689 + */ 672 690 mime: string; 691 + /** 692 + * File 693 + */ 673 694 readonly file?: string; 674 695 }; 675 696 676 697 export type FileWritable = { 698 + /** 699 + * Mime 700 + */ 677 701 mime: string; 678 702 }; 679 703
+304
packages/openapi-ts-tests/test/__snapshots__/3.1.x/plugins/valibot/default/valibot.gen.ts
··· 2 2 3 3 import * as v from 'valibot'; 4 4 5 + /** 6 + * Model with number-only name 7 + */ 5 8 export const v400 = v.string(); 6 9 10 + /** 11 + * Testing multiline comments in string: First line 12 + * Second line 13 + * 14 + * Fourth line 15 + */ 7 16 export const vCamelCaseCommentWithBreaks = v.pipe(v.number(), v.integer()); 8 17 18 + /** 19 + * Testing multiline comments in string: First line 20 + * Second line 21 + * 22 + * Fourth line 23 + */ 9 24 export const vCommentWithBreaks = v.pipe(v.number(), v.integer()); 10 25 26 + /** 27 + * Testing backticks in string: `backticks` and ```multiple backticks``` should work 28 + */ 11 29 export const vCommentWithBackticks = v.pipe(v.number(), v.integer()); 12 30 31 + /** 32 + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work 33 + */ 13 34 export const vCommentWithBackticksAndQuotes = v.pipe(v.number(), v.integer()); 14 35 36 + /** 37 + * Testing slashes in string: \backwards\\\ and /forwards/// should work 38 + */ 15 39 export const vCommentWithSlashes = v.pipe(v.number(), v.integer()); 16 40 41 + /** 42 + * Testing expression placeholders in string: ${expression} should work 43 + */ 17 44 export const vCommentWithExpressionPlaceholders = v.pipe(v.number(), v.integer()); 18 45 46 + /** 47 + * Testing quotes in string: 'single quote''' and "double quotes""" should work 48 + */ 19 49 export const vCommentWithQuotes = v.pipe(v.number(), v.integer()); 20 50 51 + /** 52 + * Testing reserved characters in string: * inline * and ** inline ** should work 53 + */ 21 54 export const vCommentWithReservedCharacters = v.pipe(v.number(), v.integer()); 22 55 56 + /** 57 + * This is a simple number 58 + */ 23 59 export const vSimpleInteger = v.pipe(v.number(), v.integer()); 24 60 61 + /** 62 + * This is a simple boolean 63 + */ 25 64 export const vSimpleBoolean = v.boolean(); 26 65 66 + /** 67 + * This is a simple string 68 + */ 27 69 export const vSimpleString = v.string(); 28 70 71 + /** 72 + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) 73 + */ 29 74 export const vNonAsciiStringæøåÆøÅöôêÊ字符串 = v.string(); 30 75 76 + /** 77 + * This is a simple file 78 + */ 31 79 export const vSimpleFile = v.string(); 32 80 81 + /** 82 + * This is a model with one string property 83 + */ 33 84 export const vModelWithString = v.object({ 34 85 prop: v.optional(v.string()) 35 86 }); 36 87 88 + /** 89 + * This is a simple reference 90 + */ 37 91 export const vSimpleReference = vModelWithString; 38 92 93 + /** 94 + * This is a simple string 95 + */ 39 96 export const vSimpleStringWithPattern = v.union([ 40 97 v.pipe(v.string(), v.maxLength(64), v.regex(/^[a-zA-Z0-9_]*$/)), 41 98 v.null() 42 99 ]); 43 100 101 + /** 102 + * This is a simple enum with strings 103 + */ 44 104 export const vEnumWithStrings = v.picklist([ 45 105 'Success', 46 106 'Warning', ··· 57 117 '' 58 118 ]); 59 119 120 + /** 121 + * This is a simple enum with numbers 122 + */ 60 123 export const vEnumWithNumbers = v.unknown(); 61 124 125 + /** 126 + * Success=1,Warning=2,Error=3 127 + */ 62 128 export const vEnumFromDescription = v.number(); 63 129 130 + /** 131 + * This is a simple enum with numbers 132 + */ 64 133 export const vEnumWithExtensions = v.unknown(); 65 134 66 135 export const vEnumWithXEnumNames = v.unknown(); 67 136 137 + /** 138 + * This is a simple array with numbers 139 + */ 68 140 export const vArrayWithNumbers = v.array(v.pipe(v.number(), v.integer())); 69 141 142 + /** 143 + * This is a simple array with booleans 144 + */ 70 145 export const vArrayWithBooleans = v.array(v.boolean()); 71 146 147 + /** 148 + * This is a simple array with strings 149 + */ 72 150 export const vArrayWithStrings = v.optional(v.array(v.string()), ['test']); 73 151 152 + /** 153 + * This is a simple array with references 154 + */ 74 155 export const vArrayWithReferences = v.array(vModelWithString); 75 156 157 + /** 158 + * This is a simple array containing an array 159 + */ 76 160 export const vArrayWithArray = v.array(v.array(vModelWithString)); 77 161 162 + /** 163 + * This is a simple array with properties 164 + */ 78 165 export const vArrayWithProperties = v.array(v.object({ 79 166 '16x16': v.optional(vCamelCaseCommentWithBreaks), 80 167 bar: v.optional(v.string()) 81 168 })); 82 169 170 + /** 171 + * This is a simple array with any of properties 172 + */ 83 173 export const vArrayWithAnyOfProperties = v.array(v.unknown()); 84 174 85 175 export const vAnyOfAnyAndNull = v.object({ ··· 89 179 ])) 90 180 }); 91 181 182 + /** 183 + * This is a simple array with any of properties 184 + */ 92 185 export const vAnyOfArrays = v.object({ 93 186 results: v.optional(v.array(v.unknown())) 94 187 }); 95 188 189 + /** 190 + * This is a string dictionary 191 + */ 96 192 export const vDictionaryWithString = v.object({}); 97 193 98 194 export const vDictionaryWithPropertiesAndAdditionalProperties = v.object({ ··· 100 196 bar: v.optional(v.boolean()) 101 197 }); 102 198 199 + /** 200 + * This is a string reference 201 + */ 103 202 export const vDictionaryWithReference = v.object({}); 104 203 204 + /** 205 + * This is a complex dictionary 206 + */ 105 207 export const vDictionaryWithArray = v.object({}); 106 208 209 + /** 210 + * This is a string dictionary 211 + */ 107 212 export const vDictionaryWithDictionary = v.object({}); 108 213 214 + /** 215 + * This is a complex dictionary 216 + */ 109 217 export const vDictionaryWithProperties = v.object({}); 110 218 219 + /** 220 + * This is a model with one number property 221 + */ 111 222 export const vModelWithInteger = v.object({ 112 223 prop: v.optional(v.pipe(v.number(), v.integer())) 113 224 }); 114 225 226 + /** 227 + * This is a model with one boolean property 228 + */ 115 229 export const vModelWithBoolean = v.object({ 116 230 prop: v.optional(v.boolean()) 117 231 }); 118 232 233 + /** 234 + * This is a model with one string property 235 + */ 119 236 export const vModelWithStringError = v.object({ 120 237 prop: v.optional(v.string()) 121 238 }); 122 239 240 + /** 241 + * `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) 242 + */ 123 243 export const vModelFromZendesk = v.string(); 124 244 245 + /** 246 + * This is a model with one string property 247 + */ 125 248 export const vModelWithNullableString = v.object({ 126 249 nullableProp1: v.optional(v.union([ 127 250 v.string(), ··· 147 270 ])) 148 271 }); 149 272 273 + /** 274 + * This is a model with one enum 275 + */ 150 276 export const vModelWithEnum = v.object({ 151 277 'foo_bar-enum': v.optional(v.picklist([ 152 278 'Success', ··· 165 291 bool: v.optional(v.unknown()) 166 292 }); 167 293 294 + /** 295 + * This is a model with one enum with escaped name 296 + */ 168 297 export const vModelWithEnumWithHyphen = v.object({ 169 298 'foo-bar-baz-qux': v.optional(v.picklist([ 170 299 '3.0' 171 300 ])) 172 301 }); 173 302 303 + /** 304 + * This is a model with one enum 305 + */ 174 306 export const vModelWithEnumFromDescription = v.object({ 175 307 test: v.optional(v.pipe(v.number(), v.integer())) 176 308 }); 177 309 310 + /** 311 + * This is a model with nested enums 312 + */ 178 313 export const vModelWithNestedEnums = v.object({ 179 314 dictionaryWithEnum: v.optional(v.object({})), 180 315 dictionaryWithEnumFromDescription: v.optional(v.object({})), ··· 192 327 ])) 193 328 }); 194 329 330 + /** 331 + * This is a model with one nested property 332 + */ 195 333 export const vModelWithProperties = v.object({ 196 334 required: v.string(), 197 335 requiredAndReadOnly: v.pipe(v.string(), v.readonly()), ··· 210 348 '@namespace.integer': v.optional(v.pipe(v.pipe(v.number(), v.integer()), v.readonly())) 211 349 }); 212 350 351 + /** 352 + * This is a model with one property containing a reference 353 + */ 213 354 export const vModelWithReference = v.object({ 214 355 prop: v.optional(vModelWithProperties) 215 356 }); ··· 220 361 baz: v.string() 221 362 }); 222 363 364 + /** 365 + * This is a model with one property containing an array 366 + */ 223 367 export const vModelWithArrayReadOnlyAndWriteOnly = v.object({ 224 368 prop: v.optional(v.array(vModelWithReadOnlyAndWriteOnly)), 225 369 propWithFile: v.optional(v.array(v.string())), 226 370 propWithNumber: v.optional(v.array(v.number())) 227 371 }); 228 372 373 + /** 374 + * This is a model with one property containing an array 375 + */ 229 376 export const vModelWithArray = v.object({ 230 377 prop: v.optional(v.array(vModelWithString)), 231 378 propWithFile: v.optional(v.array(v.string())), 232 379 propWithNumber: v.optional(v.array(v.number())) 233 380 }); 234 381 382 + /** 383 + * This is a model with one property containing a dictionary 384 + */ 235 385 export const vModelWithDictionary = v.object({ 236 386 prop: v.optional(v.object({})) 237 387 }); 238 388 389 + /** 390 + * This is a deprecated model with a deprecated property 391 + * @deprecated 392 + */ 239 393 export const vDeprecatedModel = v.object({ 240 394 prop: v.optional(v.string()) 241 395 }); 242 396 397 + /** 398 + * This is a model with one property containing a circular reference 399 + */ 243 400 export const vModelWithCircularReference: v.GenericSchema = v.object({ 244 401 prop: v.optional(v.lazy(() => { 245 402 return vModelWithCircularReference; 246 403 })) 247 404 }); 248 405 406 + /** 407 + * This is a model with one property with a 'one of' relationship 408 + */ 249 409 export const vCompositionWithOneOf = v.object({ 250 410 propA: v.optional(v.union([ 251 411 vModelWithString, ··· 255 415 ])) 256 416 }); 257 417 418 + /** 419 + * This is a model with one property with a 'one of' relationship where the options are not $ref 420 + */ 258 421 export const vCompositionWithOneOfAnonymous = v.object({ 259 422 propA: v.optional(v.union([ 260 423 v.object({ ··· 265 428 ])) 266 429 }); 267 430 431 + /** 432 + * Circle 433 + */ 268 434 export const vModelCircle = v.object({ 269 435 kind: v.string(), 270 436 radius: v.optional(v.number()) 271 437 }); 272 438 439 + /** 440 + * Square 441 + */ 273 442 export const vModelSquare = v.object({ 274 443 kind: v.string(), 275 444 sideLength: v.optional(v.number()) 276 445 }); 277 446 447 + /** 448 + * This is a model with one property with a 'one of' relationship where the options are not $ref 449 + */ 278 450 export const vCompositionWithOneOfDiscriminator = v.union([ 279 451 v.intersect([ 280 452 v.object({ ··· 290 462 ]) 291 463 ]); 292 464 465 + /** 466 + * This is a model with one property with a 'any of' relationship 467 + */ 293 468 export const vCompositionWithAnyOf = v.object({ 294 469 propA: v.optional(v.union([ 295 470 vModelWithString, ··· 299 474 ])) 300 475 }); 301 476 477 + /** 478 + * This is a model with one property with a 'any of' relationship where the options are not $ref 479 + */ 302 480 export const vCompositionWithAnyOfAnonymous = v.object({ 303 481 propA: v.optional(v.union([ 304 482 v.object({ ··· 309 487 ])) 310 488 }); 311 489 490 + /** 491 + * This is a model with nested 'any of' property with a type null 492 + */ 312 493 export const vCompositionWithNestedAnyAndTypeNull = v.object({ 313 494 propA: v.optional(v.union([ 314 495 v.array(v.unknown()), ··· 323 504 324 505 export const vConstValue = v.literal('ConstValue'); 325 506 507 + /** 508 + * This is a model with one property with a 'any of' relationship where the options are not $ref 509 + */ 326 510 export const vCompositionWithNestedAnyOfAndNull = v.object({ 327 511 propA: v.optional(v.union([ 328 512 v.array(v.unknown()), ··· 330 514 ])) 331 515 }); 332 516 517 + /** 518 + * This is a model with one property with a 'one of' relationship 519 + */ 333 520 export const vCompositionWithOneOfAndNullable = v.object({ 334 521 propA: v.optional(v.union([ 335 522 v.object({ ··· 342 529 ])) 343 530 }); 344 531 532 + /** 533 + * This is a model that contains a simple dictionary within composition 534 + */ 345 535 export const vCompositionWithOneOfAndSimpleDictionary = v.object({ 346 536 propA: v.optional(v.union([ 347 537 v.boolean(), ··· 349 539 ])) 350 540 }); 351 541 542 + /** 543 + * This is a model that contains a dictionary of simple arrays within composition 544 + */ 352 545 export const vCompositionWithOneOfAndSimpleArrayDictionary = v.object({ 353 546 propA: v.optional(v.union([ 354 547 v.boolean(), ··· 356 549 ])) 357 550 }); 358 551 552 + /** 553 + * This is a model that contains a dictionary of complex arrays (composited) within composition 554 + */ 359 555 export const vCompositionWithOneOfAndComplexArrayDictionary = v.object({ 360 556 propA: v.optional(v.union([ 361 557 v.boolean(), ··· 363 559 ])) 364 560 }); 365 561 562 + /** 563 + * This is a model with one property with a 'all of' relationship 564 + */ 366 565 export const vCompositionWithAllOfAndNullable = v.object({ 367 566 propA: v.optional(v.union([ 368 567 v.intersect([ ··· 377 576 ])) 378 577 }); 379 578 579 + /** 580 + * This is a model with one property with a 'any of' relationship 581 + */ 380 582 export const vCompositionWithAnyOfAndNullable = v.object({ 381 583 propA: v.optional(v.union([ 382 584 v.object({ ··· 389 591 ])) 390 592 }); 391 593 594 + /** 595 + * This is a base model with two simple optional properties 596 + */ 392 597 export const vCompositionBaseModel = v.object({ 393 598 firstName: v.optional(v.string()), 394 599 lastname: v.optional(v.string()) 395 600 }); 396 601 602 + /** 603 + * This is a model that extends the base model 604 + */ 397 605 export const vCompositionExtendedModel = v.intersect([ 398 606 vCompositionBaseModel, 399 607 v.object({ ··· 403 611 }) 404 612 ]); 405 613 614 + /** 615 + * This is a model with one nested property 616 + */ 406 617 export const vModelWithNestedProperties = v.object({ 407 618 first: v.pipe(v.union([ 408 619 v.pipe(v.object({ ··· 420 631 ]), v.readonly()) 421 632 }); 422 633 634 + /** 635 + * This is a model with duplicated properties 636 + */ 423 637 export const vModelWithDuplicateProperties = v.object({ 424 638 prop: v.optional(vModelWithString) 425 639 }); 426 640 641 + /** 642 + * This is a model with ordered properties 643 + */ 427 644 export const vModelWithOrderedProperties = v.object({ 428 645 zebra: v.optional(v.string()), 429 646 apple: v.optional(v.string()), 430 647 hawaii: v.optional(v.string()) 431 648 }); 432 649 650 + /** 651 + * This is a model with duplicated imports 652 + */ 433 653 export const vModelWithDuplicateImports = v.object({ 434 654 propA: v.optional(vModelWithString), 435 655 propB: v.optional(vModelWithString), 436 656 propC: v.optional(vModelWithString) 437 657 }); 438 658 659 + /** 660 + * This is a model that extends another model 661 + */ 439 662 export const vModelThatExtends = v.intersect([ 440 663 vModelWithString, 441 664 v.object({ ··· 444 667 }) 445 668 ]); 446 669 670 + /** 671 + * This is a model that extends another model 672 + */ 447 673 export const vModelThatExtendsExtends = v.intersect([ 448 674 vModelWithString, 449 675 vModelThatExtends, ··· 453 679 }) 454 680 ]); 455 681 682 + /** 683 + * This is a model that contains a some patterns 684 + */ 456 685 export const vModelWithPattern = v.object({ 457 686 key: v.pipe(v.string(), v.maxLength(64), v.regex(/^[a-zA-Z0-9_]*$/)), 458 687 name: v.pipe(v.string(), v.maxLength(255)), ··· 483 712 sort: v.optional(v.array(v.string())) 484 713 }); 485 714 715 + /** 716 + * This is a free-form object without additionalProperties. 717 + */ 486 718 export const vFreeFormObjectWithoutAdditionalProperties = v.object({}); 487 719 720 + /** 721 + * This is a free-form object with additionalProperties: true. 722 + */ 488 723 export const vFreeFormObjectWithAdditionalPropertiesEqTrue = v.object({}); 489 724 725 + /** 726 + * This is a free-form object with additionalProperties: {}. 727 + */ 490 728 export const vFreeFormObjectWithAdditionalPropertiesEqEmptyObject = v.object({}); 491 729 492 730 export const vModelWithConst = v.object({ ··· 496 734 withType: v.optional(v.literal('Some string')) 497 735 }); 498 736 737 + /** 738 + * This is a model with one property and additionalProperties: true 739 + */ 499 740 export const vModelWithAdditionalPropertiesEqTrue = v.object({ 500 741 prop: v.optional(v.string()) 501 742 }); ··· 507 748 ])) 508 749 }); 509 750 751 + /** 752 + * This is a reusable parameter 753 + */ 510 754 export const vSimpleParameter = v.unknown(); 511 755 512 756 export const vCompositionWithOneOfAndProperties = v.intersect([ ··· 527 771 }) 528 772 ]); 529 773 774 + /** 775 + * An object that can be null 776 + */ 530 777 export const vNullableObject = v.optional(v.union([ 531 778 v.object({ 532 779 foo: v.optional(v.string()) ··· 534 781 v.null() 535 782 ]), null); 536 783 784 + /** 785 + * Some % character 786 + */ 537 787 export const vCharactersInDescription = v.string(); 538 788 539 789 export const vModelWithNullableObject = v.object({ ··· 644 894 ]) 645 895 ]); 646 896 897 + /** 898 + * Model with restricted keyword name 899 + */ 647 900 export const vImport = v.string(); 648 901 649 902 export const vModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = v.tuple([ ··· 672 925 value: v.optional(v.unknown()) 673 926 }); 674 927 928 + /** 929 + * Some description with `back ticks` 930 + */ 675 931 export const vModelWithBackticksInDescription = v.object({ 676 932 template: v.optional(v.string()) 677 933 }); ··· 690 946 }) 691 947 ]); 692 948 949 + /** 950 + * Model used to test deduplication strategy (unused) 951 + */ 693 952 export const vParameterSimpleParameterUnused = v.string(); 694 953 954 + /** 955 + * Model used to test deduplication strategy 956 + */ 695 957 export const vPostServiceWithEmptyTagResponse = v.string(); 696 958 959 + /** 960 + * Model used to test deduplication strategy 961 + */ 697 962 export const vPostServiceWithEmptyTagResponse2 = v.string(); 698 963 964 + /** 965 + * Model used to test deduplication strategy 966 + */ 699 967 export const vDeleteFooData = v.string(); 700 968 969 + /** 970 + * Model used to test deduplication strategy 971 + */ 701 972 export const vDeleteFooData2 = v.string(); 702 973 703 974 export const vSchemaWithFormRestrictedKeys = v.object({ ··· 722 993 }))) 723 994 }); 724 995 996 + /** 997 + * This schema was giving PascalCase transformations a hard time 998 + */ 725 999 export const vIoK8sApimachineryPkgApisMetaV1Preconditions = v.object({ 726 1000 resourceVersion: v.optional(v.string()), 727 1001 uid: v.optional(v.string()) 728 1002 }); 729 1003 1004 + /** 1005 + * This schema was giving PascalCase transformations a hard time 1006 + */ 730 1007 export const vIoK8sApimachineryPkgApisMetaV1DeleteOptions = v.object({ 731 1008 preconditions: v.optional(vIoK8sApimachineryPkgApisMetaV1Preconditions) 732 1009 }); ··· 784 1061 vModelWithReadOnlyAndWriteOnly 785 1062 ]); 786 1063 1064 + /** 1065 + * Success 1066 + */ 787 1067 export const vApiVVersionODataControllerCountResponse = vModelFromZendesk; 788 1068 1069 + /** 1070 + * Response is a simple number 1071 + */ 789 1072 export const vGetApiVbyApiVersionSimpleOperationResponse = v.number(); 790 1073 791 1074 export const vPostCallWithOptionalParamResponse = v.union([ ··· 793 1076 v.void() 794 1077 ]); 795 1078 1079 + /** 1080 + * Success 1081 + */ 796 1082 export const vCallWithNoContentResponseResponse = v.void(); 797 1083 798 1084 export const vCallWithResponseAndNoContentResponseResponse = v.union([ ··· 802 1088 803 1089 export const vDummyAResponse = v400; 804 1090 1091 + /** 1092 + * Success 1093 + */ 805 1094 export const vDummyBResponse = v.void(); 806 1095 807 1096 export const vCallWithResponseResponse = vImport; ··· 833 1122 834 1123 export const vUploadFileResponse = v.boolean(); 835 1124 1125 + /** 1126 + * Success 1127 + */ 836 1128 export const vFileResponseResponse = v.string(); 837 1129 1130 + /** 1131 + * Successful response 1132 + */ 838 1133 export const vComplexTypesResponse = v.array(vModelWithString); 839 1134 1135 + /** 1136 + * OK 1137 + */ 840 1138 export const vMultipartResponseResponse = v.object({ 841 1139 file: v.optional(v.string()), 842 1140 metadata: v.optional(v.object({ ··· 845 1143 })) 846 1144 }); 847 1145 1146 + /** 1147 + * Success 1148 + */ 848 1149 export const vComplexParamsResponse = vModelWithString; 849 1150 1151 + /** 1152 + * Successful response 1153 + */ 850 1154 export const vNonAsciiæøåÆøÅöôêÊ字符串Response = v.array(vNonAsciiStringæøåÆøÅöôêÊ字符串);
+304
packages/openapi-ts-tests/test/__snapshots__/3.1.x/plugins/zod/default/zod.gen.ts
··· 2 2 3 3 import { z } from 'zod'; 4 4 5 + /** 6 + * Model with number-only name 7 + */ 5 8 export const z400 = z.string(); 6 9 10 + /** 11 + * Testing multiline comments in string: First line 12 + * Second line 13 + * 14 + * Fourth line 15 + */ 7 16 export const zCamelCaseCommentWithBreaks = z.number().int(); 8 17 18 + /** 19 + * Testing multiline comments in string: First line 20 + * Second line 21 + * 22 + * Fourth line 23 + */ 9 24 export const zCommentWithBreaks = z.number().int(); 10 25 26 + /** 27 + * Testing backticks in string: `backticks` and ```multiple backticks``` should work 28 + */ 11 29 export const zCommentWithBackticks = z.number().int(); 12 30 31 + /** 32 + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work 33 + */ 13 34 export const zCommentWithBackticksAndQuotes = z.number().int(); 14 35 36 + /** 37 + * Testing slashes in string: \backwards\\\ and /forwards/// should work 38 + */ 15 39 export const zCommentWithSlashes = z.number().int(); 16 40 41 + /** 42 + * Testing expression placeholders in string: ${expression} should work 43 + */ 17 44 export const zCommentWithExpressionPlaceholders = z.number().int(); 18 45 46 + /** 47 + * Testing quotes in string: 'single quote''' and "double quotes""" should work 48 + */ 19 49 export const zCommentWithQuotes = z.number().int(); 20 50 51 + /** 52 + * Testing reserved characters in string: * inline * and ** inline ** should work 53 + */ 21 54 export const zCommentWithReservedCharacters = z.number().int(); 22 55 56 + /** 57 + * This is a simple number 58 + */ 23 59 export const zSimpleInteger = z.number().int(); 24 60 61 + /** 62 + * This is a simple boolean 63 + */ 25 64 export const zSimpleBoolean = z.boolean(); 26 65 66 + /** 67 + * This is a simple string 68 + */ 27 69 export const zSimpleString = z.string(); 28 70 71 + /** 72 + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) 73 + */ 29 74 export const zNonAsciiStringæøåÆøÅöôêÊ字符串 = z.string(); 30 75 76 + /** 77 + * This is a simple file 78 + */ 31 79 export const zSimpleFile = z.string(); 32 80 81 + /** 82 + * This is a model with one string property 83 + */ 33 84 export const zModelWithString = z.object({ 34 85 prop: z.string().optional() 35 86 }); 36 87 88 + /** 89 + * This is a simple reference 90 + */ 37 91 export const zSimpleReference = zModelWithString; 38 92 93 + /** 94 + * This is a simple string 95 + */ 39 96 export const zSimpleStringWithPattern = z.union([ 40 97 z.string().max(64).regex(/^[a-zA-Z0-9_]*$/), 41 98 z.null() 42 99 ]); 43 100 101 + /** 102 + * This is a simple enum with strings 103 + */ 44 104 export const zEnumWithStrings = z.enum([ 45 105 'Success', 46 106 'Warning', ··· 57 117 '' 58 118 ]); 59 119 120 + /** 121 + * This is a simple enum with numbers 122 + */ 60 123 export const zEnumWithNumbers = z.unknown(); 61 124 125 + /** 126 + * Success=1,Warning=2,Error=3 127 + */ 62 128 export const zEnumFromDescription = z.number(); 63 129 130 + /** 131 + * This is a simple enum with numbers 132 + */ 64 133 export const zEnumWithExtensions = z.unknown(); 65 134 66 135 export const zEnumWithXEnumNames = z.unknown(); 67 136 137 + /** 138 + * This is a simple array with numbers 139 + */ 68 140 export const zArrayWithNumbers = z.array(z.number().int()); 69 141 142 + /** 143 + * This is a simple array with booleans 144 + */ 70 145 export const zArrayWithBooleans = z.array(z.boolean()); 71 146 147 + /** 148 + * This is a simple array with strings 149 + */ 72 150 export const zArrayWithStrings = z.array(z.string()).default(['test']); 73 151 152 + /** 153 + * This is a simple array with references 154 + */ 74 155 export const zArrayWithReferences = z.array(zModelWithString); 75 156 157 + /** 158 + * This is a simple array containing an array 159 + */ 76 160 export const zArrayWithArray = z.array(z.array(zModelWithString)); 77 161 162 + /** 163 + * This is a simple array with properties 164 + */ 78 165 export const zArrayWithProperties = z.array(z.object({ 79 166 '16x16': zCamelCaseCommentWithBreaks.optional(), 80 167 bar: z.string().optional() 81 168 })); 82 169 170 + /** 171 + * This is a simple array with any of properties 172 + */ 83 173 export const zArrayWithAnyOfProperties = z.array(z.unknown()); 84 174 85 175 export const zAnyOfAnyAndNull = z.object({ ··· 89 179 ]).optional() 90 180 }); 91 181 182 + /** 183 + * This is a simple array with any of properties 184 + */ 92 185 export const zAnyOfArrays = z.object({ 93 186 results: z.array(z.unknown()).optional() 94 187 }); 95 188 189 + /** 190 + * This is a string dictionary 191 + */ 96 192 export const zDictionaryWithString = z.object({}); 97 193 98 194 export const zDictionaryWithPropertiesAndAdditionalProperties = z.object({ ··· 100 196 bar: z.boolean().optional() 101 197 }); 102 198 199 + /** 200 + * This is a string reference 201 + */ 103 202 export const zDictionaryWithReference = z.object({}); 104 203 204 + /** 205 + * This is a complex dictionary 206 + */ 105 207 export const zDictionaryWithArray = z.object({}); 106 208 209 + /** 210 + * This is a string dictionary 211 + */ 107 212 export const zDictionaryWithDictionary = z.object({}); 108 213 214 + /** 215 + * This is a complex dictionary 216 + */ 109 217 export const zDictionaryWithProperties = z.object({}); 110 218 219 + /** 220 + * This is a model with one number property 221 + */ 111 222 export const zModelWithInteger = z.object({ 112 223 prop: z.number().int().optional() 113 224 }); 114 225 226 + /** 227 + * This is a model with one boolean property 228 + */ 115 229 export const zModelWithBoolean = z.object({ 116 230 prop: z.boolean().optional() 117 231 }); 118 232 233 + /** 234 + * This is a model with one string property 235 + */ 119 236 export const zModelWithStringError = z.object({ 120 237 prop: z.string().optional() 121 238 }); 122 239 240 + /** 241 + * `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) 242 + */ 123 243 export const zModelFromZendesk = z.string(); 124 244 245 + /** 246 + * This is a model with one string property 247 + */ 125 248 export const zModelWithNullableString = z.object({ 126 249 nullableProp1: z.union([ 127 250 z.string(), ··· 147 270 ]).optional() 148 271 }); 149 272 273 + /** 274 + * This is a model with one enum 275 + */ 150 276 export const zModelWithEnum = z.object({ 151 277 'foo_bar-enum': z.enum([ 152 278 'Success', ··· 165 291 bool: z.unknown().optional() 166 292 }); 167 293 294 + /** 295 + * This is a model with one enum with escaped name 296 + */ 168 297 export const zModelWithEnumWithHyphen = z.object({ 169 298 'foo-bar-baz-qux': z.enum([ 170 299 '3.0' 171 300 ]).optional() 172 301 }); 173 302 303 + /** 304 + * This is a model with one enum 305 + */ 174 306 export const zModelWithEnumFromDescription = z.object({ 175 307 test: z.number().int().optional() 176 308 }); 177 309 310 + /** 311 + * This is a model with nested enums 312 + */ 178 313 export const zModelWithNestedEnums = z.object({ 179 314 dictionaryWithEnum: z.object({}).optional(), 180 315 dictionaryWithEnumFromDescription: z.object({}).optional(), ··· 192 327 ]).optional() 193 328 }); 194 329 330 + /** 331 + * This is a model with one nested property 332 + */ 195 333 export const zModelWithProperties = z.object({ 196 334 required: z.string(), 197 335 requiredAndReadOnly: z.string().readonly(), ··· 210 348 '@namespace.integer': z.number().int().readonly().optional() 211 349 }); 212 350 351 + /** 352 + * This is a model with one property containing a reference 353 + */ 213 354 export const zModelWithReference = z.object({ 214 355 prop: zModelWithProperties.optional() 215 356 }); ··· 220 361 baz: z.string() 221 362 }); 222 363 364 + /** 365 + * This is a model with one property containing an array 366 + */ 223 367 export const zModelWithArrayReadOnlyAndWriteOnly = z.object({ 224 368 prop: z.array(zModelWithReadOnlyAndWriteOnly).optional(), 225 369 propWithFile: z.array(z.string()).optional(), 226 370 propWithNumber: z.array(z.number()).optional() 227 371 }); 228 372 373 + /** 374 + * This is a model with one property containing an array 375 + */ 229 376 export const zModelWithArray = z.object({ 230 377 prop: z.array(zModelWithString).optional(), 231 378 propWithFile: z.array(z.string()).optional(), 232 379 propWithNumber: z.array(z.number()).optional() 233 380 }); 234 381 382 + /** 383 + * This is a model with one property containing a dictionary 384 + */ 235 385 export const zModelWithDictionary = z.object({ 236 386 prop: z.object({}).optional() 237 387 }); 238 388 389 + /** 390 + * This is a deprecated model with a deprecated property 391 + * @deprecated 392 + */ 239 393 export const zDeprecatedModel = z.object({ 240 394 prop: z.string().optional() 241 395 }); 242 396 397 + /** 398 + * This is a model with one property containing a circular reference 399 + */ 243 400 export const zModelWithCircularReference: z.AnyZodObject = z.object({ 244 401 prop: z.lazy(() => { 245 402 return zModelWithCircularReference; 246 403 }).optional() 247 404 }); 248 405 406 + /** 407 + * This is a model with one property with a 'one of' relationship 408 + */ 249 409 export const zCompositionWithOneOf = z.object({ 250 410 propA: z.union([ 251 411 zModelWithString, ··· 255 415 ]).optional() 256 416 }); 257 417 418 + /** 419 + * This is a model with one property with a 'one of' relationship where the options are not $ref 420 + */ 258 421 export const zCompositionWithOneOfAnonymous = z.object({ 259 422 propA: z.union([ 260 423 z.object({ ··· 265 428 ]).optional() 266 429 }); 267 430 431 + /** 432 + * Circle 433 + */ 268 434 export const zModelCircle = z.object({ 269 435 kind: z.string(), 270 436 radius: z.number().optional() 271 437 }); 272 438 439 + /** 440 + * Square 441 + */ 273 442 export const zModelSquare = z.object({ 274 443 kind: z.string(), 275 444 sideLength: z.number().optional() 276 445 }); 277 446 447 + /** 448 + * This is a model with one property with a 'one of' relationship where the options are not $ref 449 + */ 278 450 export const zCompositionWithOneOfDiscriminator = z.union([ 279 451 z.object({ 280 452 kind: z.literal('circle') ··· 284 456 }).and(zModelSquare) 285 457 ]); 286 458 459 + /** 460 + * This is a model with one property with a 'any of' relationship 461 + */ 287 462 export const zCompositionWithAnyOf = z.object({ 288 463 propA: z.union([ 289 464 zModelWithString, ··· 293 468 ]).optional() 294 469 }); 295 470 471 + /** 472 + * This is a model with one property with a 'any of' relationship where the options are not $ref 473 + */ 296 474 export const zCompositionWithAnyOfAnonymous = z.object({ 297 475 propA: z.union([ 298 476 z.object({ ··· 303 481 ]).optional() 304 482 }); 305 483 484 + /** 485 + * This is a model with nested 'any of' property with a type null 486 + */ 306 487 export const zCompositionWithNestedAnyAndTypeNull = z.object({ 307 488 propA: z.union([ 308 489 z.array(z.unknown()), ··· 317 498 318 499 export const zConstValue = z.literal('ConstValue'); 319 500 501 + /** 502 + * This is a model with one property with a 'any of' relationship where the options are not $ref 503 + */ 320 504 export const zCompositionWithNestedAnyOfAndNull = z.object({ 321 505 propA: z.union([ 322 506 z.array(z.unknown()), ··· 324 508 ]).optional() 325 509 }); 326 510 511 + /** 512 + * This is a model with one property with a 'one of' relationship 513 + */ 327 514 export const zCompositionWithOneOfAndNullable = z.object({ 328 515 propA: z.union([ 329 516 z.object({ ··· 336 523 ]).optional() 337 524 }); 338 525 526 + /** 527 + * This is a model that contains a simple dictionary within composition 528 + */ 339 529 export const zCompositionWithOneOfAndSimpleDictionary = z.object({ 340 530 propA: z.union([ 341 531 z.boolean(), ··· 343 533 ]).optional() 344 534 }); 345 535 536 + /** 537 + * This is a model that contains a dictionary of simple arrays within composition 538 + */ 346 539 export const zCompositionWithOneOfAndSimpleArrayDictionary = z.object({ 347 540 propA: z.union([ 348 541 z.boolean(), ··· 350 543 ]).optional() 351 544 }); 352 545 546 + /** 547 + * This is a model that contains a dictionary of complex arrays (composited) within composition 548 + */ 353 549 export const zCompositionWithOneOfAndComplexArrayDictionary = z.object({ 354 550 propA: z.union([ 355 551 z.boolean(), ··· 357 553 ]).optional() 358 554 }); 359 555 556 + /** 557 + * This is a model with one property with a 'all of' relationship 558 + */ 360 559 export const zCompositionWithAllOfAndNullable = z.object({ 361 560 propA: z.union([ 362 561 z.object({ ··· 366 565 ]).optional() 367 566 }); 368 567 568 + /** 569 + * This is a model with one property with a 'any of' relationship 570 + */ 369 571 export const zCompositionWithAnyOfAndNullable = z.object({ 370 572 propA: z.union([ 371 573 z.object({ ··· 378 580 ]).optional() 379 581 }); 380 582 583 + /** 584 + * This is a base model with two simple optional properties 585 + */ 381 586 export const zCompositionBaseModel = z.object({ 382 587 firstName: z.string().optional(), 383 588 lastname: z.string().optional() 384 589 }); 385 590 591 + /** 592 + * This is a model that extends the base model 593 + */ 386 594 export const zCompositionExtendedModel = zCompositionBaseModel.and(z.object({ 387 595 age: z.number(), 388 596 firstName: z.string(), 389 597 lastname: z.string() 390 598 })); 391 599 600 + /** 601 + * This is a model with one nested property 602 + */ 392 603 export const zModelWithNestedProperties = z.object({ 393 604 first: z.union([ 394 605 z.object({ ··· 406 617 ]).readonly() 407 618 }); 408 619 620 + /** 621 + * This is a model with duplicated properties 622 + */ 409 623 export const zModelWithDuplicateProperties = z.object({ 410 624 prop: zModelWithString.optional() 411 625 }); 412 626 627 + /** 628 + * This is a model with ordered properties 629 + */ 413 630 export const zModelWithOrderedProperties = z.object({ 414 631 zebra: z.string().optional(), 415 632 apple: z.string().optional(), 416 633 hawaii: z.string().optional() 417 634 }); 418 635 636 + /** 637 + * This is a model with duplicated imports 638 + */ 419 639 export const zModelWithDuplicateImports = z.object({ 420 640 propA: zModelWithString.optional(), 421 641 propB: zModelWithString.optional(), 422 642 propC: zModelWithString.optional() 423 643 }); 424 644 645 + /** 646 + * This is a model that extends another model 647 + */ 425 648 export const zModelThatExtends = zModelWithString.and(z.object({ 426 649 propExtendsA: z.string().optional(), 427 650 propExtendsB: zModelWithString.optional() 428 651 })); 429 652 653 + /** 654 + * This is a model that extends another model 655 + */ 430 656 export const zModelThatExtendsExtends = zModelWithString.and(zModelThatExtends).and(z.object({ 431 657 propExtendsC: z.string().optional(), 432 658 propExtendsD: zModelWithString.optional() 433 659 })); 434 660 661 + /** 662 + * This is a model that contains a some patterns 663 + */ 435 664 export const zModelWithPattern = z.object({ 436 665 key: z.string().max(64).regex(/^[a-zA-Z0-9_]*$/), 437 666 name: z.string().max(255), ··· 462 691 sort: z.array(z.string()).optional() 463 692 }); 464 693 694 + /** 695 + * This is a free-form object without additionalProperties. 696 + */ 465 697 export const zFreeFormObjectWithoutAdditionalProperties = z.object({}); 466 698 699 + /** 700 + * This is a free-form object with additionalProperties: true. 701 + */ 467 702 export const zFreeFormObjectWithAdditionalPropertiesEqTrue = z.object({}); 468 703 704 + /** 705 + * This is a free-form object with additionalProperties: {}. 706 + */ 469 707 export const zFreeFormObjectWithAdditionalPropertiesEqEmptyObject = z.object({}); 470 708 471 709 export const zModelWithConst = z.object({ ··· 475 713 withType: z.literal('Some string').optional() 476 714 }); 477 715 716 + /** 717 + * This is a model with one property and additionalProperties: true 718 + */ 478 719 export const zModelWithAdditionalPropertiesEqTrue = z.object({ 479 720 prop: z.string().optional() 480 721 }); ··· 486 727 ]).optional() 487 728 }); 488 729 730 + /** 731 + * This is a reusable parameter 732 + */ 489 733 export const zSimpleParameter = z.unknown(); 490 734 491 735 export const zCompositionWithOneOfAndProperties = z.intersection(z.union([ ··· 503 747 qux: z.number().int().gte(0) 504 748 })); 505 749 750 + /** 751 + * An object that can be null 752 + */ 506 753 export const zNullableObject = z.union([ 507 754 z.object({ 508 755 foo: z.string().optional() ··· 510 757 z.null() 511 758 ]).default(null); 512 759 760 + /** 761 + * Some % character 762 + */ 513 763 export const zCharactersInDescription = z.string(); 514 764 515 765 export const zModelWithNullableObject = z.object({ ··· 586 836 value: z.unknown().optional() 587 837 }); 588 838 839 + /** 840 + * Some description with `back ticks` 841 + */ 589 842 export const zModelWithBackticksInDescription = z.object({ 590 843 template: z.string().optional() 591 844 }); ··· 601 854 qux: z.number().int().gte(0) 602 855 })); 603 856 857 + /** 858 + * Model used to test deduplication strategy (unused) 859 + */ 604 860 export const zParameterSimpleParameterUnused = z.string(); 605 861 862 + /** 863 + * Model used to test deduplication strategy 864 + */ 606 865 export const zPostServiceWithEmptyTagResponse = z.string(); 607 866 867 + /** 868 + * Model used to test deduplication strategy 869 + */ 608 870 export const zPostServiceWithEmptyTagResponse2 = z.string(); 609 871 872 + /** 873 + * Model used to test deduplication strategy 874 + */ 610 875 export const zDeleteFooData = z.string(); 611 876 877 + /** 878 + * Model used to test deduplication strategy 879 + */ 612 880 export const zDeleteFooData2 = z.string(); 613 881 882 + /** 883 + * Model with restricted keyword name 884 + */ 614 885 export const zImport = z.string(); 615 886 616 887 export const zSchemaWithFormRestrictedKeys = z.object({ ··· 635 906 })).optional() 636 907 }); 637 908 909 + /** 910 + * This schema was giving PascalCase transformations a hard time 911 + */ 638 912 export const zIoK8sApimachineryPkgApisMetaV1Preconditions = z.object({ 639 913 resourceVersion: z.string().optional(), 640 914 uid: z.string().optional() 641 915 }); 642 916 917 + /** 918 + * This schema was giving PascalCase transformations a hard time 919 + */ 643 920 export const zIoK8sApimachineryPkgApisMetaV1DeleteOptions = z.object({ 644 921 preconditions: zIoK8sApimachineryPkgApisMetaV1Preconditions.optional() 645 922 }); ··· 691 968 zModelWithReadOnlyAndWriteOnly 692 969 ]); 693 970 971 + /** 972 + * Success 973 + */ 694 974 export const zApiVVersionODataControllerCountResponse = zModelFromZendesk; 695 975 976 + /** 977 + * Response is a simple number 978 + */ 696 979 export const zGetApiVbyApiVersionSimpleOperationResponse = z.number(); 697 980 698 981 export const zPostCallWithOptionalParamResponse = z.union([ ··· 700 983 z.void() 701 984 ]); 702 985 986 + /** 987 + * Success 988 + */ 703 989 export const zCallWithNoContentResponseResponse = z.void(); 704 990 705 991 export const zCallWithResponseAndNoContentResponseResponse = z.union([ ··· 709 995 710 996 export const zDummyAResponse = z400; 711 997 998 + /** 999 + * Success 1000 + */ 712 1001 export const zDummyBResponse = z.void(); 713 1002 714 1003 export const zCallWithResponseResponse = zImport; ··· 737 1026 738 1027 export const zUploadFileResponse = z.boolean(); 739 1028 1029 + /** 1030 + * Success 1031 + */ 740 1032 export const zFileResponseResponse = z.string(); 741 1033 1034 + /** 1035 + * Successful response 1036 + */ 742 1037 export const zComplexTypesResponse = z.array(zModelWithString); 743 1038 1039 + /** 1040 + * OK 1041 + */ 744 1042 export const zMultipartResponseResponse = z.object({ 745 1043 file: z.string().optional(), 746 1044 metadata: z.object({ ··· 749 1047 }).optional() 750 1048 }); 751 1049 1050 + /** 1051 + * Success 1052 + */ 752 1053 export const zComplexParamsResponse = zModelWithString; 753 1054 1055 + /** 1056 + * Successful response 1057 + */ 754 1058 export const zNonAsciiæøåÆøÅöôêÊ字符串Response = z.array(zNonAsciiStringæøåÆøÅöôêÊ字符串);
+3
packages/openapi-ts-tests/test/__snapshots__/3.1.x/validators-circular-ref/valibot.gen.ts
··· 12 12 foo: v.optional(vBar) 13 13 }); 14 14 15 + /** 16 + * description caused circular reference error 17 + */ 15 18 export const vQux: v.GenericSchema = v.lazy(() => { 16 19 return vQux; 17 20 });
+3
packages/openapi-ts-tests/test/__snapshots__/3.1.x/validators-circular-ref/zod.gen.ts
··· 12 12 foo: zBar.optional() 13 13 }); 14 14 15 + /** 16 + * description caused circular reference error 17 + */ 15 18 export const zQux: z.ZodTypeAny = z.lazy(() => { 16 19 return zQux; 17 20 });
+21
packages/openapi-ts-tests/test/__snapshots__/test/generated/v3-types-PascalCase/types.gen.ts.snap
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 462 465 * This is a model with one property with a 'any of' relationship where the options are not $ref 463 466 */ 464 467 export type CompositionWithNestedAnyOfAndNull = { 468 + /** 469 + * Scopes 470 + */ 465 471 propA?: Array<_3eNum1Период | ConstValue> | null; 466 472 }; 467 473 ··· 622 628 }; 623 629 624 630 export type File = { 631 + /** 632 + * Id 633 + */ 625 634 readonly id?: string; 635 + /** 636 + * Updated at 637 + */ 626 638 readonly updated_at?: string; 639 + /** 640 + * Created at 641 + */ 627 642 readonly created_at?: string; 643 + /** 644 + * Mime 645 + */ 628 646 mime: string; 647 + /** 648 + * File 649 + */ 629 650 readonly file?: string; 630 651 }; 631 652
+21
packages/openapi-ts-tests/test/__snapshots__/test/generated/v3_no_index/types.gen.ts.snap
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 462 465 * This is a model with one property with a 'any of' relationship where the options are not $ref 463 466 */ 464 467 export type CompositionWithNestedAnyOfAndNull = { 468 + /** 469 + * Scopes 470 + */ 465 471 propA?: Array<_3eNum1Период | ConstValue> | null; 466 472 }; 467 473 ··· 622 628 }; 623 629 624 630 export type File = { 631 + /** 632 + * Id 633 + */ 625 634 readonly id?: string; 635 + /** 636 + * Updated at 637 + */ 626 638 readonly updated_at?: string; 639 + /** 640 + * Created at 641 + */ 627 642 readonly created_at?: string; 643 + /** 644 + * Mime 645 + */ 628 646 mime: string; 647 + /** 648 + * File 649 + */ 629 650 readonly file?: string; 630 651 }; 631 652
+21
packages/openapi-ts-tests/test/__snapshots__/test/generated/v3_types/types.gen.ts.snap
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 462 465 * This is a model with one property with a 'any of' relationship where the options are not $ref 463 466 */ 464 467 export type CompositionWithNestedAnyOfAndNull = { 468 + /** 469 + * Scopes 470 + */ 465 471 propA?: Array<_3eNum1Период | ConstValue> | null; 466 472 }; 467 473 ··· 622 628 }; 623 629 624 630 export type File = { 631 + /** 632 + * Id 633 + */ 625 634 readonly id?: string; 635 + /** 636 + * Updated at 637 + */ 626 638 readonly updated_at?: string; 639 + /** 640 + * Created at 641 + */ 627 642 readonly created_at?: string; 643 + /** 644 + * Mime 645 + */ 628 646 mime: string; 647 + /** 648 + * File 649 + */ 629 650 readonly file?: string; 630 651 }; 631 652
+21
packages/openapi-ts-tests/test/__snapshots__/test/generated/v3_types_no_tree/types.gen.ts.snap
··· 306 306 * This is a model with one enum with escaped name 307 307 */ 308 308 export type ModelWithEnumWithHyphen = { 309 + /** 310 + * Foo-Bar-Baz-Qux 311 + */ 309 312 'foo-bar-baz-qux'?: '3.0'; 310 313 }; 311 314 ··· 462 465 * This is a model with one property with a 'any of' relationship where the options are not $ref 463 466 */ 464 467 export type CompositionWithNestedAnyOfAndNull = { 468 + /** 469 + * Scopes 470 + */ 465 471 propA?: Array<_3eNum1Период | ConstValue> | null; 466 472 }; 467 473 ··· 622 628 }; 623 629 624 630 export type File = { 631 + /** 632 + * Id 633 + */ 625 634 readonly id?: string; 635 + /** 636 + * Updated at 637 + */ 626 638 readonly updated_at?: string; 639 + /** 640 + * Created at 641 + */ 627 642 readonly created_at?: string; 643 + /** 644 + * Mime 645 + */ 628 646 mime: string; 647 + /** 648 + * File 649 + */ 629 650 readonly file?: string; 630 651 }; 631 652
+2
packages/openapi-ts-tests/test/openapi-ts.config.ts
··· 123 123 // name: '@tanstack/react-query', 124 124 }, 125 125 { 126 + // comments: false, 126 127 // exportFromIndex: true, 127 128 name: 'valibot', 128 129 }, 129 130 { 131 + // comments: false, 130 132 // exportFromIndex: true, 131 133 name: 'zod', 132 134 },
+7 -20
packages/openapi-ts/src/plugins/@hey-api/typescript/plugin.ts
··· 5 5 import { operationResponsesMap } from '../../../ir/operation'; 6 6 import { deduplicateSchema } from '../../../ir/schema'; 7 7 import type { IR } from '../../../ir/types'; 8 - import { escapeComment } from '../../../utils/escape'; 9 8 import { irRef, isRefOpenApiComponent } from '../../../utils/ref'; 10 9 import { numberRegExp } from '../../../utils/regexp'; 11 10 import { stringCase } from '../../../utils/stringCase'; 12 11 import { fieldName } from '../../shared/utils/case'; 13 12 import { operationIrRef } from '../../shared/utils/ref'; 13 + import { createSchemaComment } from '../../shared/utils/schema'; 14 14 import type { Plugin } from '../../types'; 15 15 import { createClientOptions } from './clientOptions'; 16 16 import { typesId } from './ref'; ··· 29 29 accessScope?: 'read' | 'write'; 30 30 } 31 31 32 - const parseSchemaJsDoc = ({ schema }: { schema: IR.SchemaObject }) => { 33 - const comments = [ 34 - schema.description && escapeComment(schema.description), 35 - schema.deprecated && '@deprecated', 36 - ].filter(Boolean); 37 - 38 - if (!comments.length) { 39 - return; 40 - } 41 - 42 - return comments; 43 - }; 44 - 45 32 const scopeToRef = ({ 46 33 $ref, 47 34 accessScope, ··· 139 126 }); 140 127 const node = compiler.constVariable({ 141 128 assertion: 'const', 142 - comment: parseSchemaJsDoc({ schema }), 129 + comment: createSchemaComment({ schema }), 143 130 exportConst: true, 144 131 expression, 145 132 name: identifier.name || '', ··· 206 193 } 207 194 208 195 return { 209 - comments: parseSchemaJsDoc({ schema: item }), 196 + comments: createSchemaComment({ schema: item }), 210 197 key, 211 198 value: item.const, 212 199 }; ··· 263 250 264 251 if (type) { 265 252 const node = compiler.typeAliasDeclaration({ 266 - comment: parseSchemaJsDoc({ schema }), 253 + comment: createSchemaComment({ schema }), 267 254 exportType: true, 268 255 name: identifier.name || '', 269 256 type, ··· 320 307 } 321 308 322 309 const node = compiler.enumDeclaration({ 323 - leadingComment: parseSchemaJsDoc({ schema }), 310 + leadingComment: createSchemaComment({ schema }), 324 311 name: identifier.name || '', 325 312 obj: enumObject.obj, 326 313 }); ··· 562 549 563 550 const isRequired = required.includes(name); 564 551 schemaProperties.push({ 565 - comment: parseSchemaJsDoc({ schema: property }), 552 + comment: createSchemaComment({ schema: property }), 566 553 isReadOnly: property.accessScope === 'read', 567 554 isRequired, 568 555 name: fieldName({ context, name }), ··· 1241 1228 namespace: 'type', 1242 1229 }); 1243 1230 const node = compiler.typeAliasDeclaration({ 1244 - comment: parseSchemaJsDoc({ schema }), 1231 + comment: createSchemaComment({ schema }), 1245 1232 exportType: true, 1246 1233 name: identifier.name || '', 1247 1234 type,
+4 -4
packages/openapi-ts/src/plugins/shared/utils/operation.ts
··· 11 11 }): Comments | undefined => { 12 12 const comments: Array<string> = []; 13 13 14 - if (operation.deprecated) { 15 - comments.push('@deprecated'); 16 - } 17 - 18 14 if (operation.summary) { 19 15 comments.push(escapeComment(operation.summary)); 20 16 } 21 17 22 18 if (operation.description) { 23 19 comments.push(escapeComment(operation.description)); 20 + } 21 + 22 + if (operation.deprecated) { 23 + comments.push('@deprecated'); 24 24 } 25 25 26 26 return comments.length ? comments : undefined;
+25
packages/openapi-ts/src/plugins/shared/utils/schema.ts
··· 1 + import type { Comments } from '../../../compiler'; 2 + import type { IR } from '../../../ir/types'; 3 + import { escapeComment } from '../../../utils/escape'; 4 + 5 + export const createSchemaComment = ({ 6 + schema, 7 + }: { 8 + schema: IR.SchemaObject; 9 + }): Comments | undefined => { 10 + const comments: Array<string> = []; 11 + 12 + if (schema.title) { 13 + comments.push(escapeComment(schema.title)); 14 + } 15 + 16 + if (schema.description) { 17 + comments.push(escapeComment(schema.description)); 18 + } 19 + 20 + if (schema.deprecated) { 21 + comments.push('@deprecated'); 22 + } 23 + 24 + return comments.length ? comments : undefined; 25 + };
+1
packages/openapi-ts/src/plugins/valibot/config.ts
··· 6 6 _handler: handler, 7 7 _handlerLegacy: () => {}, 8 8 _tags: ['validator'], 9 + comments: true, 9 10 exportFromIndex: false, 10 11 name: 'valibot', 11 12 output: 'valibot',
+28
packages/openapi-ts/src/plugins/valibot/plugin.ts
··· 6 6 import type { IR } from '../../ir/types'; 7 7 import { numberRegExp } from '../../utils/regexp'; 8 8 import { operationIrRef } from '../shared/utils/ref'; 9 + import { createSchemaComment } from '../shared/utils/schema'; 9 10 import type { Plugin } from '../types'; 10 11 import { identifiers, valibotId } from './constants'; 11 12 import type { Config } from './types'; ··· 39 40 40 41 const arrayTypeToValibotSchema = ({ 41 42 context, 43 + plugin, 42 44 result, 43 45 schema, 44 46 }: { 45 47 context: IR.Context; 48 + plugin: Plugin.Instance<Config>; 46 49 result: Result; 47 50 schema: SchemaWithType<'array'>; 48 51 }): ts.CallExpression => { ··· 72 75 const itemExpressions = schema.items!.map((item) => { 73 76 const schemaPipes = schemaToValibotSchema({ 74 77 context, 78 + plugin, 75 79 result, 76 80 schema: item, 77 81 }); ··· 372 376 373 377 const objectTypeToValibotSchema = ({ 374 378 context, 379 + plugin, 375 380 result, 376 381 schema, 377 382 }: { 378 383 context: IR.Context; 384 + plugin: Plugin.Instance<Config>; 379 385 result: Result; 380 386 schema: SchemaWithType<'object'>; 381 387 }): { ··· 398 404 const schemaPipes = schemaToValibotSchema({ 399 405 context, 400 406 optional: !isRequired, 407 + plugin, 401 408 result, 402 409 schema: property, 403 410 }); ··· 610 617 611 618 const tupleTypeToValibotSchema = ({ 612 619 context, 620 + plugin, 613 621 result, 614 622 schema, 615 623 }: { 616 624 context: IR.Context; 625 + plugin: Plugin.Instance<Config>; 617 626 result: Result; 618 627 schema: SchemaWithType<'tuple'>; 619 628 }) => { ··· 645 654 const tupleElements = schema.items.map((item) => { 646 655 const schemaPipes = schemaToValibotSchema({ 647 656 context, 657 + plugin, 648 658 result, 649 659 schema: item, 650 660 }); ··· 722 732 723 733 const schemaTypeToValibotSchema = ({ 724 734 context, 735 + plugin, 725 736 result, 726 737 schema, 727 738 }: { 728 739 context: IR.Context; 740 + plugin: Plugin.Instance<Config>; 729 741 result: Result; 730 742 schema: IR.SchemaObject; 731 743 }): { ··· 737 749 return { 738 750 expression: arrayTypeToValibotSchema({ 739 751 context, 752 + plugin, 740 753 result, 741 754 schema: schema as SchemaWithType<'array'>, 742 755 }), ··· 780 793 case 'object': 781 794 return objectTypeToValibotSchema({ 782 795 context, 796 + plugin, 783 797 result, 784 798 schema: schema as SchemaWithType<'object'>, 785 799 }); ··· 794 808 return { 795 809 expression: tupleTypeToValibotSchema({ 796 810 context, 811 + plugin, 797 812 result, 798 813 schema: schema as SchemaWithType<'tuple'>, 799 814 }), ··· 825 840 const operationToValibotSchema = ({ 826 841 context, 827 842 operation, 843 + plugin, 828 844 result, 829 845 }: { 830 846 context: IR.Context; 831 847 operation: IR.OperationObject; 848 + plugin: Plugin.Instance<Config>; 832 849 result: Result; 833 850 }) => { 834 851 if (operation.responses) { ··· 843 860 type: 'response', 844 861 }), 845 862 context, 863 + plugin, 846 864 result, 847 865 schema: response, 848 866 }); ··· 854 872 $ref, 855 873 context, 856 874 optional, 875 + plugin, 857 876 result, 858 877 schema, 859 878 }: { ··· 868 887 * `.default()` which is handled in this function. 869 888 */ 870 889 optional?: boolean; 890 + plugin: Plugin.Instance<Config>; 871 891 result: Result; 872 892 schema: IR.SchemaObject; 873 893 }): Array<ts.Expression> => { ··· 907 927 const schemaPipes = schemaToValibotSchema({ 908 928 $ref: schema.$ref, 909 929 context, 930 + plugin, 910 931 result, 911 932 schema: ref, 912 933 }); ··· 947 968 } else if (schema.type) { 948 969 const valibotSchema = schemaTypeToValibotSchema({ 949 970 context, 971 + plugin, 950 972 result, 951 973 schema, 952 974 }); ··· 959 981 const itemTypes = schema.items.map((item) => { 960 982 const schemaPipes = schemaToValibotSchema({ 961 983 context, 984 + plugin, 962 985 result, 963 986 schema: item, 964 987 }); ··· 995 1018 } else { 996 1019 const schemaPipes = schemaToValibotSchema({ 997 1020 context, 1021 + plugin, 998 1022 result, 999 1023 schema, 1000 1024 }); ··· 1004 1028 // catch-all fallback for failed schemas 1005 1029 const valibotSchema = schemaTypeToValibotSchema({ 1006 1030 context, 1031 + plugin, 1007 1032 result, 1008 1033 schema: { 1009 1034 type: 'unknown', ··· 1065 1090 // emit nodes only if $ref points to a reusable component 1066 1091 if (identifier && identifier.name && identifier.created) { 1067 1092 const statement = compiler.constVariable({ 1093 + comment: plugin.comments ? createSchemaComment({ schema }) : undefined, 1068 1094 exportConst: true, 1069 1095 expression: pipesToExpression(pipes), 1070 1096 name: identifier.name, ··· 1106 1132 operationToValibotSchema({ 1107 1133 context, 1108 1134 operation, 1135 + plugin, 1109 1136 result, 1110 1137 }); 1111 1138 }); ··· 1119 1146 schemaToValibotSchema({ 1120 1147 $ref, 1121 1148 context, 1149 + plugin, 1122 1150 result, 1123 1151 schema, 1124 1152 });
+6
packages/openapi-ts/src/plugins/valibot/types.d.ts
··· 3 3 4 4 export interface Config extends Plugin.Name<'valibot'> { 5 5 /** 6 + * Add comments from input to the generated Valibot schemas? 7 + * 8 + * @default true 9 + */ 10 + comments?: boolean; 11 + /** 6 12 * Should the exports from the generated files be re-exported in the index 7 13 * barrel file? 8 14 *
+1
packages/openapi-ts/src/plugins/zod/config.ts
··· 6 6 _handler: handler, 7 7 _handlerLegacy: () => {}, 8 8 _tags: ['validator'], 9 + comments: true, 9 10 exportFromIndex: false, 10 11 name: 'zod', 11 12 output: 'zod',
+24
packages/openapi-ts/src/plugins/zod/plugin.ts
··· 6 6 import type { IR } from '../../ir/types'; 7 7 import { numberRegExp } from '../../utils/regexp'; 8 8 import { operationIrRef } from '../shared/utils/ref'; 9 + import { createSchemaComment } from '../shared/utils/schema'; 9 10 import type { Plugin } from '../types'; 10 11 import type { Config } from './types'; 11 12 ··· 42 43 43 44 const arrayTypeToZodSchema = ({ 44 45 context, 46 + plugin, 45 47 result, 46 48 schema, 47 49 }: { 48 50 context: IR.Context; 51 + plugin: Plugin.Instance<Config>; 49 52 result: Result; 50 53 schema: SchemaWithType<'array'>; 51 54 }): ts.CallExpression => { ··· 75 78 const itemExpressions = schema.items!.map((item) => 76 79 schemaToZodSchema({ 77 80 context, 81 + plugin, 78 82 result, 79 83 schema: item, 80 84 }), ··· 367 371 368 372 const objectTypeToZodSchema = ({ 369 373 context, 374 + plugin, 370 375 result, 371 376 schema, 372 377 }: { 373 378 context: IR.Context; 379 + plugin: Plugin.Instance<Config>; 374 380 result: Result; 375 381 schema: SchemaWithType<'object'>; 376 382 }): { ··· 393 399 const propertyExpression = schemaToZodSchema({ 394 400 context, 395 401 optional: !isRequired, 402 + plugin, 396 403 result, 397 404 schema: property, 398 405 }); ··· 694 701 695 702 const schemaTypeToZodSchema = ({ 696 703 context, 704 + plugin, 697 705 result, 698 706 schema, 699 707 }: { 700 708 context: IR.Context; 709 + plugin: Plugin.Instance<Config>; 701 710 result: Result; 702 711 schema: IR.SchemaObject; 703 712 }): { ··· 709 718 return { 710 719 expression: arrayTypeToZodSchema({ 711 720 context, 721 + plugin, 712 722 result, 713 723 schema: schema as SchemaWithType<'array'>, 714 724 }), ··· 752 762 case 'object': 753 763 return objectTypeToZodSchema({ 754 764 context, 765 + plugin, 755 766 result, 756 767 schema: schema as SchemaWithType<'object'>, 757 768 }); ··· 796 807 const operationToZodSchema = ({ 797 808 context, 798 809 operation, 810 + plugin, 799 811 result, 800 812 }: { 801 813 context: IR.Context; 802 814 operation: IR.OperationObject; 815 + plugin: Plugin.Instance<Config>; 803 816 result: Result; 804 817 }) => { 805 818 if (operation.responses) { ··· 814 827 type: 'response', 815 828 }), 816 829 context, 830 + plugin, 817 831 result, 818 832 schema: response, 819 833 }); ··· 825 839 $ref, 826 840 context, 827 841 optional, 842 + plugin, 828 843 result, 829 844 schema, 830 845 }: { ··· 839 854 * `.default()` which is handled in this function. 840 855 */ 841 856 optional?: boolean; 857 + plugin: Plugin.Instance<Config>; 842 858 result: Result; 843 859 schema: IR.SchemaObject; 844 860 }): ts.Expression => { ··· 878 894 expression = schemaToZodSchema({ 879 895 $ref: schema.$ref, 880 896 context, 897 + plugin, 881 898 result, 882 899 schema: ref, 883 900 }); ··· 916 933 } else if (schema.type) { 917 934 const zodSchema = schemaTypeToZodSchema({ 918 935 context, 936 + plugin, 919 937 result, 920 938 schema, 921 939 }); ··· 928 946 const itemTypes = schema.items.map((item) => 929 947 schemaToZodSchema({ 930 948 context, 949 + plugin, 931 950 result, 932 951 schema: item, 933 952 }), ··· 977 996 } else { 978 997 expression = schemaToZodSchema({ 979 998 context, 999 + plugin, 980 1000 result, 981 1001 schema, 982 1002 }); ··· 985 1005 // catch-all fallback for failed schemas 986 1006 const zodSchema = schemaTypeToZodSchema({ 987 1007 context, 1008 + plugin, 988 1009 result, 989 1010 schema: { 990 1011 type: 'unknown', ··· 1036 1057 // emit nodes only if $ref points to a reusable component 1037 1058 if (identifier && identifier.name && identifier.created) { 1038 1059 const statement = compiler.constVariable({ 1060 + comment: plugin.comments ? createSchemaComment({ schema }) : undefined, 1039 1061 exportConst: true, 1040 1062 expression: expression!, 1041 1063 name: identifier.name, ··· 1074 1096 operationToZodSchema({ 1075 1097 context, 1076 1098 operation, 1099 + plugin, 1077 1100 result, 1078 1101 }); 1079 1102 }); ··· 1087 1110 schemaToZodSchema({ 1088 1111 $ref, 1089 1112 context, 1113 + plugin, 1090 1114 result, 1091 1115 schema, 1092 1116 });
+6
packages/openapi-ts/src/plugins/zod/types.d.ts
··· 3 3 4 4 export interface Config extends Plugin.Name<'zod'> { 5 5 /** 6 + * Add comments from input to the generated Zod schemas? 7 + * 8 + * @default true 9 + */ 10 + comments?: boolean; 11 + /** 6 12 * Should the exports from the generated files be re-exported in the index 7 13 * barrel file? 8 14 *