Open Edward-Upton opened 3 weeks ago
Yes, I'm also having this issue.
Using allOf
s to define a type in a OAS spec file produces a union type when generating TypeScript:
type MyUnionType = SomeType & SomeOtherType;
This is great, but the issue is that the generated types are not completely inheriting the properties marked as required despite being defined in the specs, and are instead being generated as optional, this means extra care from the dev to verify the type's usage and handle them to satisfy the ts compiler, minor inconvenience and somewhat annoying, though not a dealbreaker.
What are the steps to reproduce this issue?
allOf
, e.g:export type ContractAllOf = { active: boolean; };
export type Contract = ContractPartial & ContractAllOf;
System: OS: Linux 4.18 Rocky Linux 8.8 (Green Obsidian) CPU: (4) x64 Intel(R) Xeon(R) Gold 6132 CPU @ 2.60GHz Memory: 2.16 GB / 11.45 GB Container: Yes Shell: 3.6.1 - /usr/bin/fish npmPackages: axios: ^1.3.6 => 1.3.6 msw: ^2.2.0 => 2.2.0 orval: ^7.2.0 => 7.2.0