Skip to content

Commit

Permalink
add validators to existing validators to not omit any - fixes #138
Browse files Browse the repository at this point in the history
  • Loading branch information
danopz committed Nov 22, 2017
1 parent 01cb8f9 commit 75f05f6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
5 changes: 4 additions & 1 deletion flex/validation/parameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
else:
validators.setdefault(key, value)
return validators


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,19 +121,19 @@ def test_request_body_parameter_validation_invalid_without_ref():
schema = SchemaFactory(
paths={
'/post/': {
'post': {
POST: {
'consumes': ['application/json'],
'parameters': [
{
'in': 'body',
'name': 'body',
'in': BODY,
'name': BODY,
'required': True,
'schema': {
'type': 'object',
'type': OBJECT,
'required': ['name'],
'properties': {
'name': {
'type': 'string'
'type': STRING
}
}
}
Expand Down

0 comments on commit 75f05f6

Please sign in to comment.