In this case, let’s use @Size whbich would make the example valid. A list of at least 3 elements vs a nickname of at least 3 characters.
Right, it needs to be explored enough to qualify or be rejected.
I * think* that since groups are additive in nature and if we disallow people to use these special groups in sequences and other groups, they would not interfere at all.
I suppose this assumes that most if not all extractor would have @ConstraintsApplyTo(WRAPPED_VALUE) set so that a user has the option to do annotated element vs wrapped value on site. That would be a bad default for iterable and break BV 1.1 semantic in a backward incompatible way (without @ConstraintsApplyTo on site, my @Min annotation would not longer validate the container size but what’s inside.
Plus the example you give is just bad practice and illogical to quote Spok.
@Size(min=5) @ConstraintsApplyTo(ANNOTATED_ELEMENT) List<@Size(min=3) @ConstraintsApplyTo(ANNOTATED_ELEMENT) List<String>>
If you can plance constraints where you want, place then where they are the more natural and in this case the example is rewritten
@Size(min=5) List<@Size(min=3) List<@Size(min=3) String>>
The problema rises when you have class Matrix extends List<List<String>> {}
You have no place to put @Size(min=3) and @Size(min=24)
@Size(min=5)
@Size(min=3) //I want to be in the inner list
@Size(min=24) // I want to be in the most inner wrapped element
Matrix matrix;
TODO: I think I’m fine with not supporting such case and support #8 personally.
Your understanding is correct, to validate the properties of Address, you need the @Valid annotation.
What the question 7 is about though is a bit different, I think (I’m confused now too :) )
Assume the following container class
class Tuple<T1,T2> {
@NotNull
T1 getT1();
@Min(3)
getSize();
...
}
Does the following validate that Integer is not null, does it validate that tuple size is at least 3?
Tuple<@Min(1) Integer, @Email String> tuple;
Is that a fair understanding of the question Gunnar ?