Skip to content
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

Discriminator support #95

Closed
frejonb opened this issue Oct 25, 2019 · 2 comments
Closed

Discriminator support #95

frejonb opened this issue Oct 25, 2019 · 2 comments

Comments

@frejonb
Copy link

frejonb commented Oct 25, 2019

Do you support validation against the discriminator spec https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#discriminatorObject ?

@cdimascio
Copy link
Owner

cdimascio commented Oct 25, 2019

The short answer is Yes. Discriminators are supported (indirectly).

To quote Evgeny

...in OpenAPI v3 you must use oneOf, discriminator is just to inform the tools what is the logic behind these oneOfs. My understanding is that removing discriminator in v3 should always result in the same validation outcome (valid/invalid), but may affect error reporting or some other behaviours. So from validation point of view it can be just ignored.

Assuming, this is the case, then yes, express-openapi-validator does support discriminators given it supports oneOf.

If you find that they is a gap or something is not working, please let us know and we'll get to work on it.

@frejonb
Copy link
Author

frejonb commented Oct 26, 2019

Fair enough

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants