Closed felixrojauro closed 7 years ago
this is an interesting case, SchemaErrors are treated differently from validation errors right now since it is presumed the schema should always validate as it would typically be constant
I'd be glad to hear more about the use case for this and potentially make a change depending on how it'd affect other users. I'm a bit concerned about breaking compatibility though.
I've decided not to support this in light of #114
Hello, basically my use case is as follows: I want to vaildate that input json contains all required keys (values don't matter) and contains no unexpected keys. If given input contains unexpected key Schema error is thrown and exits immidiately. The reason for that lays here:
raise SchemaError('Unknown properties for field "{fieldname}": {unknowns}'.format( fieldname=fieldname, unknowns=unknowns))
https://github.com/jamesturk/validictory/blob/master/validictory/validator.py#L199this should check for fail_fast flag and either append error to list or rise error. like this maybe?
This makes it way easier to parse error output and return some useful data for the user