First Alpha of Bean Validation 2.0 Reference Implementation Available

by Gunnar Morling on 16 Feb 2017 release

A few days after the release of the Bean Validation 2.0 Early Draft 1 there is now also a first version of the reference implementation available.

If you are using Apache Maven, add the following dependency to your pom.xml to give it a test ride:

<dependency>
    <groupId>org.hibernate.validator</groupId>
    <artifactId>hibernate-validator</artifactId>
    <version>6.0.0.Alpha1</version>
</dependency>

The 6.0.0.Alpha1 release provides all the functionality of the Early Draft 1. In addition there is support for

  • nested type argument constraints, e.g. Map<String, Size(min=1) List<@NotNull Item>> itemsByCategory; this addresses open question #1 from the proposal for the validation of container elements

  • definition of constraints using Lambda expressions and method references

  • validation of java.time.Duration via two new constraints, @DurationMin and @DurationMax

If you think those things should be added to the spec, please let us know. Your feedback on these features as well as all the other Early Draft 1 additions will be much appreciated!

Check out the original Hibernate Validator release announcement for all the details.