Open DanielHabenicht opened 2 months ago
I'm bumping into the exact same issue and the raise ResponseHeadersValidationError
is confusing, for which scenario is it here?
Edit: turns out I was returning a jsonify
request to which I attached a cookie, and after checking the docs I don't think quart-schema can validate that. I wanted to both validate the response and set a cookie on the response.
I don't know if I understand it correctly but this code always returns a (misleading) error if the expected and real status codes of a response match, but allows requests where it does not match:
https://github.com/pgjones/quart-schema/blob/125e218d7a35a2eb9fc8216de2905f5479939dd3/src/quart_schema/validation.py#L225-L228
This however works as expected and validates the body even for the response types:
Monkeypatch: