Skip to content

Map oneOf with discriminator to sum type #953

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

Closed
benlongo opened this issue Oct 14, 2022 · 1 comment · Fixed by #968
Closed

Map oneOf with discriminator to sum type #953

benlongo opened this issue Oct 14, 2022 · 1 comment · Fixed by #968
Assignees
Labels
3.1 Part of OpenAPI 3.1 enhancement New feature or request planned Expected in an upcoming version

Comments

@benlongo
Copy link

The example here https://swagger.io/docs/specification/data-models/inheritance-and-polymorphism/ can map cleanly to a sum type in typescript. I don't believe the discriminator is currently analyzed however. This would enable narrowing in the client for polymorphic objects.

@drwpow drwpow self-assigned this Oct 30, 2022
@drwpow drwpow added enhancement New feature or request 3.1 Part of OpenAPI 3.1 labels Oct 30, 2022
@drwpow
Copy link
Contributor

drwpow commented Oct 30, 2022

This is in the roadmap for the upcoming 3.1 improvements!

@drwpow drwpow added the planned Expected in an upcoming version label Oct 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.1 Part of OpenAPI 3.1 enhancement New feature or request planned Expected in an upcoming version
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants