-
Notifications
You must be signed in to change notification settings - Fork 343
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: respect the required parameter in the body (#450)
* feat: kill the validator registry concept for body * test: kill tests that aren't needed anymore * test: kill snapshot * test: keep the test that make sense * test: use a verb that does not exist for real * test: fix the documents * test: add harness test 1 * test: harness part 2 * test: add shell:true flag * fix: put better error message when stuff does not match * test: adjust responses * chore(deps): [security] bump lodash.template from 4.4.0 to 4.5.0 (#447) Bumps [lodash.template](https://github.com/lodash/lodash) from 4.4.0 to 4.5.0. **This update includes security fixes.** - [Release notes](https://github.com/lodash/lodash/releases) - [Commits](lodash/lodash@4.4.0...4.5.0) Signed-off-by: dependabot-preview[bot] <[email protected]> * chore(deps): [security] bump lodash from 4.17.11 to 4.17.13 (#448) Bumps [lodash](https://github.com/lodash/lodash) from 4.17.11 to 4.17.13. **This update includes security fixes.** - [Release notes](https://github.com/lodash/lodash/releases) - [Commits](lodash/lodash@4.17.11...4.17.13) Signed-off-by: dependabot-preview[bot] <[email protected]> * use bash for harness on windows * test: no harness on windows * test: add failing test * docs: precise yet another limitation * fix: add validation error if body is required but not present * feat: validate only when necessary * test:fix * chore: cleanup * test: make test behave as they should * chore: only post has body * test:fix * test: do not repeat the test stuff and generalise
- Loading branch information
Showing
7 changed files
with
91 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
====test==== | ||
When I send a request to an operation that has a body parameter | ||
and such body parameter is not required | ||
I shuold get 200 response | ||
====spec==== | ||
swagger: '2.0' | ||
paths: | ||
/pet: | ||
post: | ||
produces: | ||
- application/json | ||
consumes: | ||
- application/json | ||
parameters: | ||
- in: body | ||
name: body | ||
required: false | ||
schema: | ||
type: object | ||
properties: | ||
id: | ||
type: integer | ||
format: int64 | ||
responses: | ||
'200': | ||
schema: | ||
type: string | ||
====server==== | ||
mock -p 4010 | ||
====command==== | ||
curl -i -X POST http://127.0.0.1:4010/pet | ||
====expect==== | ||
HTTP/1.1 200 OK | ||
content-type: application/json; charset=utf-8 | ||
content-length: 7 | ||
Date: Fri, 21 Jun 2019 09:25:34 GMT | ||
Connection: keep-alive | ||
|
||
"string" |