Closed as not planned
Closed as not planned
Description
GH-39865 added support for MethodValidationResult
to DefaultErrorAttributes
but it filters the list errors published in the result and used for counting to instances of ObjectError
.
With a method signature (in a RestController) of e.g. public void method(@PathVariable @Pattern(regexp = "^a.*") String parameter)
, this results in
message = "Validation failed for method='public void <class>.method(java.lang.String)'. Error count: 0"
errors = []
This is due to the fact, that the MethodValidationResult
generated by MethodValidationAdapter
will contain instances of ParameterValidationResult
that have resolvable errors of type DefaultMessageSourceResolvable
(and not ObjectError
).
Spring Boot 3.3.1
Spring Framework 6.1.10