Improve method validation for container elements

This change moves container element properties from ParameterErrors
to base class ParameterValidationResult, and makes that support
independent of whether violations are nested within a container
element bean or through constraints on container elements, e.g.
`List<@NotBlank String>`.

Closes gh-31887
This commit is contained in:
rstoyanchev
2024-01-05 16:32:14 +00:00
parent e0d6b69195
commit 8552e149b5
5 changed files with 172 additions and 114 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2023 the original author or authors.
* Copyright 2002-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -128,7 +128,7 @@ public class HandlerMethodValidationExceptionTests {
}
else {
MessageSourceResolvable error = new DefaultMessageSourceResolvable("Size");
return new ParameterValidationResult(param, "123", List.of(error));
return new ParameterValidationResult(param, "123", List.of(error), null, null, null);
}
})
.toList());