Fix validation message when there are multiple ested oneOf validations.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
This commit is contained in:
Daniel Nephin 2016-02-19 14:22:55 -05:00
commit 02535f0cf1
2 changed files with 25 additions and 0 deletions

View file

@ -312,6 +312,10 @@ def _parse_oneof_validator(error):
types = []
for context in error.context:
if context.validator == 'oneOf':
_, error_msg = _parse_oneof_validator(context)
return path_string(context.path), error_msg
if context.validator == 'required':
return (None, context.message)