schemathesis icon indicating copy to clipboard operation
schemathesis copied to clipboard

[FEATURE] Improve error messages that come from `jsonschema`

Open Stranger6667 opened this issue 5 years ago • 1 comments

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

Stranger6667 avatar Oct 31 '20 18:10 Stranger6667

TypeError related to the usage of numeric HTTP codes should be resolved by #1294

Stranger6667 avatar Oct 06 '21 13:10 Stranger6667