Support top level oneOf
and anyOf
#829
Replies: 5 comments
-
I guess on second thought here, it's unclear how we'd actually represent a model which is nothing other than a union of other models. Maybe the desired outcome of this ticket is simply to raise an error during code generation? |
Beta Was this translation helpful? Give feedback.
-
For I'd love to know how folks are actually using |
Beta Was this translation helpful? Give feedback.
-
Openapi schemas can combine oneOf anyOf allOf and properties all in a single schema. |
Beta Was this translation helpful? Give feedback.
-
What is the status for this issue? Because I am in a situation there I need it and would love to not create workarounds for it 😉 |
Beta Was this translation helpful? Give feedback.
-
Describe the bug
If a top-level schema is defined using
oneOf
oranyOf
, the generated model has no properties.To Reproduce
See this PR which adds a test case for the bug: #387
Expected behavior
It should work the same way as it does for model properties, i.e., constructing a union type.
OpenAPI Spec File
#387
Desktop (please complete the following information):
Beta Was this translation helpful? Give feedback.
All reactions