-
Notifications
You must be signed in to change notification settings - Fork 23
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
Validate responses as well as requests #29
Comments
Hmm, I don't know how much I like this idea solely that I believe it would be the responsibility of the person building the service to ensure their responses follow their own schema but probably don't want to have their service suddenly 500 or otherwise fail if they screwed up their schema or their response in a given scenario. I'd rather err towards flexibility on that end. That said, maybe adding an option in which a consumer can turn on this sort of validation against responses so a user can enable it understanding the risks might make sense. I'll see what I can come up with (or you're welcome to contribute if you like!) |
One of the possible use-cases is testing purpose (ensuring that documentation is correct). PS: flask-restplus validates both requests and responses when |
Fair point, I'll put it on my list and try to get to adding this functionality in the next couple weeks. If anyone wants, feel free to file a PR adding it yourself :) |
It would be nice for
quart-openapi
to validate responses against the response schema as well as requests against the request schema. Right now, response validators can be added for documentation purposes only. Ideally, the server would 500 upon validation error.The text was updated successfully, but these errors were encountered: