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
Exposing constraint metadata so it is consumable also from non-Java clients has been one goal of Bean Validation from day one. We actually provide an API for obtaining all the constraints from given model classes: http://beanvalidation.org/1.1/spec/#constraintmetadata.
I would suggest to use that API instead of doing your own annotation scanning. It would then not matter how constraints are declared (annotations vs. XML vs. HV's programmatic API), whether constraints are given on fields vs. getters, it resolves default validation messages, it deals with constraint composition etc.
I.e. we already do all the hard work for you :)
The text was updated successfully, but these errors were encountered:
Thanks for pushing Gunnar, you mentioned that in the email 😉 So, I've known for about nine months that there's room for improvement here. It's good that there's now a publicly visible issue for that.
Hi Marcel, uh oh, it had completely escaped my mind that we've been in touch before 😃 Using the meta-data API would be great; I noticed because it would return the default message key ("{javax.validation.constraints.NotNull.message}") instead of the value from the default message bundle.
Hi, I just came across this library; nice stuff!
Exposing constraint metadata so it is consumable also from non-Java clients has been one goal of Bean Validation from day one. We actually provide an API for obtaining all the constraints from given model classes: http://beanvalidation.org/1.1/spec/#constraintmetadata.
I would suggest to use that API instead of doing your own annotation scanning. It would then not matter how constraints are declared (annotations vs. XML vs. HV's programmatic API), whether constraints are given on fields vs. getters, it resolves default validation messages, it deals with constraint composition etc.
I.e. we already do all the hard work for you :)
The text was updated successfully, but these errors were encountered: