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

fix: dont validate schema properties called 'responses' as responses #194

Merged
merged 1 commit into from
Sep 2, 2020

Conversation

dpopp07
Copy link
Member

@dpopp07 dpopp07 commented Aug 31, 2020

Previously, the only way we checked for a response object was by checking for the string "responses" in the path at a certain location. This would cause schema properties named responses to be validated as if it were a response. This would cause confusing warnings/errors.

This PR introduces robust logic to prove that the object in question is in fact, a response.

Additionally, I fixed some linting issues and added a linting step to the Travis build so that these things won't go uncaught in the future.

Resolves #188

@dpopp07 dpopp07 requested a review from mkistler August 31, 2020 16:03
Copy link
Contributor

@mkistler mkistler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good but I left a recommendation for a minor name change.

src/plugins/utils/is-response.js Outdated Show resolved Hide resolved
@dpopp07 dpopp07 merged commit 4277079 into master Sep 2, 2020
@dpopp07 dpopp07 deleted the dp/responses-false-positive branch September 2, 2020 16:44
dpopp07 pushed a commit that referenced this pull request Sep 2, 2020
## [0.29.3](v0.29.2...v0.29.3) (2020-09-02)

### Bug Fixes

* dont validate schema properties called 'responses' as responses ([#194](#194)) ([4277079](4277079))
@dpopp07
Copy link
Member Author

dpopp07 commented Sep 2, 2020

🎉 This PR is included in version 0.29.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

Property name in model schema is triggering the response validation
2 participants