I'm trying to validate some data against a jsonschema that has additionalProperties set to False.
What I want to do is find all the properties that fail the additionalProperties validation so I can handle them.
I first started with building a ErrorTree.
validation = Draft4Validator(schema)
tree = ErrorTree(validation.iter_errors(data))
I found that when I have a validation error though, I can't get the unexpected property despite it being mentioned in the message:
print tree.message
Additional properties are not allowed ('test' was unexpected)
I went through the functions I could find in the documentation and source, but nothing I found seemed to deal with assembling the message.
Is there a way to get the unexpected property without parsing the message?