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: respect the required parameter in the body #450

Merged
merged 30 commits into from
Jul 12, 2019

Conversation

XVincentX
Copy link
Contributor

@XVincentX XVincentX commented Jul 11, 2019

Closes #419
Requires #446

XVincentX and others added 23 commits July 10, 2019 12:41
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]>
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]>
@XVincentX XVincentX changed the title fix: respect the required parameter in the body closes #419 fix: respect the required parameter in the body Jul 11, 2019
@XVincentX XVincentX force-pushed the feat/body-validation-required branch from 44df14b to a071b25 Compare July 11, 2019 10:41
@XVincentX XVincentX force-pushed the feat/body-validation-required branch from 7419c0d to 62efb4d Compare July 11, 2019 11:03
@XVincentX XVincentX marked this pull request as ready for review July 11, 2019 11:05
@@ -2,7 +2,7 @@
"swagger": "2.0",
"paths": {
"/pet": {
"get": {
"post": {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

In case you're wondering, get should not really have body parameters.

this.bodyValidator
.validate(body, (request && request.body && request.body.contents) || [], mediaType)
.forEach(validationResult => results.push(validationResult));
if (request && request.body) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This will be way easier to read when we'll introduce Option<T> in fp-ts.

@XVincentX XVincentX merged commit 8329ce7 into master Jul 12, 2019
@XVincentX XVincentX deleted the feat/body-validation-required branch July 12, 2019 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prism does not take the "required" property into account when validating body param
2 participants