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 #855 from hey-api/fix/error-type-union

fix: define multiple errors type as union instead of intersection

authored by

Lubos and committed by
GitHub
450d7852 e344ee0a

+12 -7
+5
.changeset/eight-shoes-laugh.md
··· 1 + --- 2 + '@hey-api/openapi-ts': patch 3 + --- 4 + 5 + fix: define multiple errors type as union instead of intersection
+1 -1
packages/openapi-ts/src/generate/types.ts
··· 455 455 errorResponses.length 456 456 ? { 457 457 ...emptyModel, 458 - export: 'all-of', 458 + export: 'one-of', 459 459 isRequired: true, 460 460 properties: errorResponses, 461 461 }
+1 -1
packages/openapi-ts/test/__snapshots__/test/generated/v3_hey-api_client-axios/types.gen.ts.snap
··· 1315 1315 1316 1316 export type CallWithDuplicateResponsesResponse = ModelWithBoolean & ModelWithInteger | ModelWithString; 1317 1317 1318 - export type CallWithDuplicateResponsesError = ModelWithStringError & DictionaryWithArray & ModelWithBoolean; 1318 + export type CallWithDuplicateResponsesError = ModelWithStringError | DictionaryWithArray | ModelWithBoolean; 1319 1319 1320 1320 export type CallWithResponsesResponse = { 1321 1321 readonly '@namespace.string'?: string;
+1 -1
packages/openapi-ts/test/__snapshots__/test/generated/v3_hey-api_client-axios_bundle/types.gen.ts.snap
··· 1315 1315 1316 1316 export type CallWithDuplicateResponsesResponse = ModelWithBoolean & ModelWithInteger | ModelWithString; 1317 1317 1318 - export type CallWithDuplicateResponsesError = ModelWithStringError & DictionaryWithArray & ModelWithBoolean; 1318 + export type CallWithDuplicateResponsesError = ModelWithStringError | DictionaryWithArray | ModelWithBoolean; 1319 1319 1320 1320 export type CallWithResponsesResponse = { 1321 1321 readonly '@namespace.string'?: string;
+1 -1
packages/openapi-ts/test/__snapshots__/test/generated/v3_hey-api_client-fetch/types.gen.ts.snap
··· 1315 1315 1316 1316 export type CallWithDuplicateResponsesResponse = ModelWithBoolean & ModelWithInteger | ModelWithString; 1317 1317 1318 - export type CallWithDuplicateResponsesError = ModelWithStringError & DictionaryWithArray & ModelWithBoolean; 1318 + export type CallWithDuplicateResponsesError = ModelWithStringError | DictionaryWithArray | ModelWithBoolean; 1319 1319 1320 1320 export type CallWithResponsesResponse = { 1321 1321 readonly '@namespace.string'?: string;
+1 -1
packages/openapi-ts/test/__snapshots__/test/generated/v3_hey-api_client-fetch_bundle/types.gen.ts.snap
··· 1315 1315 1316 1316 export type CallWithDuplicateResponsesResponse = ModelWithBoolean & ModelWithInteger | ModelWithString; 1317 1317 1318 - export type CallWithDuplicateResponsesError = ModelWithStringError & DictionaryWithArray & ModelWithBoolean; 1318 + export type CallWithDuplicateResponsesError = ModelWithStringError | DictionaryWithArray | ModelWithBoolean; 1319 1319 1320 1320 export type CallWithResponsesResponse = { 1321 1321 readonly '@namespace.string'?: string;
+1 -1
packages/openapi-ts/test/__snapshots__/test/generated/v3_hey-api_client-fetch_plugin_tanstack-react-query/types.gen.ts.snap
··· 1315 1315 1316 1316 export type CallWithDuplicateResponsesResponse = ModelWithBoolean & ModelWithInteger | ModelWithString; 1317 1317 1318 - export type CallWithDuplicateResponsesError = ModelWithStringError & DictionaryWithArray & ModelWithBoolean; 1318 + export type CallWithDuplicateResponsesError = ModelWithStringError | DictionaryWithArray | ModelWithBoolean; 1319 1319 1320 1320 export type CallWithResponsesResponse = { 1321 1321 readonly '@namespace.string'?: string;
+1 -1
packages/openapi-ts/test/sample.cjs
··· 22 22 }, 23 23 services: { 24 24 // asClass: true, 25 - filter: '^POST /api/v{api-version}/upload$', 25 + // filter: '^POST /api/v{api-version}/upload$', 26 26 // export: false, 27 27 // name: '^Parameters', 28 28 },