-
Notifications
You must be signed in to change notification settings - Fork 76
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 validation for Body without $ref #185
base: master
Are you sure you want to change the base?
Conversation
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. |
@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. |
flex/validation/parameter.py
Outdated
@@ -125,7 +125,10 @@ def construct_parameter_validators(parameter, context): | |||
if 'schema' in parameter: | |||
schema_validators = construct_schema_validators(parameter['schema'], context=context) | |||
for key, value in schema_validators.items(): | |||
validators.setdefault(key, value) | |||
if key in validators: | |||
validators[key] += value |
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.
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?
Added a comment trying to explain the merge of validators. |
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