Support @Valid on container elements for handler arguments
Prior to this commit, #31870 added support for constraint annotations on container elements for handler method argument validation. Supporting this use case: ``` public void addNames(List<@NotEmpty String> names) ``` This commit does the same for `@Valid` annotation: ``` public void addPeople(List<@Valid Person> people) ``` Fixes gh-32964
This commit is contained in:
@@ -417,7 +417,7 @@ public class HandlerMethod extends AnnotatedMethod {
|
||||
return true;
|
||||
}
|
||||
merged = MergedAnnotations.from(getContainerElementAnnotations(param));
|
||||
if (merged.stream().anyMatch(CONSTRAINT_PREDICATE)) {
|
||||
if (merged.stream().anyMatch(CONSTRAINT_PREDICATE.or(VALID_PREDICATE))) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user