express-openapi-validator
express-openapi-validator copied to clipboard
Response validation not working as expected
trafficstars
Describe the bug When I allow only 200 response code with application/json content, any response code is allowed if I set the response body as a string in my code.
To Reproduce

Actual behavior Response passes the validation.
Expected behavior I would expected the response validation to fail the response.
Examples and context If I use res.status(209).json({}) instead of res.status(209).send(), validation works as expected
Hey @guy-microsoft , Did you ever figure this out?
No, but I only use .json (or .send with a json payload), so it mitigates that.