Parse multiple json errors

Hello, I'm creating a web api with axum. I use a defined schema to validate the json input but when a parsing error occurs, I don't really have a good error to return to user. I would like to return errors like in RFC 7807.

I've tried using serde_path_to_error but it just returns the first error because of the principle of stopping searching when the first errors appears. I would like to return a list of errors not just the first one.

Is there any option to do that??

Have you looked at eserde? There's also an integration for Axum that replaces the built-in JSON extractor.

Hello and sorry for the late response. I forgot that this was opened. I've seen it and it works very well. Thank you!

1 Like

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.