Adjust container types to which methodValidation

After the updates to MethodValidationAdapter in commit d7ce13 related
to method validation on element containers, we also need to adjust
the checks in HandlerMethod when method validation applies.

See gh-31746
This commit is contained in:
rstoyanchev
2023-12-21 17:50:40 +00:00
parent 33c149077a
commit f0add920f5
2 changed files with 16 additions and 6 deletions

View File

@@ -329,9 +329,12 @@ public class MethodValidationAdapter implements MethodValidator {
.addViolation(violation);
}
else {
// If the argument is a container of elements, we need the specific element,
// but the only option is to check for a parent container index/key in the
// next part of the property path.
// https://github.com/jakartaee/validation/issues/194
// If the argument is a container of elements, we need the element, but
// the only option is to see if the next part of the property path has
// a container index/key for its parent and use it.
Path.Node paramNode = node;
node = itr.next();