Enforce evaluation of composed constraints stops on first validation error in case of @ReportAsSingleViolation

Link to JIRA ticket


The BV spec currently says in a note:

If a composing constraint fails and if the composed constraint is marked as @ReportAsSingleViolation, the Bean Validation provider is free to not process the other composing constraints for this composed constraint.

However, this behavior is not enforced. The aim is to mandate this behavior and make it potentially configurable (BVAL-220)

Related issues

Let composed constraint return the message of the first failing constraint (BVAL-261), eg:



Option 1: Just enforce the behavior which is currently jsut added as a note

Option 2: Make the behavior configurable

For example:

public @interface MyConstraint {}