Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Response validation not working on status codes 400 and up #469

Closed
rosengrenen opened this issue Nov 25, 2020 · 5 comments
Closed

Response validation not working on status codes 400 and up #469

rosengrenen opened this issue Nov 25, 2020 · 5 comments

Comments

@rosengrenen
Copy link

Hi, response validation does not seem to work on status codes 400+, and I tracked it down to src/framework/modded.express.mung.ts:35. I am wondering why this is the case, since it's not mentioned in the docs (I think) and had me confused for a bit. Is this a design choice or am I missing something here?

@cdimascio
Copy link
Owner

@rosengrenen could you provide your use case as well as the result you expect and the actual result.

@rosengrenen
Copy link
Author

The use case would be attaching a json object with extra information about the error, along with the status code. For status codes 2xx (and 3xx) if the response does not match the schema an error is shown instead, but when doing the same with status codes 400+ the response is not checked, thus being able to send anything.

@vpalko
Copy link

vpalko commented Dec 11, 2020

@cdimascio
Copy link
Owner

I’ll take a look and get this fixed. If u don’t mind, it will be great if someone can provide a canonical example spec and basic server that causes the error

@cdimascio
Copy link
Owner

Fixed in v4.10.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants