schemathesis
schemathesis copied to clipboard
[FEATURE] Improve error messages that come from `jsonschema`
It is unclear why the input schema is invalid from the jsonschema's error output:
jsonschema.exceptions.ValidationError: False is not of type 'array'
Failed validating 'type' in schema[0]['properties']['required']:
{'items': {'type': 'string'},
'minItems': 1,
'type': 'array',
'uniqueItems': True}
On instance['required']:
False
Similarly, the jsonschema error output is confusing when the schema has HTTP status codes as numbers (they should be strings).
Related issues:
- #610
- #513
- #1140
Update: The first step could be applying the right ordering to the best_match function from jsonschema. Other JSON Schema libraries are likely to have similar error structures for oneOf cases. See editor.swagger.io
TypeError related to the usage of numeric HTTP codes should be resolved by #1294