-
Notifications
You must be signed in to change notification settings - Fork 37
feat(chai): support openapi2 basepath #172
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
feat(chai): support openapi2 basepath #172
Conversation
The chai validator now uses OpenApi2's 'basePath' parameter if it is present. This commit also contains updates to the pertinent error messages.
Codecov Report
@@ Coverage Diff @@
## master #172 +/- ##
==========================================
Coverage ? 100.00%
==========================================
Files ? 33
Lines ? 664
Branches ? 47
==========================================
Hits ? 664
Misses ? 0
Partials ? 0
Continue to review full report at Codecov.
|
|
Thanks very much! Will review when I can |
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 great, thanks a lot! Final few small name changes then we can merge!
Then I'll:
- port it to the jest plugin
- maybe rename "defined" to "provided" (see the comment below)
- update the Contributing.md as per your suggestions
- release :):)
packages/chai-openapi-response-validator/lib/assertions/satisfyApiSpec.js
Outdated
Show resolved
Hide resolved
...es/chai-openapi-response-validator/test/assertions/satisfyApiSpec/basePathVariations.test.js
Outdated
Show resolved
Hide resolved
commonTestResources/exampleOpenApiFiles/valid/basePathVariations/basePathDefined.yml
Show resolved
Hide resolved
|
Thank you for the updates! At a quick glance they look great. I'll give this a full final review asap and hopefully merge :) |
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.
Super!
For anyone looking at this in future, this satisfies
- the behaviour we agreed to in #160 (comment)
- the test cases we chose in #160 (comment)
Summary
This PR replaces my our first attempt to implement base path support (#160; see also Issue #159). It accomplishes two things:
basePathsupport for OpenApi2basePathand OpenApi3servererrors are handled consistently (see the discussion here).Commits
basePathsupport and error messages) via tests.basePathsupport and the pertinent error messages.utilsfile.AUTHORS.md.