Keats / validator

Simple validation for Rust structs
MIT License
1.91k stars 140 forks source link

Question: Return multiple errors from a single custom validator #326

Open tuhlmann opened 3 months ago

tuhlmann commented 3 months ago

I wanted to ask- is there a way to create a custom validator that would return a Vec<ValidationError> or ValidationErrors?

My use case is, I have a json structure as part of another struct. In a custom validator, I want to deserialize and validate it. This validation could potentially yield multiple errors that I'd like to return.

Thanks for this very useful library!