OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
> npm run build
test_client_ts/models/OneOf.ts:47:13 - error TS2322: Type 'A & { type: string; }' is not assignable to type 'OneOf'.
Type 'A & { type: string; }' is not assignable to type '{ type: "B"; } & B'.
Type 'A & { type: string; }' is not assignable to type '{ type: "B"; }'.
Types of property 'type' are incompatible.
Type 'string' is not assignable to type '"B"'.
47 return Object.assign({}, AFromJSONTyped(json, true), { type: 'A' });
~~~~~~
test_client_ts/models/OneOf.ts:49:13 - error TS2322: Type 'B & { type: string; }' is not assignable to type 'OneOf'.
Type 'B & { type: string; }' is not assignable to type '{ type: "B"; } & B'.
Type 'B & { type: string; }' is not assignable to type '{ type: "B"; }'.
Types of property 'type' are incompatible.
Type 'string' is not assignable to type '"B"'.
49 return Object.assign({}, BFromJSONTyped(json, true), { type: 'B' });
~~~~~~
Found 2 errors in the same file, starting at: test_client_ts/models/OneOf.ts:47
Bug Report Checklist
Description
openapi-generator version
OpenAPI declaration file content or url
Generation Details
Steps to reproduce
Related issues/PRs
The change in #18154 now causes this issues.
Suggest a fix