[bv-dev] Value extraction open issue #2: per constraint ConstraintsApplyTo?
guillaume.smet at gmail.com
Fri Jan 13 05:50:15 EST 2017
This is the first of a series of threads about the open questions regarding
value extraction . We hope having a separate thread per question will
help having a more structured and easy to follow discussion.
Summary of the issue
ConstraintsApplyTo only allows one behavior per annotated element. Should
it be per constraint? E.g. for @NotNull @Email StringProperty email it may
be desirable to apply @NotNull to the wrapper but @Email to the wrapped
value. That’s not possible currently.
Summary of the discussions going on
Matt proposed something like:
As noted by Emmanuel, it does not solve the issue when you want 2 @Size
constraints, one for the List and the other for the enclosed String.
Emmanuel proposed to use groups to solve this issue:
But it makes me think that we sorta addresssed a similar class of problem
I haven’t explored at all but could we something similar by subverting
groups. Let’s define two special groups: OnContainer OnWrappedValue
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the beanvalidation-dev