Skip to content

Adding Schema Identifier to Type in fields generated from oneOf. #2192

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
1 task done
comsma opened this issue Mar 5, 2025 · 0 comments
Open
1 task done

Adding Schema Identifier to Type in fields generated from oneOf. #2192

comsma opened this issue Mar 5, 2025 · 0 comments
Labels
enhancement New feature or request openapi-ts Relevant to the openapi-typescript library

Comments

@comsma
Copy link

comsma commented Mar 5, 2025

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

@comsma comsma added enhancement New feature or request openapi-ts Relevant to the openapi-typescript library labels Mar 5, 2025
@comsma comsma changed the title Adding Kind Identifier to Type in fields generated from oneOf. Adding Schema Identifier to Type in fields generated from oneOf. Mar 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request openapi-ts Relevant to the openapi-typescript library
Projects
None yet
Development

No branches or pull requests

1 participant