-
-
Notifications
You must be signed in to change notification settings - Fork 208
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 Issue #635
Comments
This seems to be a bug when combining discriminators with references. In https://github.com/cdimascio/express-openapi-validator/blob/master/src/middlewares/parsers/schema.preprocessor.ts#L318 a
|
I have created a PR to fix this: #651 |
@alonsohki I am facing the same problem here. Are your sure that this issue is still fixed? |
Describe the bug
Under certain conditions involving allOf and discriminator fields, OAS can't be resolved.
Describing this is difficult. It's best understood by looking at the examples and work around below.
To Reproduce
root.yaml
Currency.yaml
CurrencyBase.yaml
Applies to the latest version - 4.12.14
Actual behavior
When launching the back end application, the following line is shown:
When making a query to any endpoint, the following error is shown:
Expected behavior
Error free validation.
Examples and context
I've investigated a bit to thoroughly understand how this error is occurring. I've found two ways that do not cause an error.
In the
root.yaml
file above, simply remove the discriminator field (and all child fields) and validation works as expected.In the
root.yaml
file above, change the schema of the price object from:to
The text was updated successfully, but these errors were encountered: