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
Getting all errors for a result #3
Comments
Not right now. The main issue is, that I am unsure what the most useful representation would be. One Possibility would be the current internal representation which is
Another would be a
Yet another idea is to have |
Let folks have access to error map as it is, it is easy to transform to json actually.
|
This to me is the single biggest blocker to making this useable in a nice way. I use various methods of validation, and I encapsulate them in my own interfaces. I think validation is a core part of your logic and should not be embedded in your peripheral http/server frameworks. For the same reason, I would never expose the data classes or exceptions of an internally used framework in my own API. I will always translate them to my own data types. Right now, if I wanted to translate the error messages raised by this framework into my own errors, I would have to do some nasty iteration involving reflection on my own classes and their fields. Please expose the collection of all errors ( |
Seems I am not alone, ;) |
Version 0.2.0 now exposes the errors in the ValidationResult. The readme has been updated as well. |
Currently a
ValidationResult<T>
can be used to get errors for a specific field:result[UserProfile::fullName]
Is there any way to get a map of all errors for a given validation (not a separate list for every field)?
The text was updated successfully, but these errors were encountered: