Skip to content

Fix validation for Body without $ref#185

Open
danopz wants to merge 3 commits intopipermerriam:masterfrom
danopz:noref-body
Open

Fix validation for Body without $ref#185
danopz wants to merge 3 commits intopipermerriam:masterfrom
danopz:noref-body

Conversation

@danopz
Copy link
Copy Markdown
Contributor

@danopz danopz commented Nov 22, 2017

This fixes the bug where required is not validated.
But fixing it this way leads test_local_parameter_values_override_schema to fail. I don't really get what this test is about, since the definition doesn't seem to be right?

Fixes #138

@mkraemer67
Copy link
Copy Markdown

mkraemer67 commented Dec 1, 2017

Any input on what needs to be done here? We'd love to integrate flex for validation of requests, but this is kind of a showstopper as it would need adapting all existing swagger schemas and keeping the workaround of defining everything via $ref in mind. Would be glad to assist.

@pipermerriam
Copy link
Copy Markdown
Owner

@mkraemer67 or @danopz tests are failing: https://travis-ci.org/pipermerriam/flex/jobs/305887945

Please get CI green and I can review this and get it merged.

for key, value in schema_validators.items():
validators.setdefault(key, value)
if key in validators:
validators[key] += value
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

I'm having trouble following the logic behind this change which implies this section could use a comment explaining what is happening and why. Is that something you can add?

@danopz
Copy link
Copy Markdown
Contributor Author

danopz commented Dec 6, 2017

Added a comment trying to explain the merge of validators.
About the failing test this is the one I mentioned in the first comment. I don't really know if this test case is valid as is.

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.

Required parameter in body not validated without $ref

3 participants