schemathesis: validation of response schema not working for recursive schemas
In response_schema_conformance
(in checks.py) schemathesis is validating the response schema after it has tried to resolve it.
If the response schema is recursive this doesnt work. It would be better to directly pass the response schema to jsonschema.validate()
instead of the resolved one.
if i replace
schema = case.endpoint.schema._get_response_schema(definition)
with
schema = responses[str(response.status_code)]['content'][content_type]
(will fail if response has no content type)
the validation works fine.
since jsonschema.validate()
can handle recursive schemas, this might also be a better fix for https://github.com/kiwicom/schemathesis/issues/435, validate the raw schema and then resolve it as much as needed to safe time wasted in unnecessary recursions.
PS: just wanted to say thank you for schemathesis and not just keep opening new issues. I t has really helped us 😉
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 15 (15 by maintainers)
Yep, I will work on this - it requires some extra copying & handing here