guardrail-dev / guardrail-dev/guardrail
Permit `type: object` anywhere a schema body is possible
- Dominant language
- Scala
- Stars
- 541
- Forks
- 138
- PR merge metrics
- No merged PRs in 30d
Description
Currently, only top-level `definitions` are turned into case classes. This provides a serious limitation to consuming existent OpenAPI specifications that represent APIs as heavily nested structures.
One possibility is to generate class names similar to the Scala compiler itself, suffixing the parent class with some disambiguating identifier. Additionally, as mentioned in #43, introducing an `x-scala-` extension that permits naming these in-line `type: object` definitions would significantly improve ergonomics of generated structures.
A middle-ground where both approaches are taken is acceptable, though I expect non-trivial structures would end up with names for all children.
Alternately, generating successively nested case classes, defined inside the parent companion object would work for `definitions`, and a similar solution may be possible with direct parameters as well.
Contributor guide
Assessment
This issue has not been assessed yet.