You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to use Orval to generate an API that uses inheritance. But, my subclass' fields are being generated as optional even though I have marked them as required.
Use Orval to generate models using the following Yaml:
But I shouldn't have to do that! NewTicketNotification already has ticketId declared as required. This should supersede the non-required property included in the allOf.
Any other comments?
Swagger's editor and codegen tool interpret the YAML correctly so I think I have interpreted the spec correctly! (See pictures)
I presume the parser needs a change to use the oneOf/allOf/anyOf key to make properties required (if needed) or leave them alone if they are already required.
What are the steps to reproduce this issue?
I want to use Orval to generate an API that uses inheritance. But, my subclass' fields are being generated as optional even though I have marked them as required.
What happens?
Orval generates the following:
What were you expecting to happen?
The fields in the subclass
NewTicketNotificationAllOf
should be required. E.g.They actually are generated as required if I manually add
required
in the properties of the allOf. E.g.But I shouldn't have to do that!
NewTicketNotification
already hasticketId
declared as required. This should supersede the non-required property included in the allOf.Any other comments?
Swagger's editor and codegen tool interpret the YAML correctly so I think I have interpreted the spec correctly! (See pictures)
I presume the parser needs a change to use the oneOf/allOf/anyOf key to make properties required (if needed) or leave them alone if they are already required.
What versions are you using?
Latest code built from Github.
System:
OS: Linux 6.5 Ubuntu 22.04.4 LTS 22.04.4 LTS (Jammy Jellyfish)
CPU: (12) x64 AMD Ryzen 5 3600X 6-Core Processor
Memory: 2.69 GB / 15.55 GB
Container: Yes
Shell: 5.1.16 - /bin/bash
The text was updated successfully, but these errors were encountered: