Method validation is not triggered when constraints are applied to the elements of a List #31870
Labels
in: web
Issues in web modules (web, webmvc, webflux, websocket)
type: enhancement
A general enhancement
Milestone
In Spring Boot 3.2.0 it seems method validation is not always happening as expected, if the constraint is on list elements only. It can be worked around by applying
@Validor a@Constraintto the list, or by having another argument for the endpoint which has a@Constraint, but otherwise it seems to miss them.I have attached a small demo project to illustrate it. I would expect all of the test cases to be a success, but the one with only a
@Constraintapplied to the list elements fails.I haven't tested if the parameter is for example a map (if it is even possible in this context), but my guess is it has the same issue.
Spring Boot version: 3.2.0
Java version: OpenJDK 19 (19+36-2238)
demo.zip
The text was updated successfully, but these errors were encountered: