Hi, I encountered an issue when generating a discriminated union type with npx openapicmd typegen. When the discriminated union is assigned as a nullable property, the type is generated as null | null. but when assigned as a nullable: false property, it's generated fine.
I managed to get a minimal reproduction with the following command and apidoc:
note that I had to copy BudgetTarget into two different schemas in order to demonstrate it generating correctly for requiredTarget. If they both reference the same schema, then both properties generate as null | null
Hi, I encountered an issue when generating a discriminated union type with
npx openapicmd typegen
. When the discriminated union is assigned as a nullable property, the type is generated asnull | null
. but when assigned as anullable: false
property, it's generated fine.I managed to get a minimal reproduction with the following command and apidoc:
command
npx -y openapicmd typegen api-doc.json > client.ts
api-doc.json
generated client.ts
note that I had to copy BudgetTarget into two different schemas in order to demonstrate it generating correctly for
requiredTarget
. If they both reference the same schema, then both properties generate asnull | null