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 #2630 from hey-api/fix/anyof-string-binary

fix(typescript): handle string and binary string in composite keywords

authored by

Lubos and committed by
GitHub
4fb0e1ba 6e0f0603

+478 -403
+5
.changeset/purple-elephants-lie.md
··· 1 + --- 2 + '@hey-api/openapi-ts': patch 3 + --- 4 + 5 + fix(typescript): handle string and binary string in composite keywords
+8
packages/openapi-ts-tests/main/test/3.1.x.test.ts
··· 941 941 }), 942 942 description: 'webhook types and validator schemas', 943 943 }, 944 + { 945 + config: createConfig({ 946 + input: 'string-with-format.yaml', 947 + output: 'string-with-format', 948 + plugins: ['@hey-api/typescript', 'valibot', 'zod'], 949 + }), 950 + description: 'anyOf string and binary string', 951 + }, 944 952 ]; 945 953 946 954 it.each(scenarios)('$description', async ({ config }) => {
+1 -1
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/pattern-properties/types.gen.ts
··· 27 27 [key: string]: unknown; 28 28 } & { 29 29 level?: number; 30 - }) | (string | number) | ('user' | 'admin' | 'guest') | undefined; 30 + }) | string | number | 'user' | 'admin' | 'guest' | undefined; 31 31 }; 32 32 33 33 export type PatternPropertiesResponse = {
+3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/string-with-format/index.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + 3 + export * from './types.gen';
+9
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/string-with-format/types.gen.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + 3 + export type Foo = { 4 + foo?: Array<Blob | File | string>; 5 + }; 6 + 7 + export type ClientOptions = { 8 + baseUrl: `${string}://${string}` | (string & {}); 9 + };
+7
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/string-with-format/valibot.gen.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + 3 + import * as v from 'valibot'; 4 + 5 + export const vFoo = v.object({ 6 + foo: v.optional(v.array(v.unknown())) 7 + });
+10
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/string-with-format/zod.gen.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + 3 + import { z } from 'zod'; 4 + 5 + export const zFoo = z.object({ 6 + foo: z.optional(z.array(z.union([ 7 + z.string(), 8 + z.string() 9 + ]))) 10 + });
+13 -13
packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v2/types.gen.ts.snap
··· 12 12 /** 13 13 * This is a simple array with booleans 14 14 */ 15 - export type ArrayWithBooleans = Array<(boolean)>; 15 + export type ArrayWithBooleans = Array<boolean>; 16 16 17 17 /** 18 18 * This is a simple array with numbers 19 19 */ 20 - export type ArrayWithNumbers = Array<(number)>; 20 + export type ArrayWithNumbers = Array<number>; 21 21 22 22 /** 23 23 * This is a simple array with properties ··· 35 35 /** 36 36 * This is a simple array with strings 37 37 */ 38 - export type ArrayWithStrings = Array<(string)>; 38 + export type ArrayWithStrings = Array<string>; 39 39 40 40 /** 41 41 * Testing backticks in string: `backticks` and ```multiple backticks``` should work ··· 92 92 */ 93 93 export type DictionaryWithDictionary = { 94 94 [key: string]: { 95 - [key: string]: (string); 95 + [key: string]: string; 96 96 }; 97 97 }; 98 98 ··· 117 117 * This is a string dictionary 118 118 */ 119 119 export type DictionaryWithString = { 120 - [key: string]: (string); 120 + [key: string]: string; 121 121 }; 122 122 123 123 /** ··· 218 218 */ 219 219 export type ModelWithArray = { 220 220 prop?: Array<ModelWithString>; 221 - propWithFile?: Array<((Blob | File))>; 222 - propWithNumber?: Array<(number)>; 221 + propWithFile?: Array<Blob | File>; 222 + propWithNumber?: Array<number>; 223 223 }; 224 224 225 225 /** ··· 244 244 */ 245 245 export type ModelWithDictionary = { 246 246 prop?: { 247 - [key: string]: (string); 247 + [key: string]: string; 248 248 }; 249 249 }; 250 250 ··· 330 330 */ 331 331 export type ModelWithNestedEnums = { 332 332 dictionaryWithEnum?: { 333 - [key: string]: ('Success' | 'Warning' | 'Error'); 333 + [key: string]: 'Success' | 'Warning' | 'Error'; 334 334 }; 335 335 dictionaryWithEnumFromDescription?: { 336 - [key: string]: (number); 336 + [key: string]: number; 337 337 }; 338 - arrayWithEnum?: Array<('Success' | 'Warning' | 'Error')>; 339 - arrayWithDescription?: Array<(number)>; 338 + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; 339 + arrayWithDescription?: Array<number>; 340 340 }; 341 341 342 342 /** ··· 461 461 /** 462 462 * This is a simple file 463 463 */ 464 - export type SimpleFile = (Blob | File); 464 + export type SimpleFile = Blob | File; 465 465 466 466 /** 467 467 * This is a simple number
+32 -32
packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v3/types.gen.ts.snap
··· 23 23 24 24 export type AdditionalPropertiesIntegerIssue = { 25 25 value: number; 26 - [key: string]: (number) | undefined; 26 + [key: string]: number | undefined; 27 27 }; 28 28 29 29 export type AdditionalPropertiesUnknownIssue = { ··· 72 72 /** 73 73 * This is a simple array with booleans 74 74 */ 75 - export type ArrayWithBooleans = Array<(boolean)>; 75 + export type ArrayWithBooleans = Array<boolean>; 76 76 77 77 /** 78 78 * This is a simple array with numbers 79 79 */ 80 - export type ArrayWithNumbers = Array<(number)>; 80 + export type ArrayWithNumbers = Array<number>; 81 81 82 82 /** 83 83 * This is a simple array with properties ··· 95 95 /** 96 96 * This is a simple array with strings 97 97 */ 98 - export type ArrayWithStrings = Array<(string)>; 98 + export type ArrayWithStrings = Array<string>; 99 99 100 100 /** 101 101 * Testing multiline comments in string: First line ··· 252 252 */ 253 253 export type CompositionWithOneOfAndSimpleArrayDictionary = { 254 254 propA?: (boolean | { 255 - [key: string]: Array<(boolean)>; 255 + [key: string]: Array<boolean>; 256 256 }); 257 257 }; 258 258 ··· 261 261 */ 262 262 export type CompositionWithOneOfAndSimpleDictionary = { 263 263 propA?: (boolean | { 264 - [key: string]: (number); 264 + [key: string]: number; 265 265 }); 266 266 }; 267 267 ··· 315 315 */ 316 316 export type DictionaryWithDictionary = { 317 317 [key: string]: { 318 - [key: string]: (string); 318 + [key: string]: string; 319 319 }; 320 320 }; 321 321 ··· 332 332 export type DictionaryWithPropertiesAndAdditionalProperties = { 333 333 foo?: number; 334 334 bar?: boolean; 335 - [key: string]: (string | number | boolean) | undefined; 335 + [key: string]: string | number | boolean | undefined; 336 336 }; 337 337 338 338 /** ··· 346 346 * This is a string dictionary 347 347 */ 348 348 export type DictionaryWithString = { 349 - [key: string]: (string); 349 + [key: string]: string; 350 350 }; 351 351 352 352 /** ··· 581 581 */ 582 582 export type ModelWithArray = { 583 583 prop?: Array<ModelWithString>; 584 - propWithFile?: Array<((Blob | File))>; 585 - propWithNumber?: Array<(number)>; 584 + propWithFile?: Array<Blob | File>; 585 + propWithNumber?: Array<number>; 586 586 }; 587 587 588 588 /** ··· 590 590 */ 591 591 export type ModelWithArrayReadOnlyAndWriteOnly = { 592 592 prop?: Array<ModelWithReadOnlyAndWriteOnly>; 593 - propWithFile?: Array<((Blob | File))>; 594 - propWithNumber?: Array<(number)>; 593 + propWithFile?: Array<Blob | File>; 594 + propWithNumber?: Array<number>; 595 595 }; 596 596 597 597 /** ··· 664 664 */ 665 665 export type ModelWithDictionary = { 666 666 prop?: { 667 - [key: string]: (string); 667 + [key: string]: string; 668 668 }; 669 669 }; 670 670 ··· 759 759 }; 760 760 761 761 export type ModelWithNestedArrayEnums = { 762 - array_strings?: Array<(string)>; 762 + array_strings?: Array<string>; 763 763 data?: (ModelWithNestedArrayEnumsData); 764 764 }; 765 765 ··· 791 791 */ 792 792 export type ModelWithNestedEnums = { 793 793 dictionaryWithEnum?: { 794 - [key: string]: ('Success' | 'Warning' | 'Error'); 794 + [key: string]: 'Success' | 'Warning' | 'Error'; 795 795 }; 796 796 dictionaryWithEnumFromDescription?: { 797 - [key: string]: (number); 797 + [key: string]: number; 798 798 }; 799 - arrayWithEnum?: Array<('Success' | 'Warning' | 'Error')>; 800 - arrayWithDescription?: Array<(number)>; 799 + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; 800 + arrayWithDescription?: Array<number>; 801 801 /** 802 802 * This is a simple enum with strings 803 803 */ ··· 1021 1021 export type Pageable = { 1022 1022 page?: number; 1023 1023 size?: number; 1024 - sort?: Array<(string)>; 1024 + sort?: Array<string>; 1025 1025 }; 1026 1026 1027 1027 /** ··· 1079 1079 /** 1080 1080 * This is a simple file 1081 1081 */ 1082 - export type SimpleFile = (Blob | File); 1082 + export type SimpleFile = Blob | File; 1083 1083 1084 1084 /** 1085 1085 * This is a simple number ··· 1105 1105 /** 1106 1106 * This is an array parameter that is sent as csv format (comma-separated values) 1107 1107 */ 1108 - parameterArrayCsv: Array<(string)> | null; 1108 + parameterArrayCsv: Array<string> | null; 1109 1109 /** 1110 1110 * This is an array parameter that is sent as multi format (multiple parameter instances) 1111 1111 */ 1112 - parameterArrayMulti: Array<(string)> | null; 1112 + parameterArrayMulti: Array<string> | null; 1113 1113 /** 1114 1114 * This is an array parameter that is sent as pipes format (pipe-separated values) 1115 1115 */ 1116 - parameterArrayPipes: Array<(string)> | null; 1116 + parameterArrayPipes: Array<string> | null; 1117 1117 /** 1118 1118 * This is an array parameter that is sent as ssv format (space-separated values) 1119 1119 */ 1120 - parameterArraySsv: Array<(string)> | null; 1120 + parameterArraySsv: Array<string> | null; 1121 1121 /** 1122 1122 * This is an array parameter that is sent as tsv format (tab-separated values) 1123 1123 */ 1124 - parameterArrayTsv: Array<(string)> | null; 1124 + parameterArrayTsv: Array<string> | null; 1125 1125 }; 1126 1126 1127 1127 export type ComplexTypesData = { ··· 1151 1151 enabled?: boolean; 1152 1152 readonly type: 'Monkey' | 'Horse' | 'Bird'; 1153 1153 listOfModels?: Array<ModelWithString> | null; 1154 - listOfStrings?: Array<(string)> | null; 1154 + listOfStrings?: Array<string> | null; 1155 1155 parameters: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); 1156 1156 readonly user?: { 1157 1157 readonly id?: number; ··· 1313 1313 id: string; 1314 1314 }; 1315 1315 1316 - export type FileResponseResponse = ((Blob | File)); 1316 + export type FileResponseResponse = (Blob | File); 1317 1317 1318 1318 export type PostApiFormDataData = { 1319 1319 /** ··· 1330 1330 1331 1331 export type MultipartRequestData = { 1332 1332 formData?: { 1333 - content?: (Blob | File); 1333 + content?: Blob | File; 1334 1334 data?: ((ModelWithString) | null); 1335 1335 }; 1336 1336 }; 1337 1337 1338 1338 export type MultipartResponseResponse = ({ 1339 - file?: (Blob | File); 1339 + file?: Blob | File; 1340 1340 metadata?: { 1341 1341 foo?: string; 1342 1342 bar?: string; ··· 1498 1498 /** 1499 1499 * This is an array parameter 1500 1500 */ 1501 - parameterArray: Array<(string)> | null; 1501 + parameterArray: Array<string> | null; 1502 1502 /** 1503 1503 * This is a boolean parameter 1504 1504 */ ··· 1543 1543 }); 1544 1544 1545 1545 export type UploadFileData = { 1546 - formData: (Blob | File); 1546 + formData: Blob | File; 1547 1547 }; 1548 1548 1549 1549 export type UploadFileResponse = (boolean);
+32 -32
packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v3_angular/types.gen.ts.snap
··· 18 18 19 19 export type AdditionalPropertiesIntegerIssue = { 20 20 value: number; 21 - [key: string]: (number) | undefined; 21 + [key: string]: number | undefined; 22 22 }; 23 23 24 24 export type AdditionalPropertiesUnknownIssue = { ··· 67 67 /** 68 68 * This is a simple array with booleans 69 69 */ 70 - export type ArrayWithBooleans = Array<(boolean)>; 70 + export type ArrayWithBooleans = Array<boolean>; 71 71 72 72 /** 73 73 * This is a simple array with numbers 74 74 */ 75 - export type ArrayWithNumbers = Array<(number)>; 75 + export type ArrayWithNumbers = Array<number>; 76 76 77 77 /** 78 78 * This is a simple array with properties ··· 90 90 /** 91 91 * This is a simple array with strings 92 92 */ 93 - export type ArrayWithStrings = Array<(string)>; 93 + export type ArrayWithStrings = Array<string>; 94 94 95 95 /** 96 96 * Testing multiline comments in string: First line ··· 247 247 */ 248 248 export type CompositionWithOneOfAndSimpleArrayDictionary = { 249 249 propA?: (boolean | { 250 - [key: string]: Array<(boolean)>; 250 + [key: string]: Array<boolean>; 251 251 }); 252 252 }; 253 253 ··· 256 256 */ 257 257 export type CompositionWithOneOfAndSimpleDictionary = { 258 258 propA?: (boolean | { 259 - [key: string]: (number); 259 + [key: string]: number; 260 260 }); 261 261 }; 262 262 ··· 310 310 */ 311 311 export type DictionaryWithDictionary = { 312 312 [key: string]: { 313 - [key: string]: (string); 313 + [key: string]: string; 314 314 }; 315 315 }; 316 316 ··· 327 327 export type DictionaryWithPropertiesAndAdditionalProperties = { 328 328 foo?: number; 329 329 bar?: boolean; 330 - [key: string]: (string | number | boolean) | undefined; 330 + [key: string]: string | number | boolean | undefined; 331 331 }; 332 332 333 333 /** ··· 341 341 * This is a string dictionary 342 342 */ 343 343 export type DictionaryWithString = { 344 - [key: string]: (string); 344 + [key: string]: string; 345 345 }; 346 346 347 347 /** ··· 511 511 */ 512 512 export type ModelWithArray = { 513 513 prop?: Array<ModelWithString>; 514 - propWithFile?: Array<((Blob | File))>; 515 - propWithNumber?: Array<(number)>; 514 + propWithFile?: Array<Blob | File>; 515 + propWithNumber?: Array<number>; 516 516 }; 517 517 518 518 /** ··· 520 520 */ 521 521 export type ModelWithArrayReadOnlyAndWriteOnly = { 522 522 prop?: Array<ModelWithReadOnlyAndWriteOnly>; 523 - propWithFile?: Array<((Blob | File))>; 524 - propWithNumber?: Array<(number)>; 523 + propWithFile?: Array<Blob | File>; 524 + propWithNumber?: Array<number>; 525 525 }; 526 526 527 527 /** ··· 594 594 */ 595 595 export type ModelWithDictionary = { 596 596 prop?: { 597 - [key: string]: (string); 597 + [key: string]: string; 598 598 }; 599 599 }; 600 600 ··· 689 689 }; 690 690 691 691 export type ModelWithNestedArrayEnums = { 692 - array_strings?: Array<(string)>; 692 + array_strings?: Array<string>; 693 693 data?: (ModelWithNestedArrayEnumsData); 694 694 }; 695 695 ··· 711 711 */ 712 712 export type ModelWithNestedEnums = { 713 713 dictionaryWithEnum?: { 714 - [key: string]: ('Success' | 'Warning' | 'Error'); 714 + [key: string]: 'Success' | 'Warning' | 'Error'; 715 715 }; 716 716 dictionaryWithEnumFromDescription?: { 717 - [key: string]: (number); 717 + [key: string]: number; 718 718 }; 719 - arrayWithEnum?: Array<('Success' | 'Warning' | 'Error')>; 720 - arrayWithDescription?: Array<(number)>; 719 + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; 720 + arrayWithDescription?: Array<number>; 721 721 /** 722 722 * This is a simple enum with strings 723 723 */ ··· 941 941 export type Pageable = { 942 942 page?: number; 943 943 size?: number; 944 - sort?: Array<(string)>; 944 + sort?: Array<string>; 945 945 }; 946 946 947 947 /** ··· 999 999 /** 1000 1000 * This is a simple file 1001 1001 */ 1002 - export type SimpleFile = (Blob | File); 1002 + export type SimpleFile = Blob | File; 1003 1003 1004 1004 /** 1005 1005 * This is a simple number ··· 1025 1025 /** 1026 1026 * This is an array parameter that is sent as csv format (comma-separated values) 1027 1027 */ 1028 - parameterArrayCsv: Array<(string)> | null; 1028 + parameterArrayCsv: Array<string> | null; 1029 1029 /** 1030 1030 * This is an array parameter that is sent as multi format (multiple parameter instances) 1031 1031 */ 1032 - parameterArrayMulti: Array<(string)> | null; 1032 + parameterArrayMulti: Array<string> | null; 1033 1033 /** 1034 1034 * This is an array parameter that is sent as pipes format (pipe-separated values) 1035 1035 */ 1036 - parameterArrayPipes: Array<(string)> | null; 1036 + parameterArrayPipes: Array<string> | null; 1037 1037 /** 1038 1038 * This is an array parameter that is sent as ssv format (space-separated values) 1039 1039 */ 1040 - parameterArraySsv: Array<(string)> | null; 1040 + parameterArraySsv: Array<string> | null; 1041 1041 /** 1042 1042 * This is an array parameter that is sent as tsv format (tab-separated values) 1043 1043 */ 1044 - parameterArrayTsv: Array<(string)> | null; 1044 + parameterArrayTsv: Array<string> | null; 1045 1045 }; 1046 1046 1047 1047 export type ComplexTypesData = { ··· 1071 1071 enabled?: boolean; 1072 1072 readonly type: 'Monkey' | 'Horse' | 'Bird'; 1073 1073 listOfModels?: Array<ModelWithString> | null; 1074 - listOfStrings?: Array<(string)> | null; 1074 + listOfStrings?: Array<string> | null; 1075 1075 parameters: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); 1076 1076 readonly user?: { 1077 1077 readonly id?: number; ··· 1233 1233 id: string; 1234 1234 }; 1235 1235 1236 - export type FileResponseResponse = ((Blob | File)); 1236 + export type FileResponseResponse = (Blob | File); 1237 1237 1238 1238 export type PostApiFormDataData = { 1239 1239 /** ··· 1250 1250 1251 1251 export type MultipartRequestData = { 1252 1252 formData?: { 1253 - content?: (Blob | File); 1253 + content?: Blob | File; 1254 1254 data?: ((ModelWithString) | null); 1255 1255 }; 1256 1256 }; 1257 1257 1258 1258 export type MultipartResponseResponse = ({ 1259 - file?: (Blob | File); 1259 + file?: Blob | File; 1260 1260 metadata?: { 1261 1261 foo?: string; 1262 1262 bar?: string; ··· 1418 1418 /** 1419 1419 * This is an array parameter 1420 1420 */ 1421 - parameterArray: Array<(string)> | null; 1421 + parameterArray: Array<string> | null; 1422 1422 /** 1423 1423 * This is a boolean parameter 1424 1424 */ ··· 1463 1463 }); 1464 1464 1465 1465 export type UploadFileData = { 1466 - formData: (Blob | File); 1466 + formData: Blob | File; 1467 1467 }; 1468 1468 1469 1469 export type UploadFileResponse = (boolean);
+3 -3
packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v3_angular_transform/types.gen.ts.snap
··· 22 22 'nullable-date'?: Array<(Date | null)>; 23 23 simpleItems?: Array<SimpleModel>; 24 24 simpleItem?: SimpleModel; 25 - dates?: Array<(Date)>; 26 - strings?: Array<(string)>; 25 + dates?: Array<Date>; 26 + strings?: Array<string>; 27 27 }; 28 28 29 29 /** ··· 41 41 42 42 export type ModelWithDatesArrayResponse = (Array<ModelWithDates>); 43 43 44 - export type ArrayOfDatesResponse = (Array<(Date)>); 44 + export type ArrayOfDatesResponse = (Array<Date>); 45 45 46 46 export type DateResponse = (Date); 47 47
+32 -32
packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v3_angular_tree_shakeable/types.gen.ts.snap
··· 18 18 19 19 export type AdditionalPropertiesIntegerIssue = { 20 20 value: number; 21 - [key: string]: (number) | undefined; 21 + [key: string]: number | undefined; 22 22 }; 23 23 24 24 export type AdditionalPropertiesUnknownIssue = { ··· 67 67 /** 68 68 * This is a simple array with booleans 69 69 */ 70 - export type ArrayWithBooleans = Array<(boolean)>; 70 + export type ArrayWithBooleans = Array<boolean>; 71 71 72 72 /** 73 73 * This is a simple array with numbers 74 74 */ 75 - export type ArrayWithNumbers = Array<(number)>; 75 + export type ArrayWithNumbers = Array<number>; 76 76 77 77 /** 78 78 * This is a simple array with properties ··· 90 90 /** 91 91 * This is a simple array with strings 92 92 */ 93 - export type ArrayWithStrings = Array<(string)>; 93 + export type ArrayWithStrings = Array<string>; 94 94 95 95 /** 96 96 * Testing multiline comments in string: First line ··· 247 247 */ 248 248 export type CompositionWithOneOfAndSimpleArrayDictionary = { 249 249 propA?: (boolean | { 250 - [key: string]: Array<(boolean)>; 250 + [key: string]: Array<boolean>; 251 251 }); 252 252 }; 253 253 ··· 256 256 */ 257 257 export type CompositionWithOneOfAndSimpleDictionary = { 258 258 propA?: (boolean | { 259 - [key: string]: (number); 259 + [key: string]: number; 260 260 }); 261 261 }; 262 262 ··· 310 310 */ 311 311 export type DictionaryWithDictionary = { 312 312 [key: string]: { 313 - [key: string]: (string); 313 + [key: string]: string; 314 314 }; 315 315 }; 316 316 ··· 327 327 export type DictionaryWithPropertiesAndAdditionalProperties = { 328 328 foo?: number; 329 329 bar?: boolean; 330 - [key: string]: (string | number | boolean) | undefined; 330 + [key: string]: string | number | boolean | undefined; 331 331 }; 332 332 333 333 /** ··· 341 341 * This is a string dictionary 342 342 */ 343 343 export type DictionaryWithString = { 344 - [key: string]: (string); 344 + [key: string]: string; 345 345 }; 346 346 347 347 /** ··· 511 511 */ 512 512 export type ModelWithArray = { 513 513 prop?: Array<ModelWithString>; 514 - propWithFile?: Array<((Blob | File))>; 515 - propWithNumber?: Array<(number)>; 514 + propWithFile?: Array<Blob | File>; 515 + propWithNumber?: Array<number>; 516 516 }; 517 517 518 518 /** ··· 520 520 */ 521 521 export type ModelWithArrayReadOnlyAndWriteOnly = { 522 522 prop?: Array<ModelWithReadOnlyAndWriteOnly>; 523 - propWithFile?: Array<((Blob | File))>; 524 - propWithNumber?: Array<(number)>; 523 + propWithFile?: Array<Blob | File>; 524 + propWithNumber?: Array<number>; 525 525 }; 526 526 527 527 /** ··· 594 594 */ 595 595 export type ModelWithDictionary = { 596 596 prop?: { 597 - [key: string]: (string); 597 + [key: string]: string; 598 598 }; 599 599 }; 600 600 ··· 689 689 }; 690 690 691 691 export type ModelWithNestedArrayEnums = { 692 - array_strings?: Array<(string)>; 692 + array_strings?: Array<string>; 693 693 data?: (ModelWithNestedArrayEnumsData); 694 694 }; 695 695 ··· 711 711 */ 712 712 export type ModelWithNestedEnums = { 713 713 dictionaryWithEnum?: { 714 - [key: string]: ('Success' | 'Warning' | 'Error'); 714 + [key: string]: 'Success' | 'Warning' | 'Error'; 715 715 }; 716 716 dictionaryWithEnumFromDescription?: { 717 - [key: string]: (number); 717 + [key: string]: number; 718 718 }; 719 - arrayWithEnum?: Array<('Success' | 'Warning' | 'Error')>; 720 - arrayWithDescription?: Array<(number)>; 719 + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; 720 + arrayWithDescription?: Array<number>; 721 721 /** 722 722 * This is a simple enum with strings 723 723 */ ··· 941 941 export type Pageable = { 942 942 page?: number; 943 943 size?: number; 944 - sort?: Array<(string)>; 944 + sort?: Array<string>; 945 945 }; 946 946 947 947 /** ··· 999 999 /** 1000 1000 * This is a simple file 1001 1001 */ 1002 - export type SimpleFile = (Blob | File); 1002 + export type SimpleFile = Blob | File; 1003 1003 1004 1004 /** 1005 1005 * This is a simple number ··· 1308 1308 /** 1309 1309 * This is an array parameter that is sent as csv format (comma-separated values) 1310 1310 */ 1311 - parameterArrayCsv: Array<(string)> | null; 1311 + parameterArrayCsv: Array<string> | null; 1312 1312 /** 1313 1313 * This is an array parameter that is sent as multi format (multiple parameter instances) 1314 1314 */ 1315 - parameterArrayMulti: Array<(string)> | null; 1315 + parameterArrayMulti: Array<string> | null; 1316 1316 /** 1317 1317 * This is an array parameter that is sent as pipes format (pipe-separated values) 1318 1318 */ 1319 - parameterArrayPipes: Array<(string)> | null; 1319 + parameterArrayPipes: Array<string> | null; 1320 1320 /** 1321 1321 * This is an array parameter that is sent as ssv format (space-separated values) 1322 1322 */ 1323 - parameterArraySsv: Array<(string)> | null; 1323 + parameterArraySsv: Array<string> | null; 1324 1324 /** 1325 1325 * This is an array parameter that is sent as tsv format (tab-separated values) 1326 1326 */ 1327 - parameterArrayTsv: Array<(string)> | null; 1327 + parameterArrayTsv: Array<string> | null; 1328 1328 }; 1329 1329 1330 1330 export type TypesData = { ··· 1335 1335 /** 1336 1336 * This is an array parameter 1337 1337 */ 1338 - parameterArray: Array<(string)> | null; 1338 + parameterArray: Array<string> | null; 1339 1339 /** 1340 1340 * This is a boolean parameter 1341 1341 */ ··· 1380 1380 }); 1381 1381 1382 1382 export type UploadFileData = { 1383 - formData: (Blob | File); 1383 + formData: Blob | File; 1384 1384 }; 1385 1385 1386 1386 export type UploadFileResponse = (boolean); ··· 1389 1389 id: string; 1390 1390 }; 1391 1391 1392 - export type FileResponseResponse = ((Blob | File)); 1392 + export type FileResponseResponse = (Blob | File); 1393 1393 1394 1394 export type ComplexTypesData = { 1395 1395 /** ··· 1412 1412 1413 1413 export type MultipartRequestData = { 1414 1414 formData?: { 1415 - content?: (Blob | File); 1415 + content?: Blob | File; 1416 1416 data?: ((ModelWithString) | null); 1417 1417 }; 1418 1418 }; 1419 1419 1420 1420 export type MultipartResponseResponse = ({ 1421 - file?: (Blob | File); 1421 + file?: Blob | File; 1422 1422 metadata?: { 1423 1423 foo?: string; 1424 1424 bar?: string; ··· 1433 1433 enabled?: boolean; 1434 1434 readonly type: 'Monkey' | 'Horse' | 'Bird'; 1435 1435 listOfModels?: Array<ModelWithString> | null; 1436 - listOfStrings?: Array<(string)> | null; 1436 + listOfStrings?: Array<string> | null; 1437 1437 parameters: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); 1438 1438 readonly user?: { 1439 1439 readonly id?: number;
+3 -3
packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v3_angular_tree_shakeable_transform/types.gen.ts.snap
··· 22 22 'nullable-date'?: Array<(Date | null)>; 23 23 simpleItems?: Array<SimpleModel>; 24 24 simpleItem?: SimpleModel; 25 - dates?: Array<(Date)>; 26 - strings?: Array<(string)>; 25 + dates?: Array<Date>; 26 + strings?: Array<string>; 27 27 }; 28 28 29 29 /** ··· 41 41 42 42 export type ModelWithDatesArrayResponse = (Array<ModelWithDates>); 43 43 44 - export type ArrayOfDatesResponse = (Array<(Date)>); 44 + export type ArrayOfDatesResponse = (Array<Date>); 45 45 46 46 export type DateResponse = (Date); 47 47
+32 -32
packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v3_axios/types.gen.ts.snap
··· 23 23 24 24 export type AdditionalPropertiesIntegerIssue = { 25 25 value: number; 26 - [key: string]: (number) | undefined; 26 + [key: string]: number | undefined; 27 27 }; 28 28 29 29 export type AdditionalPropertiesUnknownIssue = { ··· 72 72 /** 73 73 * This is a simple array with booleans 74 74 */ 75 - export type ArrayWithBooleans = Array<(boolean)>; 75 + export type ArrayWithBooleans = Array<boolean>; 76 76 77 77 /** 78 78 * This is a simple array with numbers 79 79 */ 80 - export type ArrayWithNumbers = Array<(number)>; 80 + export type ArrayWithNumbers = Array<number>; 81 81 82 82 /** 83 83 * This is a simple array with properties ··· 95 95 /** 96 96 * This is a simple array with strings 97 97 */ 98 - export type ArrayWithStrings = Array<(string)>; 98 + export type ArrayWithStrings = Array<string>; 99 99 100 100 /** 101 101 * Testing multiline comments in string: First line ··· 252 252 */ 253 253 export type CompositionWithOneOfAndSimpleArrayDictionary = { 254 254 propA?: (boolean | { 255 - [key: string]: Array<(boolean)>; 255 + [key: string]: Array<boolean>; 256 256 }); 257 257 }; 258 258 ··· 261 261 */ 262 262 export type CompositionWithOneOfAndSimpleDictionary = { 263 263 propA?: (boolean | { 264 - [key: string]: (number); 264 + [key: string]: number; 265 265 }); 266 266 }; 267 267 ··· 315 315 */ 316 316 export type DictionaryWithDictionary = { 317 317 [key: string]: { 318 - [key: string]: (string); 318 + [key: string]: string; 319 319 }; 320 320 }; 321 321 ··· 332 332 export type DictionaryWithPropertiesAndAdditionalProperties = { 333 333 foo?: number; 334 334 bar?: boolean; 335 - [key: string]: (string | number | boolean) | undefined; 335 + [key: string]: string | number | boolean | undefined; 336 336 }; 337 337 338 338 /** ··· 346 346 * This is a string dictionary 347 347 */ 348 348 export type DictionaryWithString = { 349 - [key: string]: (string); 349 + [key: string]: string; 350 350 }; 351 351 352 352 /** ··· 581 581 */ 582 582 export type ModelWithArray = { 583 583 prop?: Array<ModelWithString>; 584 - propWithFile?: Array<((Blob | File))>; 585 - propWithNumber?: Array<(number)>; 584 + propWithFile?: Array<Blob | File>; 585 + propWithNumber?: Array<number>; 586 586 }; 587 587 588 588 /** ··· 590 590 */ 591 591 export type ModelWithArrayReadOnlyAndWriteOnly = { 592 592 prop?: Array<ModelWithReadOnlyAndWriteOnly>; 593 - propWithFile?: Array<((Blob | File))>; 594 - propWithNumber?: Array<(number)>; 593 + propWithFile?: Array<Blob | File>; 594 + propWithNumber?: Array<number>; 595 595 }; 596 596 597 597 /** ··· 664 664 */ 665 665 export type ModelWithDictionary = { 666 666 prop?: { 667 - [key: string]: (string); 667 + [key: string]: string; 668 668 }; 669 669 }; 670 670 ··· 759 759 }; 760 760 761 761 export type ModelWithNestedArrayEnums = { 762 - array_strings?: Array<(string)>; 762 + array_strings?: Array<string>; 763 763 data?: (ModelWithNestedArrayEnumsData); 764 764 }; 765 765 ··· 791 791 */ 792 792 export type ModelWithNestedEnums = { 793 793 dictionaryWithEnum?: { 794 - [key: string]: ('Success' | 'Warning' | 'Error'); 794 + [key: string]: 'Success' | 'Warning' | 'Error'; 795 795 }; 796 796 dictionaryWithEnumFromDescription?: { 797 - [key: string]: (number); 797 + [key: string]: number; 798 798 }; 799 - arrayWithEnum?: Array<('Success' | 'Warning' | 'Error')>; 800 - arrayWithDescription?: Array<(number)>; 799 + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; 800 + arrayWithDescription?: Array<number>; 801 801 /** 802 802 * This is a simple enum with strings 803 803 */ ··· 1021 1021 export type Pageable = { 1022 1022 page?: number; 1023 1023 size?: number; 1024 - sort?: Array<(string)>; 1024 + sort?: Array<string>; 1025 1025 }; 1026 1026 1027 1027 /** ··· 1079 1079 /** 1080 1080 * This is a simple file 1081 1081 */ 1082 - export type SimpleFile = (Blob | File); 1082 + export type SimpleFile = Blob | File; 1083 1083 1084 1084 /** 1085 1085 * This is a simple number ··· 1105 1105 /** 1106 1106 * This is an array parameter that is sent as csv format (comma-separated values) 1107 1107 */ 1108 - parameterArrayCsv: Array<(string)> | null; 1108 + parameterArrayCsv: Array<string> | null; 1109 1109 /** 1110 1110 * This is an array parameter that is sent as multi format (multiple parameter instances) 1111 1111 */ 1112 - parameterArrayMulti: Array<(string)> | null; 1112 + parameterArrayMulti: Array<string> | null; 1113 1113 /** 1114 1114 * This is an array parameter that is sent as pipes format (pipe-separated values) 1115 1115 */ 1116 - parameterArrayPipes: Array<(string)> | null; 1116 + parameterArrayPipes: Array<string> | null; 1117 1117 /** 1118 1118 * This is an array parameter that is sent as ssv format (space-separated values) 1119 1119 */ 1120 - parameterArraySsv: Array<(string)> | null; 1120 + parameterArraySsv: Array<string> | null; 1121 1121 /** 1122 1122 * This is an array parameter that is sent as tsv format (tab-separated values) 1123 1123 */ 1124 - parameterArrayTsv: Array<(string)> | null; 1124 + parameterArrayTsv: Array<string> | null; 1125 1125 }; 1126 1126 1127 1127 export type ComplexTypesData = { ··· 1151 1151 enabled?: boolean; 1152 1152 readonly type: 'Monkey' | 'Horse' | 'Bird'; 1153 1153 listOfModels?: Array<ModelWithString> | null; 1154 - listOfStrings?: Array<(string)> | null; 1154 + listOfStrings?: Array<string> | null; 1155 1155 parameters: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); 1156 1156 readonly user?: { 1157 1157 readonly id?: number; ··· 1313 1313 id: string; 1314 1314 }; 1315 1315 1316 - export type FileResponseResponse = ((Blob | File)); 1316 + export type FileResponseResponse = (Blob | File); 1317 1317 1318 1318 export type PostApiFormDataData = { 1319 1319 /** ··· 1330 1330 1331 1331 export type MultipartRequestData = { 1332 1332 formData?: { 1333 - content?: (Blob | File); 1333 + content?: Blob | File; 1334 1334 data?: ((ModelWithString) | null); 1335 1335 }; 1336 1336 }; 1337 1337 1338 1338 export type MultipartResponseResponse = ({ 1339 - file?: (Blob | File); 1339 + file?: Blob | File; 1340 1340 metadata?: { 1341 1341 foo?: string; 1342 1342 bar?: string; ··· 1498 1498 /** 1499 1499 * This is an array parameter 1500 1500 */ 1501 - parameterArray: Array<(string)> | null; 1501 + parameterArray: Array<string> | null; 1502 1502 /** 1503 1503 * This is a boolean parameter 1504 1504 */ ··· 1543 1543 }); 1544 1544 1545 1545 export type UploadFileData = { 1546 - formData: (Blob | File); 1546 + formData: Blob | File; 1547 1547 }; 1548 1548 1549 1549 export type UploadFileResponse = (boolean);
+3 -3
packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v3_axios_transform/types.gen.ts.snap
··· 22 22 'nullable-date'?: Array<(Date | null)>; 23 23 simpleItems?: Array<SimpleModel>; 24 24 simpleItem?: SimpleModel; 25 - dates?: Array<(Date)>; 26 - strings?: Array<(string)>; 25 + dates?: Array<Date>; 26 + strings?: Array<string>; 27 27 }; 28 28 29 29 /** ··· 41 41 42 42 export type ModelWithDatesArrayResponse = (Array<ModelWithDates>); 43 43 44 - export type ArrayOfDatesResponse = (Array<(Date)>); 44 + export type ArrayOfDatesResponse = (Array<Date>); 45 45 46 46 export type DateResponse = (Date); 47 47
+32 -32
packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v3_client/types.gen.ts.snap
··· 18 18 19 19 export type AdditionalPropertiesIntegerIssue = { 20 20 value: number; 21 - [key: string]: (number) | undefined; 21 + [key: string]: number | undefined; 22 22 }; 23 23 24 24 export type AdditionalPropertiesUnknownIssue = { ··· 67 67 /** 68 68 * This is a simple array with booleans 69 69 */ 70 - export type ArrayWithBooleans = Array<(boolean)>; 70 + export type ArrayWithBooleans = Array<boolean>; 71 71 72 72 /** 73 73 * This is a simple array with numbers 74 74 */ 75 - export type ArrayWithNumbers = Array<(number)>; 75 + export type ArrayWithNumbers = Array<number>; 76 76 77 77 /** 78 78 * This is a simple array with properties ··· 90 90 /** 91 91 * This is a simple array with strings 92 92 */ 93 - export type ArrayWithStrings = Array<(string)>; 93 + export type ArrayWithStrings = Array<string>; 94 94 95 95 /** 96 96 * Testing multiline comments in string: First line ··· 247 247 */ 248 248 export type CompositionWithOneOfAndSimpleArrayDictionary = { 249 249 propA?: (boolean | { 250 - [key: string]: Array<(boolean)>; 250 + [key: string]: Array<boolean>; 251 251 }); 252 252 }; 253 253 ··· 256 256 */ 257 257 export type CompositionWithOneOfAndSimpleDictionary = { 258 258 propA?: (boolean | { 259 - [key: string]: (number); 259 + [key: string]: number; 260 260 }); 261 261 }; 262 262 ··· 310 310 */ 311 311 export type DictionaryWithDictionary = { 312 312 [key: string]: { 313 - [key: string]: (string); 313 + [key: string]: string; 314 314 }; 315 315 }; 316 316 ··· 327 327 export type DictionaryWithPropertiesAndAdditionalProperties = { 328 328 foo?: number; 329 329 bar?: boolean; 330 - [key: string]: (string | number | boolean) | undefined; 330 + [key: string]: string | number | boolean | undefined; 331 331 }; 332 332 333 333 /** ··· 341 341 * This is a string dictionary 342 342 */ 343 343 export type DictionaryWithString = { 344 - [key: string]: (string); 344 + [key: string]: string; 345 345 }; 346 346 347 347 /** ··· 511 511 */ 512 512 export type ModelWithArray = { 513 513 prop?: Array<ModelWithString>; 514 - propWithFile?: Array<((Blob | File))>; 515 - propWithNumber?: Array<(number)>; 514 + propWithFile?: Array<Blob | File>; 515 + propWithNumber?: Array<number>; 516 516 }; 517 517 518 518 /** ··· 520 520 */ 521 521 export type ModelWithArrayReadOnlyAndWriteOnly = { 522 522 prop?: Array<ModelWithReadOnlyAndWriteOnly>; 523 - propWithFile?: Array<((Blob | File))>; 524 - propWithNumber?: Array<(number)>; 523 + propWithFile?: Array<Blob | File>; 524 + propWithNumber?: Array<number>; 525 525 }; 526 526 527 527 /** ··· 594 594 */ 595 595 export type ModelWithDictionary = { 596 596 prop?: { 597 - [key: string]: (string); 597 + [key: string]: string; 598 598 }; 599 599 }; 600 600 ··· 689 689 }; 690 690 691 691 export type ModelWithNestedArrayEnums = { 692 - array_strings?: Array<(string)>; 692 + array_strings?: Array<string>; 693 693 data?: (ModelWithNestedArrayEnumsData); 694 694 }; 695 695 ··· 711 711 */ 712 712 export type ModelWithNestedEnums = { 713 713 dictionaryWithEnum?: { 714 - [key: string]: ('Success' | 'Warning' | 'Error'); 714 + [key: string]: 'Success' | 'Warning' | 'Error'; 715 715 }; 716 716 dictionaryWithEnumFromDescription?: { 717 - [key: string]: (number); 717 + [key: string]: number; 718 718 }; 719 - arrayWithEnum?: Array<('Success' | 'Warning' | 'Error')>; 720 - arrayWithDescription?: Array<(number)>; 719 + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; 720 + arrayWithDescription?: Array<number>; 721 721 /** 722 722 * This is a simple enum with strings 723 723 */ ··· 941 941 export type Pageable = { 942 942 page?: number; 943 943 size?: number; 944 - sort?: Array<(string)>; 944 + sort?: Array<string>; 945 945 }; 946 946 947 947 /** ··· 999 999 /** 1000 1000 * This is a simple file 1001 1001 */ 1002 - export type SimpleFile = (Blob | File); 1002 + export type SimpleFile = Blob | File; 1003 1003 1004 1004 /** 1005 1005 * This is a simple number ··· 1025 1025 /** 1026 1026 * This is an array parameter that is sent as csv format (comma-separated values) 1027 1027 */ 1028 - parameterArrayCsv: Array<(string)> | null; 1028 + parameterArrayCsv: Array<string> | null; 1029 1029 /** 1030 1030 * This is an array parameter that is sent as multi format (multiple parameter instances) 1031 1031 */ 1032 - parameterArrayMulti: Array<(string)> | null; 1032 + parameterArrayMulti: Array<string> | null; 1033 1033 /** 1034 1034 * This is an array parameter that is sent as pipes format (pipe-separated values) 1035 1035 */ 1036 - parameterArrayPipes: Array<(string)> | null; 1036 + parameterArrayPipes: Array<string> | null; 1037 1037 /** 1038 1038 * This is an array parameter that is sent as ssv format (space-separated values) 1039 1039 */ 1040 - parameterArraySsv: Array<(string)> | null; 1040 + parameterArraySsv: Array<string> | null; 1041 1041 /** 1042 1042 * This is an array parameter that is sent as tsv format (tab-separated values) 1043 1043 */ 1044 - parameterArrayTsv: Array<(string)> | null; 1044 + parameterArrayTsv: Array<string> | null; 1045 1045 }; 1046 1046 1047 1047 export type ComplexTypesData = { ··· 1071 1071 enabled?: boolean; 1072 1072 readonly type: 'Monkey' | 'Horse' | 'Bird'; 1073 1073 listOfModels?: Array<ModelWithString> | null; 1074 - listOfStrings?: Array<(string)> | null; 1074 + listOfStrings?: Array<string> | null; 1075 1075 parameters: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); 1076 1076 readonly user?: { 1077 1077 readonly id?: number; ··· 1233 1233 id: string; 1234 1234 }; 1235 1235 1236 - export type FileResponseResponse = ((Blob | File)); 1236 + export type FileResponseResponse = (Blob | File); 1237 1237 1238 1238 export type PostApiFormDataData = { 1239 1239 /** ··· 1250 1250 1251 1251 export type MultipartRequestData = { 1252 1252 formData?: { 1253 - content?: (Blob | File); 1253 + content?: Blob | File; 1254 1254 data?: ((ModelWithString) | null); 1255 1255 }; 1256 1256 }; 1257 1257 1258 1258 export type MultipartResponseResponse = ({ 1259 - file?: (Blob | File); 1259 + file?: Blob | File; 1260 1260 metadata?: { 1261 1261 foo?: string; 1262 1262 bar?: string; ··· 1418 1418 /** 1419 1419 * This is an array parameter 1420 1420 */ 1421 - parameterArray: Array<(string)> | null; 1421 + parameterArray: Array<string> | null; 1422 1422 /** 1423 1423 * This is a boolean parameter 1424 1424 */ ··· 1463 1463 }); 1464 1464 1465 1465 export type UploadFileData = { 1466 - formData: (Blob | File); 1466 + formData: Blob | File; 1467 1467 }; 1468 1468 1469 1469 export type UploadFileResponse = (boolean);
+3 -3
packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v3_client_transform/types.gen.ts.snap
··· 22 22 'nullable-date'?: Array<(Date | null)>; 23 23 simpleItems?: Array<SimpleModel>; 24 24 simpleItem?: SimpleModel; 25 - dates?: Array<(Date)>; 26 - strings?: Array<(string)>; 25 + dates?: Array<Date>; 26 + strings?: Array<string>; 27 27 }; 28 28 29 29 /** ··· 41 41 42 42 export type ModelWithDatesArrayResponse = (Array<ModelWithDates>); 43 43 44 - export type ArrayOfDatesResponse = (Array<(Date)>); 44 + export type ArrayOfDatesResponse = (Array<Date>); 45 45 46 46 export type DateResponse = (Date); 47 47
+21 -21
packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v3_date/types.gen.ts.snap
··· 18 18 19 19 export type AdditionalPropertiesIntegerIssue = { 20 20 value: number; 21 - [key: string]: (number) | undefined; 21 + [key: string]: number | undefined; 22 22 }; 23 23 24 24 export type AdditionalPropertiesUnknownIssue = { ··· 67 67 /** 68 68 * This is a simple array with booleans 69 69 */ 70 - export type ArrayWithBooleans = Array<(boolean)>; 70 + export type ArrayWithBooleans = Array<boolean>; 71 71 72 72 /** 73 73 * This is a simple array with numbers 74 74 */ 75 - export type ArrayWithNumbers = Array<(number)>; 75 + export type ArrayWithNumbers = Array<number>; 76 76 77 77 /** 78 78 * This is a simple array with properties ··· 90 90 /** 91 91 * This is a simple array with strings 92 92 */ 93 - export type ArrayWithStrings = Array<(string)>; 93 + export type ArrayWithStrings = Array<string>; 94 94 95 95 /** 96 96 * Testing multiline comments in string: First line ··· 247 247 */ 248 248 export type CompositionWithOneOfAndSimpleArrayDictionary = { 249 249 propA?: (boolean | { 250 - [key: string]: Array<(boolean)>; 250 + [key: string]: Array<boolean>; 251 251 }); 252 252 }; 253 253 ··· 256 256 */ 257 257 export type CompositionWithOneOfAndSimpleDictionary = { 258 258 propA?: (boolean | { 259 - [key: string]: (number); 259 + [key: string]: number; 260 260 }); 261 261 }; 262 262 ··· 310 310 */ 311 311 export type DictionaryWithDictionary = { 312 312 [key: string]: { 313 - [key: string]: (string); 313 + [key: string]: string; 314 314 }; 315 315 }; 316 316 ··· 327 327 export type DictionaryWithPropertiesAndAdditionalProperties = { 328 328 foo?: number; 329 329 bar?: boolean; 330 - [key: string]: (string | number | boolean) | undefined; 330 + [key: string]: string | number | boolean | undefined; 331 331 }; 332 332 333 333 /** ··· 341 341 * This is a string dictionary 342 342 */ 343 343 export type DictionaryWithString = { 344 - [key: string]: (string); 344 + [key: string]: string; 345 345 }; 346 346 347 347 /** ··· 511 511 */ 512 512 export type ModelWithArray = { 513 513 prop?: Array<ModelWithString>; 514 - propWithFile?: Array<((Blob | File))>; 515 - propWithNumber?: Array<(number)>; 514 + propWithFile?: Array<Blob | File>; 515 + propWithNumber?: Array<number>; 516 516 }; 517 517 518 518 /** ··· 520 520 */ 521 521 export type ModelWithArrayReadOnlyAndWriteOnly = { 522 522 prop?: Array<ModelWithReadOnlyAndWriteOnly>; 523 - propWithFile?: Array<((Blob | File))>; 524 - propWithNumber?: Array<(number)>; 523 + propWithFile?: Array<Blob | File>; 524 + propWithNumber?: Array<number>; 525 525 }; 526 526 527 527 /** ··· 594 594 */ 595 595 export type ModelWithDictionary = { 596 596 prop?: { 597 - [key: string]: (string); 597 + [key: string]: string; 598 598 }; 599 599 }; 600 600 ··· 689 689 }; 690 690 691 691 export type ModelWithNestedArrayEnums = { 692 - array_strings?: Array<(string)>; 692 + array_strings?: Array<string>; 693 693 data?: (ModelWithNestedArrayEnumsData); 694 694 }; 695 695 ··· 711 711 */ 712 712 export type ModelWithNestedEnums = { 713 713 dictionaryWithEnum?: { 714 - [key: string]: ('Success' | 'Warning' | 'Error'); 714 + [key: string]: 'Success' | 'Warning' | 'Error'; 715 715 }; 716 716 dictionaryWithEnumFromDescription?: { 717 - [key: string]: (number); 717 + [key: string]: number; 718 718 }; 719 - arrayWithEnum?: Array<('Success' | 'Warning' | 'Error')>; 720 - arrayWithDescription?: Array<(number)>; 719 + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; 720 + arrayWithDescription?: Array<number>; 721 721 /** 722 722 * This is a simple enum with strings 723 723 */ ··· 941 941 export type Pageable = { 942 942 page?: number; 943 943 size?: number; 944 - sort?: Array<(string)>; 944 + sort?: Array<string>; 945 945 }; 946 946 947 947 /** ··· 999 999 /** 1000 1000 * This is a simple file 1001 1001 */ 1002 - export type SimpleFile = (Blob | File); 1002 + export type SimpleFile = Blob | File; 1003 1003 1004 1004 /** 1005 1005 * This is a simple number
+32 -32
packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v3_enums_typescript/types.gen.ts.snap
··· 21 21 22 22 export type AdditionalPropertiesIntegerIssue = { 23 23 value: number; 24 - [key: string]: (number) | undefined; 24 + [key: string]: number | undefined; 25 25 }; 26 26 27 27 export type AdditionalPropertiesUnknownIssue = { ··· 70 70 /** 71 71 * This is a simple array with booleans 72 72 */ 73 - export type ArrayWithBooleans = Array<(boolean)>; 73 + export type ArrayWithBooleans = Array<boolean>; 74 74 75 75 /** 76 76 * This is a simple array with numbers 77 77 */ 78 - export type ArrayWithNumbers = Array<(number)>; 78 + export type ArrayWithNumbers = Array<number>; 79 79 80 80 /** 81 81 * This is a simple array with properties ··· 93 93 /** 94 94 * This is a simple array with strings 95 95 */ 96 - export type ArrayWithStrings = Array<(string)>; 96 + export type ArrayWithStrings = Array<string>; 97 97 98 98 /** 99 99 * Testing multiline comments in string: First line ··· 250 250 */ 251 251 export type CompositionWithOneOfAndSimpleArrayDictionary = { 252 252 propA?: (boolean | { 253 - [key: string]: Array<(boolean)>; 253 + [key: string]: Array<boolean>; 254 254 }); 255 255 }; 256 256 ··· 259 259 */ 260 260 export type CompositionWithOneOfAndSimpleDictionary = { 261 261 propA?: (boolean | { 262 - [key: string]: (number); 262 + [key: string]: number; 263 263 }); 264 264 }; 265 265 ··· 313 313 */ 314 314 export type DictionaryWithDictionary = { 315 315 [key: string]: { 316 - [key: string]: (string); 316 + [key: string]: string; 317 317 }; 318 318 }; 319 319 ··· 330 330 export type DictionaryWithPropertiesAndAdditionalProperties = { 331 331 foo?: number; 332 332 bar?: boolean; 333 - [key: string]: (string | number | boolean) | undefined; 333 + [key: string]: string | number | boolean | undefined; 334 334 }; 335 335 336 336 /** ··· 344 344 * This is a string dictionary 345 345 */ 346 346 export type DictionaryWithString = { 347 - [key: string]: (string); 347 + [key: string]: string; 348 348 }; 349 349 350 350 /** ··· 560 560 */ 561 561 export type ModelWithArray = { 562 562 prop?: Array<ModelWithString>; 563 - propWithFile?: Array<((Blob | File))>; 564 - propWithNumber?: Array<(number)>; 563 + propWithFile?: Array<Blob | File>; 564 + propWithNumber?: Array<number>; 565 565 }; 566 566 567 567 /** ··· 569 569 */ 570 570 export type ModelWithArrayReadOnlyAndWriteOnly = { 571 571 prop?: Array<ModelWithReadOnlyAndWriteOnly>; 572 - propWithFile?: Array<((Blob | File))>; 573 - propWithNumber?: Array<(number)>; 572 + propWithFile?: Array<Blob | File>; 573 + propWithNumber?: Array<number>; 574 574 }; 575 575 576 576 /** ··· 643 643 */ 644 644 export type ModelWithDictionary = { 645 645 prop?: { 646 - [key: string]: (string); 646 + [key: string]: string; 647 647 }; 648 648 }; 649 649 ··· 738 738 }; 739 739 740 740 export type ModelWithNestedArrayEnums = { 741 - array_strings?: Array<(string)>; 741 + array_strings?: Array<string>; 742 742 data?: (ModelWithNestedArrayEnumsData); 743 743 }; 744 744 ··· 766 766 */ 767 767 export type ModelWithNestedEnums = { 768 768 dictionaryWithEnum?: { 769 - [key: string]: ('Success' | 'Warning' | 'Error'); 769 + [key: string]: 'Success' | 'Warning' | 'Error'; 770 770 }; 771 771 dictionaryWithEnumFromDescription?: { 772 - [key: string]: (number); 772 + [key: string]: number; 773 773 }; 774 - arrayWithEnum?: Array<('Success' | 'Warning' | 'Error')>; 775 - arrayWithDescription?: Array<(number)>; 774 + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; 775 + arrayWithDescription?: Array<number>; 776 776 /** 777 777 * This is a simple enum with strings 778 778 */ ··· 996 996 export type Pageable = { 997 997 page?: number; 998 998 size?: number; 999 - sort?: Array<(string)>; 999 + sort?: Array<string>; 1000 1000 }; 1001 1001 1002 1002 /** ··· 1054 1054 /** 1055 1055 * This is a simple file 1056 1056 */ 1057 - export type SimpleFile = (Blob | File); 1057 + export type SimpleFile = Blob | File; 1058 1058 1059 1059 /** 1060 1060 * This is a simple number ··· 1080 1080 /** 1081 1081 * This is an array parameter that is sent as csv format (comma-separated values) 1082 1082 */ 1083 - parameterArrayCsv: Array<(string)> | null; 1083 + parameterArrayCsv: Array<string> | null; 1084 1084 /** 1085 1085 * This is an array parameter that is sent as multi format (multiple parameter instances) 1086 1086 */ 1087 - parameterArrayMulti: Array<(string)> | null; 1087 + parameterArrayMulti: Array<string> | null; 1088 1088 /** 1089 1089 * This is an array parameter that is sent as pipes format (pipe-separated values) 1090 1090 */ 1091 - parameterArrayPipes: Array<(string)> | null; 1091 + parameterArrayPipes: Array<string> | null; 1092 1092 /** 1093 1093 * This is an array parameter that is sent as ssv format (space-separated values) 1094 1094 */ 1095 - parameterArraySsv: Array<(string)> | null; 1095 + parameterArraySsv: Array<string> | null; 1096 1096 /** 1097 1097 * This is an array parameter that is sent as tsv format (tab-separated values) 1098 1098 */ 1099 - parameterArrayTsv: Array<(string)> | null; 1099 + parameterArrayTsv: Array<string> | null; 1100 1100 }; 1101 1101 1102 1102 export type ComplexTypesData = { ··· 1126 1126 enabled?: boolean; 1127 1127 readonly type: 'Monkey' | 'Horse' | 'Bird'; 1128 1128 listOfModels?: Array<ModelWithString> | null; 1129 - listOfStrings?: Array<(string)> | null; 1129 + listOfStrings?: Array<string> | null; 1130 1130 parameters: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); 1131 1131 readonly user?: { 1132 1132 readonly id?: number; ··· 1288 1288 id: string; 1289 1289 }; 1290 1290 1291 - export type FileResponseResponse = ((Blob | File)); 1291 + export type FileResponseResponse = (Blob | File); 1292 1292 1293 1293 export type PostApiFormDataData = { 1294 1294 /** ··· 1305 1305 1306 1306 export type MultipartRequestData = { 1307 1307 formData?: { 1308 - content?: (Blob | File); 1308 + content?: Blob | File; 1309 1309 data?: ((ModelWithString) | null); 1310 1310 }; 1311 1311 }; 1312 1312 1313 1313 export type MultipartResponseResponse = ({ 1314 - file?: (Blob | File); 1314 + file?: Blob | File; 1315 1315 metadata?: { 1316 1316 foo?: string; 1317 1317 bar?: string; ··· 1473 1473 /** 1474 1474 * This is an array parameter 1475 1475 */ 1476 - parameterArray: Array<(string)> | null; 1476 + parameterArray: Array<string> | null; 1477 1477 /** 1478 1478 * This is a boolean parameter 1479 1479 */ ··· 1518 1518 }); 1519 1519 1520 1520 export type UploadFileData = { 1521 - formData: (Blob | File); 1521 + formData: Blob | File; 1522 1522 }; 1523 1523 1524 1524 export type UploadFileResponse = (boolean);
+32 -32
packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v3_node/types.gen.ts.snap
··· 23 23 24 24 export type AdditionalPropertiesIntegerIssue = { 25 25 value: number; 26 - [key: string]: (number) | undefined; 26 + [key: string]: number | undefined; 27 27 }; 28 28 29 29 export type AdditionalPropertiesUnknownIssue = { ··· 72 72 /** 73 73 * This is a simple array with booleans 74 74 */ 75 - export type ArrayWithBooleans = Array<(boolean)>; 75 + export type ArrayWithBooleans = Array<boolean>; 76 76 77 77 /** 78 78 * This is a simple array with numbers 79 79 */ 80 - export type ArrayWithNumbers = Array<(number)>; 80 + export type ArrayWithNumbers = Array<number>; 81 81 82 82 /** 83 83 * This is a simple array with properties ··· 95 95 /** 96 96 * This is a simple array with strings 97 97 */ 98 - export type ArrayWithStrings = Array<(string)>; 98 + export type ArrayWithStrings = Array<string>; 99 99 100 100 /** 101 101 * Testing multiline comments in string: First line ··· 252 252 */ 253 253 export type CompositionWithOneOfAndSimpleArrayDictionary = { 254 254 propA?: (boolean | { 255 - [key: string]: Array<(boolean)>; 255 + [key: string]: Array<boolean>; 256 256 }); 257 257 }; 258 258 ··· 261 261 */ 262 262 export type CompositionWithOneOfAndSimpleDictionary = { 263 263 propA?: (boolean | { 264 - [key: string]: (number); 264 + [key: string]: number; 265 265 }); 266 266 }; 267 267 ··· 315 315 */ 316 316 export type DictionaryWithDictionary = { 317 317 [key: string]: { 318 - [key: string]: (string); 318 + [key: string]: string; 319 319 }; 320 320 }; 321 321 ··· 332 332 export type DictionaryWithPropertiesAndAdditionalProperties = { 333 333 foo?: number; 334 334 bar?: boolean; 335 - [key: string]: (string | number | boolean) | undefined; 335 + [key: string]: string | number | boolean | undefined; 336 336 }; 337 337 338 338 /** ··· 346 346 * This is a string dictionary 347 347 */ 348 348 export type DictionaryWithString = { 349 - [key: string]: (string); 349 + [key: string]: string; 350 350 }; 351 351 352 352 /** ··· 581 581 */ 582 582 export type ModelWithArray = { 583 583 prop?: Array<ModelWithString>; 584 - propWithFile?: Array<((Blob | File))>; 585 - propWithNumber?: Array<(number)>; 584 + propWithFile?: Array<Blob | File>; 585 + propWithNumber?: Array<number>; 586 586 }; 587 587 588 588 /** ··· 590 590 */ 591 591 export type ModelWithArrayReadOnlyAndWriteOnly = { 592 592 prop?: Array<ModelWithReadOnlyAndWriteOnly>; 593 - propWithFile?: Array<((Blob | File))>; 594 - propWithNumber?: Array<(number)>; 593 + propWithFile?: Array<Blob | File>; 594 + propWithNumber?: Array<number>; 595 595 }; 596 596 597 597 /** ··· 664 664 */ 665 665 export type ModelWithDictionary = { 666 666 prop?: { 667 - [key: string]: (string); 667 + [key: string]: string; 668 668 }; 669 669 }; 670 670 ··· 759 759 }; 760 760 761 761 export type ModelWithNestedArrayEnums = { 762 - array_strings?: Array<(string)>; 762 + array_strings?: Array<string>; 763 763 data?: (ModelWithNestedArrayEnumsData); 764 764 }; 765 765 ··· 791 791 */ 792 792 export type ModelWithNestedEnums = { 793 793 dictionaryWithEnum?: { 794 - [key: string]: ('Success' | 'Warning' | 'Error'); 794 + [key: string]: 'Success' | 'Warning' | 'Error'; 795 795 }; 796 796 dictionaryWithEnumFromDescription?: { 797 - [key: string]: (number); 797 + [key: string]: number; 798 798 }; 799 - arrayWithEnum?: Array<('Success' | 'Warning' | 'Error')>; 800 - arrayWithDescription?: Array<(number)>; 799 + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; 800 + arrayWithDescription?: Array<number>; 801 801 /** 802 802 * This is a simple enum with strings 803 803 */ ··· 1021 1021 export type Pageable = { 1022 1022 page?: number; 1023 1023 size?: number; 1024 - sort?: Array<(string)>; 1024 + sort?: Array<string>; 1025 1025 }; 1026 1026 1027 1027 /** ··· 1079 1079 /** 1080 1080 * This is a simple file 1081 1081 */ 1082 - export type SimpleFile = (Blob | File); 1082 + export type SimpleFile = Blob | File; 1083 1083 1084 1084 /** 1085 1085 * This is a simple number ··· 1105 1105 /** 1106 1106 * This is an array parameter that is sent as csv format (comma-separated values) 1107 1107 */ 1108 - parameterArrayCsv: Array<(string)> | null; 1108 + parameterArrayCsv: Array<string> | null; 1109 1109 /** 1110 1110 * This is an array parameter that is sent as multi format (multiple parameter instances) 1111 1111 */ 1112 - parameterArrayMulti: Array<(string)> | null; 1112 + parameterArrayMulti: Array<string> | null; 1113 1113 /** 1114 1114 * This is an array parameter that is sent as pipes format (pipe-separated values) 1115 1115 */ 1116 - parameterArrayPipes: Array<(string)> | null; 1116 + parameterArrayPipes: Array<string> | null; 1117 1117 /** 1118 1118 * This is an array parameter that is sent as ssv format (space-separated values) 1119 1119 */ 1120 - parameterArraySsv: Array<(string)> | null; 1120 + parameterArraySsv: Array<string> | null; 1121 1121 /** 1122 1122 * This is an array parameter that is sent as tsv format (tab-separated values) 1123 1123 */ 1124 - parameterArrayTsv: Array<(string)> | null; 1124 + parameterArrayTsv: Array<string> | null; 1125 1125 }; 1126 1126 1127 1127 export type ComplexTypesData = { ··· 1151 1151 enabled?: boolean; 1152 1152 readonly type: 'Monkey' | 'Horse' | 'Bird'; 1153 1153 listOfModels?: Array<ModelWithString> | null; 1154 - listOfStrings?: Array<(string)> | null; 1154 + listOfStrings?: Array<string> | null; 1155 1155 parameters: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); 1156 1156 readonly user?: { 1157 1157 readonly id?: number; ··· 1313 1313 id: string; 1314 1314 }; 1315 1315 1316 - export type FileResponseResponse = ((Blob | File)); 1316 + export type FileResponseResponse = (Blob | File); 1317 1317 1318 1318 export type PostApiFormDataData = { 1319 1319 /** ··· 1330 1330 1331 1331 export type MultipartRequestData = { 1332 1332 formData?: { 1333 - content?: (Blob | File); 1333 + content?: Blob | File; 1334 1334 data?: ((ModelWithString) | null); 1335 1335 }; 1336 1336 }; 1337 1337 1338 1338 export type MultipartResponseResponse = ({ 1339 - file?: (Blob | File); 1339 + file?: Blob | File; 1340 1340 metadata?: { 1341 1341 foo?: string; 1342 1342 bar?: string; ··· 1498 1498 /** 1499 1499 * This is an array parameter 1500 1500 */ 1501 - parameterArray: Array<(string)> | null; 1501 + parameterArray: Array<string> | null; 1502 1502 /** 1503 1503 * This is a boolean parameter 1504 1504 */ ··· 1543 1543 }); 1544 1544 1545 1545 export type UploadFileData = { 1546 - formData: (Blob | File); 1546 + formData: Blob | File; 1547 1547 }; 1548 1548 1549 1549 export type UploadFileResponse = (boolean);
+3 -3
packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v3_node_transform/types.gen.ts.snap
··· 22 22 'nullable-date'?: Array<(Date | null)>; 23 23 simpleItems?: Array<SimpleModel>; 24 24 simpleItem?: SimpleModel; 25 - dates?: Array<(Date)>; 26 - strings?: Array<(string)>; 25 + dates?: Array<Date>; 26 + strings?: Array<string>; 27 27 }; 28 28 29 29 /** ··· 41 41 42 42 export type ModelWithDatesArrayResponse = (Array<ModelWithDates>); 43 43 44 - export type ArrayOfDatesResponse = (Array<(Date)>); 44 + export type ArrayOfDatesResponse = (Array<Date>); 45 45 46 46 export type DateResponse = (Date); 47 47
+21 -21
packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v3_services_filter/types.gen.ts.snap
··· 23 23 24 24 export type AdditionalPropertiesIntegerIssue = { 25 25 value: number; 26 - [key: string]: (number) | undefined; 26 + [key: string]: number | undefined; 27 27 }; 28 28 29 29 export type AdditionalPropertiesUnknownIssue = { ··· 72 72 /** 73 73 * This is a simple array with booleans 74 74 */ 75 - export type ArrayWithBooleans = Array<(boolean)>; 75 + export type ArrayWithBooleans = Array<boolean>; 76 76 77 77 /** 78 78 * This is a simple array with numbers 79 79 */ 80 - export type ArrayWithNumbers = Array<(number)>; 80 + export type ArrayWithNumbers = Array<number>; 81 81 82 82 /** 83 83 * This is a simple array with properties ··· 95 95 /** 96 96 * This is a simple array with strings 97 97 */ 98 - export type ArrayWithStrings = Array<(string)>; 98 + export type ArrayWithStrings = Array<string>; 99 99 100 100 /** 101 101 * Testing multiline comments in string: First line ··· 252 252 */ 253 253 export type CompositionWithOneOfAndSimpleArrayDictionary = { 254 254 propA?: (boolean | { 255 - [key: string]: Array<(boolean)>; 255 + [key: string]: Array<boolean>; 256 256 }); 257 257 }; 258 258 ··· 261 261 */ 262 262 export type CompositionWithOneOfAndSimpleDictionary = { 263 263 propA?: (boolean | { 264 - [key: string]: (number); 264 + [key: string]: number; 265 265 }); 266 266 }; 267 267 ··· 315 315 */ 316 316 export type DictionaryWithDictionary = { 317 317 [key: string]: { 318 - [key: string]: (string); 318 + [key: string]: string; 319 319 }; 320 320 }; 321 321 ··· 332 332 export type DictionaryWithPropertiesAndAdditionalProperties = { 333 333 foo?: number; 334 334 bar?: boolean; 335 - [key: string]: (string | number | boolean) | undefined; 335 + [key: string]: string | number | boolean | undefined; 336 336 }; 337 337 338 338 /** ··· 346 346 * This is a string dictionary 347 347 */ 348 348 export type DictionaryWithString = { 349 - [key: string]: (string); 349 + [key: string]: string; 350 350 }; 351 351 352 352 /** ··· 581 581 */ 582 582 export type ModelWithArray = { 583 583 prop?: Array<ModelWithString>; 584 - propWithFile?: Array<((Blob | File))>; 585 - propWithNumber?: Array<(number)>; 584 + propWithFile?: Array<Blob | File>; 585 + propWithNumber?: Array<number>; 586 586 }; 587 587 588 588 /** ··· 590 590 */ 591 591 export type ModelWithArrayReadOnlyAndWriteOnly = { 592 592 prop?: Array<ModelWithReadOnlyAndWriteOnly>; 593 - propWithFile?: Array<((Blob | File))>; 594 - propWithNumber?: Array<(number)>; 593 + propWithFile?: Array<Blob | File>; 594 + propWithNumber?: Array<number>; 595 595 }; 596 596 597 597 /** ··· 664 664 */ 665 665 export type ModelWithDictionary = { 666 666 prop?: { 667 - [key: string]: (string); 667 + [key: string]: string; 668 668 }; 669 669 }; 670 670 ··· 759 759 }; 760 760 761 761 export type ModelWithNestedArrayEnums = { 762 - array_strings?: Array<(string)>; 762 + array_strings?: Array<string>; 763 763 data?: (ModelWithNestedArrayEnumsData); 764 764 }; 765 765 ··· 791 791 */ 792 792 export type ModelWithNestedEnums = { 793 793 dictionaryWithEnum?: { 794 - [key: string]: ('Success' | 'Warning' | 'Error'); 794 + [key: string]: 'Success' | 'Warning' | 'Error'; 795 795 }; 796 796 dictionaryWithEnumFromDescription?: { 797 - [key: string]: (number); 797 + [key: string]: number; 798 798 }; 799 - arrayWithEnum?: Array<('Success' | 'Warning' | 'Error')>; 800 - arrayWithDescription?: Array<(number)>; 799 + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; 800 + arrayWithDescription?: Array<number>; 801 801 /** 802 802 * This is a simple enum with strings 803 803 */ ··· 1021 1021 export type Pageable = { 1022 1022 page?: number; 1023 1023 size?: number; 1024 - sort?: Array<(string)>; 1024 + sort?: Array<string>; 1025 1025 }; 1026 1026 1027 1027 /** ··· 1079 1079 /** 1080 1080 * This is a simple file 1081 1081 */ 1082 - export type SimpleFile = (Blob | File); 1082 + export type SimpleFile = Blob | File; 1083 1083 1084 1084 /** 1085 1085 * This is a simple number
+21 -21
packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v3_services_name/types.gen.ts.snap
··· 23 23 24 24 export type AdditionalPropertiesIntegerIssue = { 25 25 value: number; 26 - [key: string]: (number) | undefined; 26 + [key: string]: number | undefined; 27 27 }; 28 28 29 29 export type AdditionalPropertiesUnknownIssue = { ··· 72 72 /** 73 73 * This is a simple array with booleans 74 74 */ 75 - export type ArrayWithBooleans = Array<(boolean)>; 75 + export type ArrayWithBooleans = Array<boolean>; 76 76 77 77 /** 78 78 * This is a simple array with numbers 79 79 */ 80 - export type ArrayWithNumbers = Array<(number)>; 80 + export type ArrayWithNumbers = Array<number>; 81 81 82 82 /** 83 83 * This is a simple array with properties ··· 95 95 /** 96 96 * This is a simple array with strings 97 97 */ 98 - export type ArrayWithStrings = Array<(string)>; 98 + export type ArrayWithStrings = Array<string>; 99 99 100 100 /** 101 101 * Testing multiline comments in string: First line ··· 252 252 */ 253 253 export type CompositionWithOneOfAndSimpleArrayDictionary = { 254 254 propA?: (boolean | { 255 - [key: string]: Array<(boolean)>; 255 + [key: string]: Array<boolean>; 256 256 }); 257 257 }; 258 258 ··· 261 261 */ 262 262 export type CompositionWithOneOfAndSimpleDictionary = { 263 263 propA?: (boolean | { 264 - [key: string]: (number); 264 + [key: string]: number; 265 265 }); 266 266 }; 267 267 ··· 315 315 */ 316 316 export type DictionaryWithDictionary = { 317 317 [key: string]: { 318 - [key: string]: (string); 318 + [key: string]: string; 319 319 }; 320 320 }; 321 321 ··· 332 332 export type DictionaryWithPropertiesAndAdditionalProperties = { 333 333 foo?: number; 334 334 bar?: boolean; 335 - [key: string]: (string | number | boolean) | undefined; 335 + [key: string]: string | number | boolean | undefined; 336 336 }; 337 337 338 338 /** ··· 346 346 * This is a string dictionary 347 347 */ 348 348 export type DictionaryWithString = { 349 - [key: string]: (string); 349 + [key: string]: string; 350 350 }; 351 351 352 352 /** ··· 581 581 */ 582 582 export type ModelWithArray = { 583 583 prop?: Array<ModelWithString>; 584 - propWithFile?: Array<((Blob | File))>; 585 - propWithNumber?: Array<(number)>; 584 + propWithFile?: Array<Blob | File>; 585 + propWithNumber?: Array<number>; 586 586 }; 587 587 588 588 /** ··· 590 590 */ 591 591 export type ModelWithArrayReadOnlyAndWriteOnly = { 592 592 prop?: Array<ModelWithReadOnlyAndWriteOnly>; 593 - propWithFile?: Array<((Blob | File))>; 594 - propWithNumber?: Array<(number)>; 593 + propWithFile?: Array<Blob | File>; 594 + propWithNumber?: Array<number>; 595 595 }; 596 596 597 597 /** ··· 664 664 */ 665 665 export type ModelWithDictionary = { 666 666 prop?: { 667 - [key: string]: (string); 667 + [key: string]: string; 668 668 }; 669 669 }; 670 670 ··· 759 759 }; 760 760 761 761 export type ModelWithNestedArrayEnums = { 762 - array_strings?: Array<(string)>; 762 + array_strings?: Array<string>; 763 763 data?: (ModelWithNestedArrayEnumsData); 764 764 }; 765 765 ··· 791 791 */ 792 792 export type ModelWithNestedEnums = { 793 793 dictionaryWithEnum?: { 794 - [key: string]: ('Success' | 'Warning' | 'Error'); 794 + [key: string]: 'Success' | 'Warning' | 'Error'; 795 795 }; 796 796 dictionaryWithEnumFromDescription?: { 797 - [key: string]: (number); 797 + [key: string]: number; 798 798 }; 799 - arrayWithEnum?: Array<('Success' | 'Warning' | 'Error')>; 800 - arrayWithDescription?: Array<(number)>; 799 + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; 800 + arrayWithDescription?: Array<number>; 801 801 /** 802 802 * This is a simple enum with strings 803 803 */ ··· 1021 1021 export type Pageable = { 1022 1022 page?: number; 1023 1023 size?: number; 1024 - sort?: Array<(string)>; 1024 + sort?: Array<string>; 1025 1025 }; 1026 1026 1027 1027 /** ··· 1079 1079 /** 1080 1080 * This is a simple file 1081 1081 */ 1082 - export type SimpleFile = (Blob | File); 1082 + export type SimpleFile = Blob | File; 1083 1083 1084 1084 /** 1085 1085 * This is a simple number
+3 -3
packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v3_transform/types.gen.ts.snap
··· 22 22 'nullable-date'?: Array<(Date | null)>; 23 23 simpleItems?: Array<SimpleModel>; 24 24 simpleItem?: SimpleModel; 25 - dates?: Array<(Date)>; 26 - strings?: Array<(string)>; 25 + dates?: Array<Date>; 26 + strings?: Array<string>; 27 27 }; 28 28 29 29 /** ··· 41 41 42 42 export type ModelWithDatesArrayResponse = (Array<ModelWithDates>); 43 43 44 - export type ArrayOfDatesResponse = (Array<(Date)>); 44 + export type ArrayOfDatesResponse = (Array<Date>); 45 45 46 46 export type DateResponse = (Date); 47 47
+32 -32
packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v3_tree_shakeable/types.gen.ts.snap
··· 23 23 24 24 export type AdditionalPropertiesIntegerIssue = { 25 25 value: number; 26 - [key: string]: (number) | undefined; 26 + [key: string]: number | undefined; 27 27 }; 28 28 29 29 export type AdditionalPropertiesUnknownIssue = { ··· 72 72 /** 73 73 * This is a simple array with booleans 74 74 */ 75 - export type ArrayWithBooleans = Array<(boolean)>; 75 + export type ArrayWithBooleans = Array<boolean>; 76 76 77 77 /** 78 78 * This is a simple array with numbers 79 79 */ 80 - export type ArrayWithNumbers = Array<(number)>; 80 + export type ArrayWithNumbers = Array<number>; 81 81 82 82 /** 83 83 * This is a simple array with properties ··· 95 95 /** 96 96 * This is a simple array with strings 97 97 */ 98 - export type ArrayWithStrings = Array<(string)>; 98 + export type ArrayWithStrings = Array<string>; 99 99 100 100 /** 101 101 * Testing multiline comments in string: First line ··· 252 252 */ 253 253 export type CompositionWithOneOfAndSimpleArrayDictionary = { 254 254 propA?: (boolean | { 255 - [key: string]: Array<(boolean)>; 255 + [key: string]: Array<boolean>; 256 256 }); 257 257 }; 258 258 ··· 261 261 */ 262 262 export type CompositionWithOneOfAndSimpleDictionary = { 263 263 propA?: (boolean | { 264 - [key: string]: (number); 264 + [key: string]: number; 265 265 }); 266 266 }; 267 267 ··· 315 315 */ 316 316 export type DictionaryWithDictionary = { 317 317 [key: string]: { 318 - [key: string]: (string); 318 + [key: string]: string; 319 319 }; 320 320 }; 321 321 ··· 332 332 export type DictionaryWithPropertiesAndAdditionalProperties = { 333 333 foo?: number; 334 334 bar?: boolean; 335 - [key: string]: (string | number | boolean) | undefined; 335 + [key: string]: string | number | boolean | undefined; 336 336 }; 337 337 338 338 /** ··· 346 346 * This is a string dictionary 347 347 */ 348 348 export type DictionaryWithString = { 349 - [key: string]: (string); 349 + [key: string]: string; 350 350 }; 351 351 352 352 /** ··· 581 581 */ 582 582 export type ModelWithArray = { 583 583 prop?: Array<ModelWithString>; 584 - propWithFile?: Array<((Blob | File))>; 585 - propWithNumber?: Array<(number)>; 584 + propWithFile?: Array<Blob | File>; 585 + propWithNumber?: Array<number>; 586 586 }; 587 587 588 588 /** ··· 590 590 */ 591 591 export type ModelWithArrayReadOnlyAndWriteOnly = { 592 592 prop?: Array<ModelWithReadOnlyAndWriteOnly>; 593 - propWithFile?: Array<((Blob | File))>; 594 - propWithNumber?: Array<(number)>; 593 + propWithFile?: Array<Blob | File>; 594 + propWithNumber?: Array<number>; 595 595 }; 596 596 597 597 /** ··· 664 664 */ 665 665 export type ModelWithDictionary = { 666 666 prop?: { 667 - [key: string]: (string); 667 + [key: string]: string; 668 668 }; 669 669 }; 670 670 ··· 759 759 }; 760 760 761 761 export type ModelWithNestedArrayEnums = { 762 - array_strings?: Array<(string)>; 762 + array_strings?: Array<string>; 763 763 data?: (ModelWithNestedArrayEnumsData); 764 764 }; 765 765 ··· 791 791 */ 792 792 export type ModelWithNestedEnums = { 793 793 dictionaryWithEnum?: { 794 - [key: string]: ('Success' | 'Warning' | 'Error'); 794 + [key: string]: 'Success' | 'Warning' | 'Error'; 795 795 }; 796 796 dictionaryWithEnumFromDescription?: { 797 - [key: string]: (number); 797 + [key: string]: number; 798 798 }; 799 - arrayWithEnum?: Array<('Success' | 'Warning' | 'Error')>; 800 - arrayWithDescription?: Array<(number)>; 799 + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; 800 + arrayWithDescription?: Array<number>; 801 801 /** 802 802 * This is a simple enum with strings 803 803 */ ··· 1021 1021 export type Pageable = { 1022 1022 page?: number; 1023 1023 size?: number; 1024 - sort?: Array<(string)>; 1024 + sort?: Array<string>; 1025 1025 }; 1026 1026 1027 1027 /** ··· 1079 1079 /** 1080 1080 * This is a simple file 1081 1081 */ 1082 - export type SimpleFile = (Blob | File); 1082 + export type SimpleFile = Blob | File; 1083 1083 1084 1084 /** 1085 1085 * This is a simple number ··· 1388 1388 /** 1389 1389 * This is an array parameter that is sent as csv format (comma-separated values) 1390 1390 */ 1391 - parameterArrayCsv: Array<(string)> | null; 1391 + parameterArrayCsv: Array<string> | null; 1392 1392 /** 1393 1393 * This is an array parameter that is sent as multi format (multiple parameter instances) 1394 1394 */ 1395 - parameterArrayMulti: Array<(string)> | null; 1395 + parameterArrayMulti: Array<string> | null; 1396 1396 /** 1397 1397 * This is an array parameter that is sent as pipes format (pipe-separated values) 1398 1398 */ 1399 - parameterArrayPipes: Array<(string)> | null; 1399 + parameterArrayPipes: Array<string> | null; 1400 1400 /** 1401 1401 * This is an array parameter that is sent as ssv format (space-separated values) 1402 1402 */ 1403 - parameterArraySsv: Array<(string)> | null; 1403 + parameterArraySsv: Array<string> | null; 1404 1404 /** 1405 1405 * This is an array parameter that is sent as tsv format (tab-separated values) 1406 1406 */ 1407 - parameterArrayTsv: Array<(string)> | null; 1407 + parameterArrayTsv: Array<string> | null; 1408 1408 }; 1409 1409 1410 1410 export type TypesData = { ··· 1415 1415 /** 1416 1416 * This is an array parameter 1417 1417 */ 1418 - parameterArray: Array<(string)> | null; 1418 + parameterArray: Array<string> | null; 1419 1419 /** 1420 1420 * This is a boolean parameter 1421 1421 */ ··· 1460 1460 }); 1461 1461 1462 1462 export type UploadFileData = { 1463 - formData: (Blob | File); 1463 + formData: Blob | File; 1464 1464 }; 1465 1465 1466 1466 export type UploadFileResponse = (boolean); ··· 1469 1469 id: string; 1470 1470 }; 1471 1471 1472 - export type FileResponseResponse = ((Blob | File)); 1472 + export type FileResponseResponse = (Blob | File); 1473 1473 1474 1474 export type ComplexTypesData = { 1475 1475 /** ··· 1492 1492 1493 1493 export type MultipartRequestData = { 1494 1494 formData?: { 1495 - content?: (Blob | File); 1495 + content?: Blob | File; 1496 1496 data?: ((ModelWithString) | null); 1497 1497 }; 1498 1498 }; 1499 1499 1500 1500 export type MultipartResponseResponse = ({ 1501 - file?: (Blob | File); 1501 + file?: Blob | File; 1502 1502 metadata?: { 1503 1503 foo?: string; 1504 1504 bar?: string; ··· 1513 1513 enabled?: boolean; 1514 1514 readonly type: 'Monkey' | 'Horse' | 'Bird'; 1515 1515 listOfModels?: Array<ModelWithString> | null; 1516 - listOfStrings?: Array<(string)> | null; 1516 + listOfStrings?: Array<string> | null; 1517 1517 parameters: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); 1518 1518 readonly user?: { 1519 1519 readonly id?: number;
+32 -32
packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v3_xhr/types.gen.ts.snap
··· 23 23 24 24 export type AdditionalPropertiesIntegerIssue = { 25 25 value: number; 26 - [key: string]: (number) | undefined; 26 + [key: string]: number | undefined; 27 27 }; 28 28 29 29 export type AdditionalPropertiesUnknownIssue = { ··· 72 72 /** 73 73 * This is a simple array with booleans 74 74 */ 75 - export type ArrayWithBooleans = Array<(boolean)>; 75 + export type ArrayWithBooleans = Array<boolean>; 76 76 77 77 /** 78 78 * This is a simple array with numbers 79 79 */ 80 - export type ArrayWithNumbers = Array<(number)>; 80 + export type ArrayWithNumbers = Array<number>; 81 81 82 82 /** 83 83 * This is a simple array with properties ··· 95 95 /** 96 96 * This is a simple array with strings 97 97 */ 98 - export type ArrayWithStrings = Array<(string)>; 98 + export type ArrayWithStrings = Array<string>; 99 99 100 100 /** 101 101 * Testing multiline comments in string: First line ··· 252 252 */ 253 253 export type CompositionWithOneOfAndSimpleArrayDictionary = { 254 254 propA?: (boolean | { 255 - [key: string]: Array<(boolean)>; 255 + [key: string]: Array<boolean>; 256 256 }); 257 257 }; 258 258 ··· 261 261 */ 262 262 export type CompositionWithOneOfAndSimpleDictionary = { 263 263 propA?: (boolean | { 264 - [key: string]: (number); 264 + [key: string]: number; 265 265 }); 266 266 }; 267 267 ··· 315 315 */ 316 316 export type DictionaryWithDictionary = { 317 317 [key: string]: { 318 - [key: string]: (string); 318 + [key: string]: string; 319 319 }; 320 320 }; 321 321 ··· 332 332 export type DictionaryWithPropertiesAndAdditionalProperties = { 333 333 foo?: number; 334 334 bar?: boolean; 335 - [key: string]: (string | number | boolean) | undefined; 335 + [key: string]: string | number | boolean | undefined; 336 336 }; 337 337 338 338 /** ··· 346 346 * This is a string dictionary 347 347 */ 348 348 export type DictionaryWithString = { 349 - [key: string]: (string); 349 + [key: string]: string; 350 350 }; 351 351 352 352 /** ··· 581 581 */ 582 582 export type ModelWithArray = { 583 583 prop?: Array<ModelWithString>; 584 - propWithFile?: Array<((Blob | File))>; 585 - propWithNumber?: Array<(number)>; 584 + propWithFile?: Array<Blob | File>; 585 + propWithNumber?: Array<number>; 586 586 }; 587 587 588 588 /** ··· 590 590 */ 591 591 export type ModelWithArrayReadOnlyAndWriteOnly = { 592 592 prop?: Array<ModelWithReadOnlyAndWriteOnly>; 593 - propWithFile?: Array<((Blob | File))>; 594 - propWithNumber?: Array<(number)>; 593 + propWithFile?: Array<Blob | File>; 594 + propWithNumber?: Array<number>; 595 595 }; 596 596 597 597 /** ··· 664 664 */ 665 665 export type ModelWithDictionary = { 666 666 prop?: { 667 - [key: string]: (string); 667 + [key: string]: string; 668 668 }; 669 669 }; 670 670 ··· 759 759 }; 760 760 761 761 export type ModelWithNestedArrayEnums = { 762 - array_strings?: Array<(string)>; 762 + array_strings?: Array<string>; 763 763 data?: (ModelWithNestedArrayEnumsData); 764 764 }; 765 765 ··· 791 791 */ 792 792 export type ModelWithNestedEnums = { 793 793 dictionaryWithEnum?: { 794 - [key: string]: ('Success' | 'Warning' | 'Error'); 794 + [key: string]: 'Success' | 'Warning' | 'Error'; 795 795 }; 796 796 dictionaryWithEnumFromDescription?: { 797 - [key: string]: (number); 797 + [key: string]: number; 798 798 }; 799 - arrayWithEnum?: Array<('Success' | 'Warning' | 'Error')>; 800 - arrayWithDescription?: Array<(number)>; 799 + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; 800 + arrayWithDescription?: Array<number>; 801 801 /** 802 802 * This is a simple enum with strings 803 803 */ ··· 1021 1021 export type Pageable = { 1022 1022 page?: number; 1023 1023 size?: number; 1024 - sort?: Array<(string)>; 1024 + sort?: Array<string>; 1025 1025 }; 1026 1026 1027 1027 /** ··· 1079 1079 /** 1080 1080 * This is a simple file 1081 1081 */ 1082 - export type SimpleFile = (Blob | File); 1082 + export type SimpleFile = Blob | File; 1083 1083 1084 1084 /** 1085 1085 * This is a simple number ··· 1105 1105 /** 1106 1106 * This is an array parameter that is sent as csv format (comma-separated values) 1107 1107 */ 1108 - parameterArrayCsv: Array<(string)> | null; 1108 + parameterArrayCsv: Array<string> | null; 1109 1109 /** 1110 1110 * This is an array parameter that is sent as multi format (multiple parameter instances) 1111 1111 */ 1112 - parameterArrayMulti: Array<(string)> | null; 1112 + parameterArrayMulti: Array<string> | null; 1113 1113 /** 1114 1114 * This is an array parameter that is sent as pipes format (pipe-separated values) 1115 1115 */ 1116 - parameterArrayPipes: Array<(string)> | null; 1116 + parameterArrayPipes: Array<string> | null; 1117 1117 /** 1118 1118 * This is an array parameter that is sent as ssv format (space-separated values) 1119 1119 */ 1120 - parameterArraySsv: Array<(string)> | null; 1120 + parameterArraySsv: Array<string> | null; 1121 1121 /** 1122 1122 * This is an array parameter that is sent as tsv format (tab-separated values) 1123 1123 */ 1124 - parameterArrayTsv: Array<(string)> | null; 1124 + parameterArrayTsv: Array<string> | null; 1125 1125 }; 1126 1126 1127 1127 export type ComplexTypesData = { ··· 1151 1151 enabled?: boolean; 1152 1152 readonly type: 'Monkey' | 'Horse' | 'Bird'; 1153 1153 listOfModels?: Array<ModelWithString> | null; 1154 - listOfStrings?: Array<(string)> | null; 1154 + listOfStrings?: Array<string> | null; 1155 1155 parameters: (ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary); 1156 1156 readonly user?: { 1157 1157 readonly id?: number; ··· 1313 1313 id: string; 1314 1314 }; 1315 1315 1316 - export type FileResponseResponse = ((Blob | File)); 1316 + export type FileResponseResponse = (Blob | File); 1317 1317 1318 1318 export type PostApiFormDataData = { 1319 1319 /** ··· 1330 1330 1331 1331 export type MultipartRequestData = { 1332 1332 formData?: { 1333 - content?: (Blob | File); 1333 + content?: Blob | File; 1334 1334 data?: ((ModelWithString) | null); 1335 1335 }; 1336 1336 }; 1337 1337 1338 1338 export type MultipartResponseResponse = ({ 1339 - file?: (Blob | File); 1339 + file?: Blob | File; 1340 1340 metadata?: { 1341 1341 foo?: string; 1342 1342 bar?: string; ··· 1498 1498 /** 1499 1499 * This is an array parameter 1500 1500 */ 1501 - parameterArray: Array<(string)> | null; 1501 + parameterArray: Array<string> | null; 1502 1502 /** 1503 1503 * This is a boolean parameter 1504 1504 */ ··· 1543 1543 }); 1544 1544 1545 1545 export type UploadFileData = { 1546 - formData: (Blob | File); 1546 + formData: Blob | File; 1547 1547 }; 1548 1548 1549 1549 export type UploadFileResponse = (boolean);
+3 -3
packages/openapi-ts-tests/main/test/__snapshots__/test/generated/v3_xhr_transform/types.gen.ts.snap
··· 22 22 'nullable-date'?: Array<(Date | null)>; 23 23 simpleItems?: Array<SimpleModel>; 24 24 simpleItem?: SimpleModel; 25 - dates?: Array<(Date)>; 26 - strings?: Array<(string)>; 25 + dates?: Array<Date>; 26 + strings?: Array<string>; 27 27 }; 28 28 29 29 /** ··· 41 41 42 42 export type ModelWithDatesArrayResponse = (Array<ModelWithDates>); 43 43 44 - export type ArrayOfDatesResponse = (Array<(Date)>); 44 + export type ArrayOfDatesResponse = (Array<Date>); 45 45 46 46 export type DateResponse = (Date); 47 47
+9 -8
packages/openapi-ts-tests/main/test/openapi-ts.config.ts
··· 36 36 '3.1.x', 37 37 // 'invalid', 38 38 // 'openai.yaml', 39 - 'full.yaml', 39 + // 'full.yaml', 40 40 // 'opencode.yaml', 41 41 // 'sdk-instance.yaml', 42 + 'string-with-format.yaml', 42 43 // 'validators-circular-ref-2.yaml', 43 44 // 'zoom-video-sdk.json', 44 45 ), ··· 138 139 validate_EXPERIMENTAL: true, 139 140 }, 140 141 plugins: [ 141 - customClientPlugin({ 142 - baseUrl: false, 143 - }), 142 + // customClientPlugin({ 143 + // baseUrl: false, 144 + // }), 144 145 // myClientPlugin(), 145 146 { 146 147 // baseUrl: false, ··· 169 170 // name: '我_responses_{{name}}', 170 171 // response: '他_response_{{name}}', 171 172 // }, 172 - topType: 'any', 173 + // topType: 'any', 173 174 // tree: true, 174 175 // webhooks: { 175 176 // name: 'Webby{{name}}Hook', ··· 184 185 // client: false, 185 186 // include... 186 187 // instance: true, 187 - name: '@hey-api/sdk', 188 + // name: '@hey-api/sdk', 188 189 // operationId: false, 189 190 // params: 'experiment', 190 191 // responseStyle: 'data', ··· 217 218 // mutationOptions: { 218 219 // name: '{{name}}MO', 219 220 // }, 220 - name: '@tanstack/react-query', 221 + // name: '@tanstack/react-query', 221 222 // queryKeys: { 222 223 // name: '{{name}}QK', 223 224 // }, ··· 278 279 }, 279 280 exportFromIndex: true, 280 281 metadata: true, 281 - name: 'zod', 282 + // name: 'zod', 282 283 // requests: { 283 284 // // case: 'SCREAMING_SNAKE_CASE', 284 285 // // name: 'z{{name}}TestData',
+15
packages/openapi-ts-tests/specs/3.1.x/string-with-format.yaml
··· 1 + openapi: 3.1.1 2 + info: 3 + title: OpenAPI 3.1.1 string with format example 4 + version: '1' 5 + components: 6 + schemas: 7 + Foo: 8 + properties: 9 + foo: 10 + items: 11 + anyOf: 12 + - type: string 13 + format: binary 14 + - type: string 15 + type: array
+1 -2
packages/openapi-ts/src/plugins/@hey-api/typescript/operation.ts
··· 6 6 import { schemaToType } from './plugin'; 7 7 import type { HeyApiTypeScriptPlugin, PluginState } from './types'; 8 8 9 - // TODO: exported just for @pinia/colada, remove export once that plugin does not depend on it 10 - export const irParametersToIrSchema = ({ 9 + const irParametersToIrSchema = ({ 11 10 parameters, 12 11 }: { 13 12 parameters: Record<string, IR.ParameterObject>;
+1 -1
packages/openapi-ts/src/plugins/@hey-api/typescript/plugin.ts
··· 43 43 ); 44 44 } 45 45 46 - schema = deduplicateSchema({ detectFormat: false, schema }); 46 + schema = deduplicateSchema({ detectFormat: true, schema }); 47 47 48 48 const itemTypes: Array<ts.TypeNode> = []; 49 49
+24 -6
packages/openapi-ts/src/tsc/typedef.ts
··· 181 181 isNullable?: boolean; 182 182 types: ReadonlyArray<any | ts.TypeNode>; 183 183 }) => { 184 - const nodes = types.map((type) => createTypeNode(type)); 185 - const node = ts.factory.createUnionTypeNode(nodes); 186 - return maybeNullable({ isNullable, node }); 184 + // flatten nested unions 185 + const nodes: Array<ts.TypeNode> = []; 186 + for (const type of types) { 187 + const node = createTypeNode(type); 188 + if (ts.isUnionTypeNode(node)) { 189 + nodes.push(...node.types); 190 + } else { 191 + nodes.push(node); 192 + } 193 + } 194 + const unionNode = ts.factory.createUnionTypeNode(nodes); 195 + return maybeNullable({ isNullable, node: unionNode }); 187 196 }; 188 197 189 198 /** ··· 199 208 isNullable?: boolean; 200 209 types: (any | ts.TypeNode)[]; 201 210 }) => { 202 - const nodes = types.map((type) => createTypeNode(type)); 203 - const node = ts.factory.createIntersectionTypeNode(nodes); 204 - return maybeNullable({ isNullable, node }); 211 + // flatten nested intersections 212 + const nodes: Array<ts.TypeNode> = []; 213 + for (const type of types) { 214 + const node = createTypeNode(type); 215 + if (ts.isIntersectionTypeNode(node)) { 216 + nodes.push(...node.types); 217 + } else { 218 + nodes.push(node); 219 + } 220 + } 221 + const intersectionNode = ts.factory.createIntersectionTypeNode(nodes); 222 + return maybeNullable({ isNullable, node: intersectionNode }); 205 223 }; 206 224 207 225 /**