Skip to content

Commit

Permalink
Merge cc1bc10 into 4ef2294
Browse files Browse the repository at this point in the history
  • Loading branch information
sebjamesfd committed Sep 15, 2016
2 parents 4ef2294 + cc1bc10 commit a4c6ae3
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
32 changes: 31 additions & 1 deletion validictory/tests/test_disallow_unknown_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ def setUp(self):
"desc": "another description",
"price": 999.00
}
]
],
"data": {
"name": "john doe",
"age": 42
}
}
self.schema_complex = {
"type": "object",
Expand All @@ -44,6 +48,32 @@ def setUp(self):
"price": {"type": "number"}
}
},
},
"data": {
"type": (
{
"type": "object",
"properties": {
"name": {
"type": "string"
},
"hair": {
"type": "string"
}
}
},
{
"type": "object",
"properties": {
"name": {
"type": "string"
},
"age": {
"type": "number"
}
}
}
)
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion validictory/validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ def validate_type(self, x, fieldname, schema, path, fieldtype=None):

datavalid = True
break
except ValidationError as err:
except (SchemaError, ValidationError) as err:
errorlist.append(err)
if not datavalid:
self._error("doesn't match any of {numsubtypes} subtypes in {fieldtype}; "
Expand Down

0 comments on commit a4c6ae3

Please sign in to comment.