When making a nested collection subject to cascaded validation:
{code} List<List<Foo>> listOfListsOfFoos; {code}
Is the following sufficient to validate all {{Foo}} s objects :
{code} List<@Valid List<Foo>> listOfListsOfFoos; {code}
The argument being, that the {{@Valid}} usage represents the legacy syntax applied to the inner {{List}}. Or should it rather be:
{code} List<@Valid List<@Valid Foo>> listOfListsOfFoos; {code}
I.e. when used on type arguments, {{@Valid}} only carries the new semantics. That seems the safer approach.
A related question is whether all the {{@Valid}} are needed or whether the inner one suffices:
{code} List<List<@Valid Foo>> listOfListsOfFoos; {code} |
|