You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there a way to access the validation results in the downstream middlewares and/or handlers in the request pipeline before returning a response? I am happy with the built-in validation but I want to access and process the successfully validated fields and return http.StatusOK if there are any. (If this approach is not really compliant with the HTTP semantics, please let me know.)
What I am ultimately trying is to validate an input json object with possibly many fields and process all of the valid ones and let the user know which ones are successfully processed and which ones are not.
Thank you very much 🙏
The text was updated successfully, but these errors were encountered:
@guneyizol this isn't really possible using the built-in request validation pipeline, however I think you could use the SkipValidate* settings in huma.Operation to bypass the built-in validation and then do the validation yourself in the handler. A quick & easy way to try it out would be to use the huma.ModelValidator and if that works to your satisfaction you can look inside its implementation to see how you can make your handler more efficient (e.g. pre-allocating schemas, path buffers, result objects, using sync.Pool, etc if needed).
Hi,
Is there a way to access the validation results in the downstream middlewares and/or handlers in the request pipeline before returning a response? I am happy with the built-in validation but I want to access and process the successfully validated fields and return
http.StatusOK
if there are any. (If this approach is not really compliant with the HTTP semantics, please let me know.)What I am ultimately trying is to validate an input json object with possibly many fields and process all of the valid ones and let the user know which ones are successfully processed and which ones are not.
Thank you very much 🙏
The text was updated successfully, but these errors were encountered: