openapi-typescript
openapi-typescript copied to clipboard
Adding Schema Identifier to Type in fields generated from oneOf.
Description
I am currently using a schema that i'm returning search results with. I have implemented an aggregation schema that can represent multiple types of aggregations using the oneOf field in the openapi schema.
I am currently facing the issue of checking the aggregation schema type that is being used. Without explicitly checking for the existence of fields.
Proposal
When generating the schema typescript file is it possible to embed the type of schema being returned? Or implementing helper functions to check the type being returned?
Extra
- [x] I’m willing to open a PR (see CONTRIBUTING.md)