-
Notifications
You must be signed in to change notification settings - Fork 90
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
fix: do not crash when operation has illegal $ref, print error instead #103
Conversation
* add hasRefProperty utility module, refactor some logic to use it
Codecov Report
@@ Coverage Diff @@
## master #103 +/- ##
==========================================
+ Coverage 92.04% 92.09% +0.04%
==========================================
Files 52 53 +1
Lines 1873 1884 +11
==========================================
+ Hits 1724 1735 +11
Misses 149 149
Continue to review full report at Codecov.
|
|
||
module.exports.validate = function({ resolvedSpec, isOAS3 }, config) { | ||
module.exports.validate = function({ jsSpec, resolvedSpec, isOAS3 }, config) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course! I always thought of validators as operating on either the jsSpec
or resolvedSpec
, but no reason you can't use both. Nice!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! 👍
## [0.13.5](v0.13.4...v0.13.5) (2019-08-28) ### Bug Fixes * do not crash when operation has illegal $ref, print error instead ([#103](#103)) ([3d34205](3d34205))
🎉 This PR is included in version 0.13.5 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Currently, the validator will crash if an operation is illegally defined by a $ref. This PR addresses that issue and also prints a warning for an illegal $ref in an operation.
I also added a module to check for $refs when working with the resolved spec as it was needed in a couple of places.
Todo:
Resolves #100