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

Request Body not present in ctx in case plumatic schema validation failure, defined in resource. #302

Open
mayur-tavisca opened this issue Jun 24, 2019 · 2 comments

Comments

@mayur-tavisca
Copy link

mayur-tavisca commented Jun 24, 2019

If the user wants to log the request-body in case of plumatic schema validation failure, request-body is not available downstream after processing the request-body. Incoming request-body is a stream and it gets consumed and added into the ctx only if it is validated against the schema.

@danielcompton
Copy link
Contributor

Hi @mayur-tavisca, are you asking for the the processed request body to be added to the ctx, even if the schema validation fails? Would you want it to go where it normally goes, or somewhere else?

Does the information at

(d/error-deferred (ex-info "Bad form fields"
{:status 400 :error (error-val params)}))))
get you what you need, or is there something missing from there?

If the request-body has failed schema validation, it could be anything. Any change here would need to be quite careful how it exposes the information further down to avoid people accidentally processing untrusted and invalid input.

@mayur-tavisca
Copy link
Author

mayur-tavisca commented Jun 27, 2019 via email

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

2 participants