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

Merge pull request #1250 from hey-api/fix/parser-204-void

fix: render void for empty response status codes in experimental parser

authored by

Lubos and committed by
GitHub
404690ca be276286

+239 -133
+5
.changeset/silver-dolphins-retire.md
··· 1 + --- 2 + '@hey-api/openapi-ts': patch 3 + --- 4 + 5 + fix: render void for empty response status codes in experimental parser
+5 -1
packages/openapi-ts/src/compiler/types.ts
··· 255 255 | 'number' 256 256 | 'string' 257 257 | 'undefined' 258 - | 'unknown'; 258 + | 'unknown' 259 + | 'void'; 259 260 }) => { 260 261 let kind: ts.KeywordTypeSyntaxKind = ts.SyntaxKind.AnyKeyword; 261 262 switch (keyword) { ··· 276 277 break; 277 278 case 'unknown': 278 279 kind = ts.SyntaxKind.UnknownKeyword; 280 + break; 281 + case 'void': 282 + kind = ts.SyntaxKind.VoidKeyword; 279 283 break; 280 284 } 281 285 return ts.factory.createKeywordTypeNode(kind);
+1
packages/openapi-ts/src/ir/ir.d.ts
··· 138 138 | 'object' 139 139 | 'string' 140 140 | 'tuple' 141 + | 'undefined' 141 142 | 'unknown' 142 143 | 'void'; 143 144 }
+6 -2
packages/openapi-ts/src/plugins/@hey-api/types/plugin.ts
··· 436 436 437 437 if (hasOptionalProperties) { 438 438 indexPropertyItems.push({ 439 - type: 'void', 439 + type: 'undefined', 440 440 }); 441 441 } 442 442 ··· 594 594 namespace, 595 595 schema: schema as SchemaWithType<'tuple'>, 596 596 }); 597 + case 'undefined': 598 + return compiler.keywordTypeNode({ 599 + keyword: 'undefined', 600 + }); 597 601 case 'unknown': 598 602 return compiler.keywordTypeNode({ 599 603 keyword: 'unknown', 600 604 }); 601 605 case 'void': 602 606 return compiler.keywordTypeNode({ 603 - keyword: 'undefined', 607 + keyword: 'void', 604 608 }); 605 609 } 606 610 };
+13
packages/openapi-ts/test/3.0.x.spec.ts
··· 62 62 }), 63 63 description: 'handles null enums', 64 64 }, 65 + { 66 + config: createConfig({ 67 + input: 'operation-204.json', 68 + output: 'operation-204', 69 + plugins: [ 70 + { 71 + name: '@hey-api/types', 72 + tree: true, 73 + }, 74 + ], 75 + }), 76 + description: 'handles empty response status codes', 77 + }, 65 78 ]; 66 79 67 80 it.each(scenarios)('$description', async ({ config }) => {
+13
packages/openapi-ts/test/3.1.x.spec.ts
··· 95 95 }, 96 96 { 97 97 config: createConfig({ 98 + input: 'operation-204.json', 99 + output: 'operation-204', 100 + plugins: [ 101 + { 102 + name: '@hey-api/types', 103 + tree: true, 104 + }, 105 + ], 106 + }), 107 + description: 'handles empty response status codes', 108 + }, 109 + { 110 + config: createConfig({ 98 111 input: 'required-all-of-ref.json', 99 112 output: 'required-all-of-ref', 100 113 plugins: [
+2
packages/openapi-ts/test/__snapshots__/3.0.x/operation-204/index.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + export * from './types.gen';
+3
packages/openapi-ts/test/__snapshots__/3.0.x/operation-204/types.gen.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + 3 + export type PostFooResponse = string | void;
+4 -4
packages/openapi-ts/test/__snapshots__/3.0.x/plugins/@hey-api/services/default/types.gen.ts
··· 1136 1136 }; 1137 1137 }; 1138 1138 1139 - export type PostCallWithOptionalParamResponse = number | undefined; 1139 + export type PostCallWithOptionalParamResponse = number | void; 1140 1140 1141 1141 export type PostApiVbyApiVersionRequestBodyData = { 1142 1142 /** ··· 1259 1259 }; 1260 1260 }; 1261 1261 1262 - export type CallWithNoContentResponseResponse = undefined; 1262 + export type CallWithNoContentResponseResponse = void; 1263 1263 1264 - export type CallWithResponseAndNoContentResponseResponse = number | undefined; 1264 + export type CallWithResponseAndNoContentResponseResponse = number | void; 1265 1265 1266 1266 export type DummyAResponse = _400; 1267 1267 1268 - export type DummyBResponse = undefined; 1268 + export type DummyBResponse = void; 1269 1269 1270 1270 export type CallWithResponseResponse = _import; 1271 1271
+4 -4
packages/openapi-ts/test/__snapshots__/3.0.x/plugins/@tanstack/angular-query-experimental/asClass/types.gen.ts
··· 1136 1136 }; 1137 1137 }; 1138 1138 1139 - export type PostCallWithOptionalParamResponse = number | undefined; 1139 + export type PostCallWithOptionalParamResponse = number | void; 1140 1140 1141 1141 export type PostApiVbyApiVersionRequestBodyData = { 1142 1142 /** ··· 1259 1259 }; 1260 1260 }; 1261 1261 1262 - export type CallWithNoContentResponseResponse = undefined; 1262 + export type CallWithNoContentResponseResponse = void; 1263 1263 1264 - export type CallWithResponseAndNoContentResponseResponse = number | undefined; 1264 + export type CallWithResponseAndNoContentResponseResponse = number | void; 1265 1265 1266 1266 export type DummyAResponse = _400; 1267 1267 1268 - export type DummyBResponse = undefined; 1268 + export type DummyBResponse = void; 1269 1269 1270 1270 export type CallWithResponseResponse = _import; 1271 1271
+4 -4
packages/openapi-ts/test/__snapshots__/3.0.x/plugins/@tanstack/angular-query-experimental/axios/types.gen.ts
··· 1136 1136 }; 1137 1137 }; 1138 1138 1139 - export type PostCallWithOptionalParamResponse = number | undefined; 1139 + export type PostCallWithOptionalParamResponse = number | void; 1140 1140 1141 1141 export type PostApiVbyApiVersionRequestBodyData = { 1142 1142 /** ··· 1259 1259 }; 1260 1260 }; 1261 1261 1262 - export type CallWithNoContentResponseResponse = undefined; 1262 + export type CallWithNoContentResponseResponse = void; 1263 1263 1264 - export type CallWithResponseAndNoContentResponseResponse = number | undefined; 1264 + export type CallWithResponseAndNoContentResponseResponse = number | void; 1265 1265 1266 1266 export type DummyAResponse = _400; 1267 1267 1268 - export type DummyBResponse = undefined; 1268 + export type DummyBResponse = void; 1269 1269 1270 1270 export type CallWithResponseResponse = _import; 1271 1271
+4 -4
packages/openapi-ts/test/__snapshots__/3.0.x/plugins/@tanstack/angular-query-experimental/fetch/types.gen.ts
··· 1136 1136 }; 1137 1137 }; 1138 1138 1139 - export type PostCallWithOptionalParamResponse = number | undefined; 1139 + export type PostCallWithOptionalParamResponse = number | void; 1140 1140 1141 1141 export type PostApiVbyApiVersionRequestBodyData = { 1142 1142 /** ··· 1259 1259 }; 1260 1260 }; 1261 1261 1262 - export type CallWithNoContentResponseResponse = undefined; 1262 + export type CallWithNoContentResponseResponse = void; 1263 1263 1264 - export type CallWithResponseAndNoContentResponseResponse = number | undefined; 1264 + export type CallWithResponseAndNoContentResponseResponse = number | void; 1265 1265 1266 1266 export type DummyAResponse = _400; 1267 1267 1268 - export type DummyBResponse = undefined; 1268 + export type DummyBResponse = void; 1269 1269 1270 1270 export type CallWithResponseResponse = _import; 1271 1271
+4 -4
packages/openapi-ts/test/__snapshots__/3.0.x/plugins/@tanstack/react-query/asClass/types.gen.ts
··· 1136 1136 }; 1137 1137 }; 1138 1138 1139 - export type PostCallWithOptionalParamResponse = number | undefined; 1139 + export type PostCallWithOptionalParamResponse = number | void; 1140 1140 1141 1141 export type PostApiVbyApiVersionRequestBodyData = { 1142 1142 /** ··· 1259 1259 }; 1260 1260 }; 1261 1261 1262 - export type CallWithNoContentResponseResponse = undefined; 1262 + export type CallWithNoContentResponseResponse = void; 1263 1263 1264 - export type CallWithResponseAndNoContentResponseResponse = number | undefined; 1264 + export type CallWithResponseAndNoContentResponseResponse = number | void; 1265 1265 1266 1266 export type DummyAResponse = _400; 1267 1267 1268 - export type DummyBResponse = undefined; 1268 + export type DummyBResponse = void; 1269 1269 1270 1270 export type CallWithResponseResponse = _import; 1271 1271
+4 -4
packages/openapi-ts/test/__snapshots__/3.0.x/plugins/@tanstack/react-query/axios/types.gen.ts
··· 1136 1136 }; 1137 1137 }; 1138 1138 1139 - export type PostCallWithOptionalParamResponse = number | undefined; 1139 + export type PostCallWithOptionalParamResponse = number | void; 1140 1140 1141 1141 export type PostApiVbyApiVersionRequestBodyData = { 1142 1142 /** ··· 1259 1259 }; 1260 1260 }; 1261 1261 1262 - export type CallWithNoContentResponseResponse = undefined; 1262 + export type CallWithNoContentResponseResponse = void; 1263 1263 1264 - export type CallWithResponseAndNoContentResponseResponse = number | undefined; 1264 + export type CallWithResponseAndNoContentResponseResponse = number | void; 1265 1265 1266 1266 export type DummyAResponse = _400; 1267 1267 1268 - export type DummyBResponse = undefined; 1268 + export type DummyBResponse = void; 1269 1269 1270 1270 export type CallWithResponseResponse = _import; 1271 1271
+4 -4
packages/openapi-ts/test/__snapshots__/3.0.x/plugins/@tanstack/react-query/fetch/types.gen.ts
··· 1136 1136 }; 1137 1137 }; 1138 1138 1139 - export type PostCallWithOptionalParamResponse = number | undefined; 1139 + export type PostCallWithOptionalParamResponse = number | void; 1140 1140 1141 1141 export type PostApiVbyApiVersionRequestBodyData = { 1142 1142 /** ··· 1259 1259 }; 1260 1260 }; 1261 1261 1262 - export type CallWithNoContentResponseResponse = undefined; 1262 + export type CallWithNoContentResponseResponse = void; 1263 1263 1264 - export type CallWithResponseAndNoContentResponseResponse = number | undefined; 1264 + export type CallWithResponseAndNoContentResponseResponse = number | void; 1265 1265 1266 1266 export type DummyAResponse = _400; 1267 1267 1268 - export type DummyBResponse = undefined; 1268 + export type DummyBResponse = void; 1269 1269 1270 1270 export type CallWithResponseResponse = _import; 1271 1271
+4 -4
packages/openapi-ts/test/__snapshots__/3.0.x/plugins/@tanstack/solid-query/asClass/types.gen.ts
··· 1136 1136 }; 1137 1137 }; 1138 1138 1139 - export type PostCallWithOptionalParamResponse = number | undefined; 1139 + export type PostCallWithOptionalParamResponse = number | void; 1140 1140 1141 1141 export type PostApiVbyApiVersionRequestBodyData = { 1142 1142 /** ··· 1259 1259 }; 1260 1260 }; 1261 1261 1262 - export type CallWithNoContentResponseResponse = undefined; 1262 + export type CallWithNoContentResponseResponse = void; 1263 1263 1264 - export type CallWithResponseAndNoContentResponseResponse = number | undefined; 1264 + export type CallWithResponseAndNoContentResponseResponse = number | void; 1265 1265 1266 1266 export type DummyAResponse = _400; 1267 1267 1268 - export type DummyBResponse = undefined; 1268 + export type DummyBResponse = void; 1269 1269 1270 1270 export type CallWithResponseResponse = _import; 1271 1271
+4 -4
packages/openapi-ts/test/__snapshots__/3.0.x/plugins/@tanstack/solid-query/axios/types.gen.ts
··· 1136 1136 }; 1137 1137 }; 1138 1138 1139 - export type PostCallWithOptionalParamResponse = number | undefined; 1139 + export type PostCallWithOptionalParamResponse = number | void; 1140 1140 1141 1141 export type PostApiVbyApiVersionRequestBodyData = { 1142 1142 /** ··· 1259 1259 }; 1260 1260 }; 1261 1261 1262 - export type CallWithNoContentResponseResponse = undefined; 1262 + export type CallWithNoContentResponseResponse = void; 1263 1263 1264 - export type CallWithResponseAndNoContentResponseResponse = number | undefined; 1264 + export type CallWithResponseAndNoContentResponseResponse = number | void; 1265 1265 1266 1266 export type DummyAResponse = _400; 1267 1267 1268 - export type DummyBResponse = undefined; 1268 + export type DummyBResponse = void; 1269 1269 1270 1270 export type CallWithResponseResponse = _import; 1271 1271
+4 -4
packages/openapi-ts/test/__snapshots__/3.0.x/plugins/@tanstack/solid-query/fetch/types.gen.ts
··· 1136 1136 }; 1137 1137 }; 1138 1138 1139 - export type PostCallWithOptionalParamResponse = number | undefined; 1139 + export type PostCallWithOptionalParamResponse = number | void; 1140 1140 1141 1141 export type PostApiVbyApiVersionRequestBodyData = { 1142 1142 /** ··· 1259 1259 }; 1260 1260 }; 1261 1261 1262 - export type CallWithNoContentResponseResponse = undefined; 1262 + export type CallWithNoContentResponseResponse = void; 1263 1263 1264 - export type CallWithResponseAndNoContentResponseResponse = number | undefined; 1264 + export type CallWithResponseAndNoContentResponseResponse = number | void; 1265 1265 1266 1266 export type DummyAResponse = _400; 1267 1267 1268 - export type DummyBResponse = undefined; 1268 + export type DummyBResponse = void; 1269 1269 1270 1270 export type CallWithResponseResponse = _import; 1271 1271
+4 -4
packages/openapi-ts/test/__snapshots__/3.0.x/plugins/@tanstack/svelte-query/asClass/types.gen.ts
··· 1136 1136 }; 1137 1137 }; 1138 1138 1139 - export type PostCallWithOptionalParamResponse = number | undefined; 1139 + export type PostCallWithOptionalParamResponse = number | void; 1140 1140 1141 1141 export type PostApiVbyApiVersionRequestBodyData = { 1142 1142 /** ··· 1259 1259 }; 1260 1260 }; 1261 1261 1262 - export type CallWithNoContentResponseResponse = undefined; 1262 + export type CallWithNoContentResponseResponse = void; 1263 1263 1264 - export type CallWithResponseAndNoContentResponseResponse = number | undefined; 1264 + export type CallWithResponseAndNoContentResponseResponse = number | void; 1265 1265 1266 1266 export type DummyAResponse = _400; 1267 1267 1268 - export type DummyBResponse = undefined; 1268 + export type DummyBResponse = void; 1269 1269 1270 1270 export type CallWithResponseResponse = _import; 1271 1271
+4 -4
packages/openapi-ts/test/__snapshots__/3.0.x/plugins/@tanstack/svelte-query/axios/types.gen.ts
··· 1136 1136 }; 1137 1137 }; 1138 1138 1139 - export type PostCallWithOptionalParamResponse = number | undefined; 1139 + export type PostCallWithOptionalParamResponse = number | void; 1140 1140 1141 1141 export type PostApiVbyApiVersionRequestBodyData = { 1142 1142 /** ··· 1259 1259 }; 1260 1260 }; 1261 1261 1262 - export type CallWithNoContentResponseResponse = undefined; 1262 + export type CallWithNoContentResponseResponse = void; 1263 1263 1264 - export type CallWithResponseAndNoContentResponseResponse = number | undefined; 1264 + export type CallWithResponseAndNoContentResponseResponse = number | void; 1265 1265 1266 1266 export type DummyAResponse = _400; 1267 1267 1268 - export type DummyBResponse = undefined; 1268 + export type DummyBResponse = void; 1269 1269 1270 1270 export type CallWithResponseResponse = _import; 1271 1271
+4 -4
packages/openapi-ts/test/__snapshots__/3.0.x/plugins/@tanstack/svelte-query/fetch/types.gen.ts
··· 1136 1136 }; 1137 1137 }; 1138 1138 1139 - export type PostCallWithOptionalParamResponse = number | undefined; 1139 + export type PostCallWithOptionalParamResponse = number | void; 1140 1140 1141 1141 export type PostApiVbyApiVersionRequestBodyData = { 1142 1142 /** ··· 1259 1259 }; 1260 1260 }; 1261 1261 1262 - export type CallWithNoContentResponseResponse = undefined; 1262 + export type CallWithNoContentResponseResponse = void; 1263 1263 1264 - export type CallWithResponseAndNoContentResponseResponse = number | undefined; 1264 + export type CallWithResponseAndNoContentResponseResponse = number | void; 1265 1265 1266 1266 export type DummyAResponse = _400; 1267 1267 1268 - export type DummyBResponse = undefined; 1268 + export type DummyBResponse = void; 1269 1269 1270 1270 export type CallWithResponseResponse = _import; 1271 1271
+4 -4
packages/openapi-ts/test/__snapshots__/3.0.x/plugins/@tanstack/vue-query/asClass/types.gen.ts
··· 1136 1136 }; 1137 1137 }; 1138 1138 1139 - export type PostCallWithOptionalParamResponse = number | undefined; 1139 + export type PostCallWithOptionalParamResponse = number | void; 1140 1140 1141 1141 export type PostApiVbyApiVersionRequestBodyData = { 1142 1142 /** ··· 1259 1259 }; 1260 1260 }; 1261 1261 1262 - export type CallWithNoContentResponseResponse = undefined; 1262 + export type CallWithNoContentResponseResponse = void; 1263 1263 1264 - export type CallWithResponseAndNoContentResponseResponse = number | undefined; 1264 + export type CallWithResponseAndNoContentResponseResponse = number | void; 1265 1265 1266 1266 export type DummyAResponse = _400; 1267 1267 1268 - export type DummyBResponse = undefined; 1268 + export type DummyBResponse = void; 1269 1269 1270 1270 export type CallWithResponseResponse = _import; 1271 1271
+4 -4
packages/openapi-ts/test/__snapshots__/3.0.x/plugins/@tanstack/vue-query/axios/types.gen.ts
··· 1136 1136 }; 1137 1137 }; 1138 1138 1139 - export type PostCallWithOptionalParamResponse = number | undefined; 1139 + export type PostCallWithOptionalParamResponse = number | void; 1140 1140 1141 1141 export type PostApiVbyApiVersionRequestBodyData = { 1142 1142 /** ··· 1259 1259 }; 1260 1260 }; 1261 1261 1262 - export type CallWithNoContentResponseResponse = undefined; 1262 + export type CallWithNoContentResponseResponse = void; 1263 1263 1264 - export type CallWithResponseAndNoContentResponseResponse = number | undefined; 1264 + export type CallWithResponseAndNoContentResponseResponse = number | void; 1265 1265 1266 1266 export type DummyAResponse = _400; 1267 1267 1268 - export type DummyBResponse = undefined; 1268 + export type DummyBResponse = void; 1269 1269 1270 1270 export type CallWithResponseResponse = _import; 1271 1271
+4 -4
packages/openapi-ts/test/__snapshots__/3.0.x/plugins/@tanstack/vue-query/fetch/types.gen.ts
··· 1136 1136 }; 1137 1137 }; 1138 1138 1139 - export type PostCallWithOptionalParamResponse = number | undefined; 1139 + export type PostCallWithOptionalParamResponse = number | void; 1140 1140 1141 1141 export type PostApiVbyApiVersionRequestBodyData = { 1142 1142 /** ··· 1259 1259 }; 1260 1260 }; 1261 1261 1262 - export type CallWithNoContentResponseResponse = undefined; 1262 + export type CallWithNoContentResponseResponse = void; 1263 1263 1264 - export type CallWithResponseAndNoContentResponseResponse = number | undefined; 1264 + export type CallWithResponseAndNoContentResponseResponse = number | void; 1265 1265 1266 1266 export type DummyAResponse = _400; 1267 1267 1268 - export type DummyBResponse = undefined; 1268 + export type DummyBResponse = void; 1269 1269 1270 1270 export type CallWithResponseResponse = _import; 1271 1271
+2
packages/openapi-ts/test/__snapshots__/3.1.x/operation-204/index.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + export * from './types.gen';
+3
packages/openapi-ts/test/__snapshots__/3.1.x/operation-204/types.gen.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + 3 + export type PostFooResponse = string | void;
+4 -4
packages/openapi-ts/test/__snapshots__/3.1.x/plugins/@hey-api/services/default/types.gen.ts
··· 1136 1136 }; 1137 1137 }; 1138 1138 1139 - export type PostCallWithOptionalParamResponse = number | undefined; 1139 + export type PostCallWithOptionalParamResponse = number | void; 1140 1140 1141 1141 export type PostApiVbyApiVersionRequestBodyData = { 1142 1142 /** ··· 1259 1259 }; 1260 1260 }; 1261 1261 1262 - export type CallWithNoContentResponseResponse = undefined; 1262 + export type CallWithNoContentResponseResponse = void; 1263 1263 1264 - export type CallWithResponseAndNoContentResponseResponse = number | undefined; 1264 + export type CallWithResponseAndNoContentResponseResponse = number | void; 1265 1265 1266 1266 export type DummyAResponse = _400; 1267 1267 1268 - export type DummyBResponse = undefined; 1268 + export type DummyBResponse = void; 1269 1269 1270 1270 export type CallWithResponseResponse = _import; 1271 1271
+4 -4
packages/openapi-ts/test/__snapshots__/3.1.x/plugins/@tanstack/angular-query-experimental/asClass/types.gen.ts
··· 1136 1136 }; 1137 1137 }; 1138 1138 1139 - export type PostCallWithOptionalParamResponse = number | undefined; 1139 + export type PostCallWithOptionalParamResponse = number | void; 1140 1140 1141 1141 export type PostApiVbyApiVersionRequestBodyData = { 1142 1142 /** ··· 1259 1259 }; 1260 1260 }; 1261 1261 1262 - export type CallWithNoContentResponseResponse = undefined; 1262 + export type CallWithNoContentResponseResponse = void; 1263 1263 1264 - export type CallWithResponseAndNoContentResponseResponse = number | undefined; 1264 + export type CallWithResponseAndNoContentResponseResponse = number | void; 1265 1265 1266 1266 export type DummyAResponse = _400; 1267 1267 1268 - export type DummyBResponse = undefined; 1268 + export type DummyBResponse = void; 1269 1269 1270 1270 export type CallWithResponseResponse = _import; 1271 1271
+4 -4
packages/openapi-ts/test/__snapshots__/3.1.x/plugins/@tanstack/angular-query-experimental/axios/types.gen.ts
··· 1136 1136 }; 1137 1137 }; 1138 1138 1139 - export type PostCallWithOptionalParamResponse = number | undefined; 1139 + export type PostCallWithOptionalParamResponse = number | void; 1140 1140 1141 1141 export type PostApiVbyApiVersionRequestBodyData = { 1142 1142 /** ··· 1259 1259 }; 1260 1260 }; 1261 1261 1262 - export type CallWithNoContentResponseResponse = undefined; 1262 + export type CallWithNoContentResponseResponse = void; 1263 1263 1264 - export type CallWithResponseAndNoContentResponseResponse = number | undefined; 1264 + export type CallWithResponseAndNoContentResponseResponse = number | void; 1265 1265 1266 1266 export type DummyAResponse = _400; 1267 1267 1268 - export type DummyBResponse = undefined; 1268 + export type DummyBResponse = void; 1269 1269 1270 1270 export type CallWithResponseResponse = _import; 1271 1271
+4 -4
packages/openapi-ts/test/__snapshots__/3.1.x/plugins/@tanstack/angular-query-experimental/fetch/types.gen.ts
··· 1136 1136 }; 1137 1137 }; 1138 1138 1139 - export type PostCallWithOptionalParamResponse = number | undefined; 1139 + export type PostCallWithOptionalParamResponse = number | void; 1140 1140 1141 1141 export type PostApiVbyApiVersionRequestBodyData = { 1142 1142 /** ··· 1259 1259 }; 1260 1260 }; 1261 1261 1262 - export type CallWithNoContentResponseResponse = undefined; 1262 + export type CallWithNoContentResponseResponse = void; 1263 1263 1264 - export type CallWithResponseAndNoContentResponseResponse = number | undefined; 1264 + export type CallWithResponseAndNoContentResponseResponse = number | void; 1265 1265 1266 1266 export type DummyAResponse = _400; 1267 1267 1268 - export type DummyBResponse = undefined; 1268 + export type DummyBResponse = void; 1269 1269 1270 1270 export type CallWithResponseResponse = _import; 1271 1271
+4 -4
packages/openapi-ts/test/__snapshots__/3.1.x/plugins/@tanstack/react-query/asClass/types.gen.ts
··· 1136 1136 }; 1137 1137 }; 1138 1138 1139 - export type PostCallWithOptionalParamResponse = number | undefined; 1139 + export type PostCallWithOptionalParamResponse = number | void; 1140 1140 1141 1141 export type PostApiVbyApiVersionRequestBodyData = { 1142 1142 /** ··· 1259 1259 }; 1260 1260 }; 1261 1261 1262 - export type CallWithNoContentResponseResponse = undefined; 1262 + export type CallWithNoContentResponseResponse = void; 1263 1263 1264 - export type CallWithResponseAndNoContentResponseResponse = number | undefined; 1264 + export type CallWithResponseAndNoContentResponseResponse = number | void; 1265 1265 1266 1266 export type DummyAResponse = _400; 1267 1267 1268 - export type DummyBResponse = undefined; 1268 + export type DummyBResponse = void; 1269 1269 1270 1270 export type CallWithResponseResponse = _import; 1271 1271
+4 -4
packages/openapi-ts/test/__snapshots__/3.1.x/plugins/@tanstack/react-query/axios/types.gen.ts
··· 1136 1136 }; 1137 1137 }; 1138 1138 1139 - export type PostCallWithOptionalParamResponse = number | undefined; 1139 + export type PostCallWithOptionalParamResponse = number | void; 1140 1140 1141 1141 export type PostApiVbyApiVersionRequestBodyData = { 1142 1142 /** ··· 1259 1259 }; 1260 1260 }; 1261 1261 1262 - export type CallWithNoContentResponseResponse = undefined; 1262 + export type CallWithNoContentResponseResponse = void; 1263 1263 1264 - export type CallWithResponseAndNoContentResponseResponse = number | undefined; 1264 + export type CallWithResponseAndNoContentResponseResponse = number | void; 1265 1265 1266 1266 export type DummyAResponse = _400; 1267 1267 1268 - export type DummyBResponse = undefined; 1268 + export type DummyBResponse = void; 1269 1269 1270 1270 export type CallWithResponseResponse = _import; 1271 1271
+4 -4
packages/openapi-ts/test/__snapshots__/3.1.x/plugins/@tanstack/react-query/fetch/types.gen.ts
··· 1136 1136 }; 1137 1137 }; 1138 1138 1139 - export type PostCallWithOptionalParamResponse = number | undefined; 1139 + export type PostCallWithOptionalParamResponse = number | void; 1140 1140 1141 1141 export type PostApiVbyApiVersionRequestBodyData = { 1142 1142 /** ··· 1259 1259 }; 1260 1260 }; 1261 1261 1262 - export type CallWithNoContentResponseResponse = undefined; 1262 + export type CallWithNoContentResponseResponse = void; 1263 1263 1264 - export type CallWithResponseAndNoContentResponseResponse = number | undefined; 1264 + export type CallWithResponseAndNoContentResponseResponse = number | void; 1265 1265 1266 1266 export type DummyAResponse = _400; 1267 1267 1268 - export type DummyBResponse = undefined; 1268 + export type DummyBResponse = void; 1269 1269 1270 1270 export type CallWithResponseResponse = _import; 1271 1271
+4 -4
packages/openapi-ts/test/__snapshots__/3.1.x/plugins/@tanstack/solid-query/asClass/types.gen.ts
··· 1136 1136 }; 1137 1137 }; 1138 1138 1139 - export type PostCallWithOptionalParamResponse = number | undefined; 1139 + export type PostCallWithOptionalParamResponse = number | void; 1140 1140 1141 1141 export type PostApiVbyApiVersionRequestBodyData = { 1142 1142 /** ··· 1259 1259 }; 1260 1260 }; 1261 1261 1262 - export type CallWithNoContentResponseResponse = undefined; 1262 + export type CallWithNoContentResponseResponse = void; 1263 1263 1264 - export type CallWithResponseAndNoContentResponseResponse = number | undefined; 1264 + export type CallWithResponseAndNoContentResponseResponse = number | void; 1265 1265 1266 1266 export type DummyAResponse = _400; 1267 1267 1268 - export type DummyBResponse = undefined; 1268 + export type DummyBResponse = void; 1269 1269 1270 1270 export type CallWithResponseResponse = _import; 1271 1271
+4 -4
packages/openapi-ts/test/__snapshots__/3.1.x/plugins/@tanstack/solid-query/axios/types.gen.ts
··· 1136 1136 }; 1137 1137 }; 1138 1138 1139 - export type PostCallWithOptionalParamResponse = number | undefined; 1139 + export type PostCallWithOptionalParamResponse = number | void; 1140 1140 1141 1141 export type PostApiVbyApiVersionRequestBodyData = { 1142 1142 /** ··· 1259 1259 }; 1260 1260 }; 1261 1261 1262 - export type CallWithNoContentResponseResponse = undefined; 1262 + export type CallWithNoContentResponseResponse = void; 1263 1263 1264 - export type CallWithResponseAndNoContentResponseResponse = number | undefined; 1264 + export type CallWithResponseAndNoContentResponseResponse = number | void; 1265 1265 1266 1266 export type DummyAResponse = _400; 1267 1267 1268 - export type DummyBResponse = undefined; 1268 + export type DummyBResponse = void; 1269 1269 1270 1270 export type CallWithResponseResponse = _import; 1271 1271
+4 -4
packages/openapi-ts/test/__snapshots__/3.1.x/plugins/@tanstack/solid-query/fetch/types.gen.ts
··· 1136 1136 }; 1137 1137 }; 1138 1138 1139 - export type PostCallWithOptionalParamResponse = number | undefined; 1139 + export type PostCallWithOptionalParamResponse = number | void; 1140 1140 1141 1141 export type PostApiVbyApiVersionRequestBodyData = { 1142 1142 /** ··· 1259 1259 }; 1260 1260 }; 1261 1261 1262 - export type CallWithNoContentResponseResponse = undefined; 1262 + export type CallWithNoContentResponseResponse = void; 1263 1263 1264 - export type CallWithResponseAndNoContentResponseResponse = number | undefined; 1264 + export type CallWithResponseAndNoContentResponseResponse = number | void; 1265 1265 1266 1266 export type DummyAResponse = _400; 1267 1267 1268 - export type DummyBResponse = undefined; 1268 + export type DummyBResponse = void; 1269 1269 1270 1270 export type CallWithResponseResponse = _import; 1271 1271
+4 -4
packages/openapi-ts/test/__snapshots__/3.1.x/plugins/@tanstack/svelte-query/asClass/types.gen.ts
··· 1136 1136 }; 1137 1137 }; 1138 1138 1139 - export type PostCallWithOptionalParamResponse = number | undefined; 1139 + export type PostCallWithOptionalParamResponse = number | void; 1140 1140 1141 1141 export type PostApiVbyApiVersionRequestBodyData = { 1142 1142 /** ··· 1259 1259 }; 1260 1260 }; 1261 1261 1262 - export type CallWithNoContentResponseResponse = undefined; 1262 + export type CallWithNoContentResponseResponse = void; 1263 1263 1264 - export type CallWithResponseAndNoContentResponseResponse = number | undefined; 1264 + export type CallWithResponseAndNoContentResponseResponse = number | void; 1265 1265 1266 1266 export type DummyAResponse = _400; 1267 1267 1268 - export type DummyBResponse = undefined; 1268 + export type DummyBResponse = void; 1269 1269 1270 1270 export type CallWithResponseResponse = _import; 1271 1271
+4 -4
packages/openapi-ts/test/__snapshots__/3.1.x/plugins/@tanstack/svelte-query/axios/types.gen.ts
··· 1136 1136 }; 1137 1137 }; 1138 1138 1139 - export type PostCallWithOptionalParamResponse = number | undefined; 1139 + export type PostCallWithOptionalParamResponse = number | void; 1140 1140 1141 1141 export type PostApiVbyApiVersionRequestBodyData = { 1142 1142 /** ··· 1259 1259 }; 1260 1260 }; 1261 1261 1262 - export type CallWithNoContentResponseResponse = undefined; 1262 + export type CallWithNoContentResponseResponse = void; 1263 1263 1264 - export type CallWithResponseAndNoContentResponseResponse = number | undefined; 1264 + export type CallWithResponseAndNoContentResponseResponse = number | void; 1265 1265 1266 1266 export type DummyAResponse = _400; 1267 1267 1268 - export type DummyBResponse = undefined; 1268 + export type DummyBResponse = void; 1269 1269 1270 1270 export type CallWithResponseResponse = _import; 1271 1271
+4 -4
packages/openapi-ts/test/__snapshots__/3.1.x/plugins/@tanstack/svelte-query/fetch/types.gen.ts
··· 1136 1136 }; 1137 1137 }; 1138 1138 1139 - export type PostCallWithOptionalParamResponse = number | undefined; 1139 + export type PostCallWithOptionalParamResponse = number | void; 1140 1140 1141 1141 export type PostApiVbyApiVersionRequestBodyData = { 1142 1142 /** ··· 1259 1259 }; 1260 1260 }; 1261 1261 1262 - export type CallWithNoContentResponseResponse = undefined; 1262 + export type CallWithNoContentResponseResponse = void; 1263 1263 1264 - export type CallWithResponseAndNoContentResponseResponse = number | undefined; 1264 + export type CallWithResponseAndNoContentResponseResponse = number | void; 1265 1265 1266 1266 export type DummyAResponse = _400; 1267 1267 1268 - export type DummyBResponse = undefined; 1268 + export type DummyBResponse = void; 1269 1269 1270 1270 export type CallWithResponseResponse = _import; 1271 1271
+4 -4
packages/openapi-ts/test/__snapshots__/3.1.x/plugins/@tanstack/vue-query/asClass/types.gen.ts
··· 1136 1136 }; 1137 1137 }; 1138 1138 1139 - export type PostCallWithOptionalParamResponse = number | undefined; 1139 + export type PostCallWithOptionalParamResponse = number | void; 1140 1140 1141 1141 export type PostApiVbyApiVersionRequestBodyData = { 1142 1142 /** ··· 1259 1259 }; 1260 1260 }; 1261 1261 1262 - export type CallWithNoContentResponseResponse = undefined; 1262 + export type CallWithNoContentResponseResponse = void; 1263 1263 1264 - export type CallWithResponseAndNoContentResponseResponse = number | undefined; 1264 + export type CallWithResponseAndNoContentResponseResponse = number | void; 1265 1265 1266 1266 export type DummyAResponse = _400; 1267 1267 1268 - export type DummyBResponse = undefined; 1268 + export type DummyBResponse = void; 1269 1269 1270 1270 export type CallWithResponseResponse = _import; 1271 1271
+4 -4
packages/openapi-ts/test/__snapshots__/3.1.x/plugins/@tanstack/vue-query/axios/types.gen.ts
··· 1136 1136 }; 1137 1137 }; 1138 1138 1139 - export type PostCallWithOptionalParamResponse = number | undefined; 1139 + export type PostCallWithOptionalParamResponse = number | void; 1140 1140 1141 1141 export type PostApiVbyApiVersionRequestBodyData = { 1142 1142 /** ··· 1259 1259 }; 1260 1260 }; 1261 1261 1262 - export type CallWithNoContentResponseResponse = undefined; 1262 + export type CallWithNoContentResponseResponse = void; 1263 1263 1264 - export type CallWithResponseAndNoContentResponseResponse = number | undefined; 1264 + export type CallWithResponseAndNoContentResponseResponse = number | void; 1265 1265 1266 1266 export type DummyAResponse = _400; 1267 1267 1268 - export type DummyBResponse = undefined; 1268 + export type DummyBResponse = void; 1269 1269 1270 1270 export type CallWithResponseResponse = _import; 1271 1271
+4 -4
packages/openapi-ts/test/__snapshots__/3.1.x/plugins/@tanstack/vue-query/fetch/types.gen.ts
··· 1136 1136 }; 1137 1137 }; 1138 1138 1139 - export type PostCallWithOptionalParamResponse = number | undefined; 1139 + export type PostCallWithOptionalParamResponse = number | void; 1140 1140 1141 1141 export type PostApiVbyApiVersionRequestBodyData = { 1142 1142 /** ··· 1259 1259 }; 1260 1260 }; 1261 1261 1262 - export type CallWithNoContentResponseResponse = undefined; 1262 + export type CallWithNoContentResponseResponse = void; 1263 1263 1264 - export type CallWithResponseAndNoContentResponseResponse = number | undefined; 1264 + export type CallWithResponseAndNoContentResponseResponse = number | void; 1265 1265 1266 1266 export type DummyAResponse = _400; 1267 1267 1268 - export type DummyBResponse = undefined; 1268 + export type DummyBResponse = void; 1269 1269 1270 1270 export type CallWithResponseResponse = _import; 1271 1271
+2 -2
packages/openapi-ts/test/sample.cjs
··· 13 13 input: { 14 14 // include: 15 15 // '^(#/components/schemas/import|#/paths/api/v{api-version}/simple/options)$', 16 - path: './test/spec/3.1.x/enum-null.json', 16 + path: './test/spec/3.0.x/full.json', 17 17 // path: 'https://mongodb-mms-prod-build-server.s3.amazonaws.com/openapi/2caffd88277a4e27c95dcefc7e3b6a63a3b03297-v2-2023-11-15.json', 18 18 }, 19 19 // name: 'foo', ··· 43 43 // enums: 'javascript', 44 44 name: '@hey-api/types', 45 45 // style: 'PascalCase', 46 - // tree: false, 46 + tree: true, 47 47 }, 48 48 // '@tanstack/react-query', 49 49 // 'zod',
+28
packages/openapi-ts/test/spec/3.0.x/operation-204.json
··· 1 + { 2 + "openapi": "3.0.0", 3 + "info": { 4 + "title": "OpenAPI 3.0.0 operation 204 example", 5 + "version": "1" 6 + }, 7 + "paths": { 8 + "/foo": { 9 + "post": { 10 + "responses": { 11 + "200": { 12 + "description": "OK", 13 + "content": { 14 + "application/json": { 15 + "schema": { 16 + "type": "string" 17 + } 18 + } 19 + } 20 + }, 21 + "204": { 22 + "description": "Created" 23 + } 24 + } 25 + } 26 + } 27 + } 28 + }
+28
packages/openapi-ts/test/spec/3.1.x/operation-204.json
··· 1 + { 2 + "openapi": "3.1.0", 3 + "info": { 4 + "title": "OpenAPI 3.1.0 operation 204 example", 5 + "version": "1" 6 + }, 7 + "paths": { 8 + "/foo": { 9 + "post": { 10 + "responses": { 11 + "200": { 12 + "description": "OK", 13 + "content": { 14 + "application/json": { 15 + "schema": { 16 + "type": "string" 17 + } 18 + } 19 + } 20 + }, 21 + "204": { 22 + "description": "Created" 23 + } 24 + } 25 + } 26 + } 27 + } 28 + }