[REQ] Better support for openapi document inline/nested schemas #15699
Labels
Enhancement: Feature
Inline Schema Handling
Schema contains a complex schema in items/additionalProperties/allOf/oneOf/anyOf
Is your feature request related to a problem? Please describe.
Please add better support for inline/nested schemas
Describe the solution you'd like
These json schema keywords:
Allow inline schema definitions.
Many generators do not support deep levels of inlining/nesting.
If those schemas are traversed with post order traversal, then accumulated into a list, they can be generated in an order where the root schema that uses the dependencies comes last. Naming should be done in a pre order traversal (reverse the class writing order) to ensure that the root schema has a highest priority name.
This would allow inline schemas to be supported in many more generators.
I wrote a PR that does this in my similar-to python generator project here:
openapi-json-schema-tools/openapi-json-schema-generator#177
Your project could add a similar feature
Example:
Becomes a list of schemas when examining SchemaA
Describe alternatives you've considered
Additional context
Related issues:
allOf
when defined in intermediate properties #10219The text was updated successfully, but these errors were encountered: