-
-
Notifications
You must be signed in to change notification settings - Fork 211
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
Valid 3.0.0 spec with polymorphism cannot be loaded by validator when validateResponses is true #511
Comments
@jrosmithMG this looks like a dupe of #509 |
@jrosmithMG thanks for the spec. i can reproduce it. i'll have a look at fixing this (hopefully tomorrow night) |
@jrosmithMG fixed in v4.10.3 |
keeping this open as there is additional work to fix this properly |
cdimascio
added a commit
that referenced
this issue
Jan 11, 2021
cdimascio
added a commit
that referenced
this issue
Jan 11, 2021
* feat: skip visited nodes * fix: remove uneeded clones * fix: cleanup * fix: remove yaml parse * fix: remove merge * fix: remove uneeded deps * chore: beta * fix: skip schemas * fix: update path to $refs * fix: visit ref and update deref path * chore: comment * test: add polymorphism test for #511
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
OS: macOS Catalina (10.15.7)
nodejs version: 12.14.1
npm version: 6.13.4
express-openapi-validator version: 4.0.0
Observed Behavior
An openapi spec validated by editor.swaggerhub.io cannot be loaded by express-openapi-validator when using polymorphism and setting
validateResponses
to true.Expected Behavior
Polymorphic specs should be appropriately loaded by express-openapi-validator and validate responses.
Steps To Reproduce
Using the following example api spec:
and a basic express setup:
When
validateResponses: true
is uncommented, the following exception is thrown:Notes
This is the smallest snippet I could create to reproduce the error - the actual spec implementing this contains much more complex polymorphic logic. I'm unsure why
validateResponses
seemingly triggers the issue given that the example spec declares the response to be an object and not any of the polymorphic objects.The text was updated successfully, but these errors were encountered: