Is there a generic constraint library for jsr 303 (Bean Validation)?
JSR 303 Bean Validation explicitly contains some constraints, but also allows you to define custom constraints.
I have a feeling that there are many limitations for many projects that do not ship with JSR implementations.
- Date range
- Password complexity check
- Equal cross margin check (stack overflow Highest vote "bean - validation question )
- ...
So my question is: Is there a (trustworthy) library that contains generic jsr 303 (Bean Validation) constraints?
source to share
I do not know the special library restrictions, but the reference implementation of JSR 303 Hibernate Validator provides several additional restrictions , such as @Email
, @ScriptAssert
, @URL
, etc. (disclaimer: I am contributing to the Hibernate Validator).
If you have additional ideas or requirements for other constraints, feel free to create a feature request in our JIRA instance .
source to share
I came to the same result that there is no such library. So I decided to share my small set of common constraints and its validators: https://github.com/malkusch/validation
source to share