NotReadablePropertyException
on validated list in request body when there are validation errors
#31835
Labels
in: web
Issues in web modules (web, webmvc, webflux, websocket)
status: superseded
An issue that has been superseded by another
Affects: 6.1.1 (Spring Boot 3.2.0)
Not sure if this is an issue or expected behavior and I missed something in the upgrade guide. Spring Boot 3.1.6 and earlier produce expected binding result errors.
The sample code attached will produce the exception below when a constraint violation (blank dog name) is in the request
Sample request body with constraint violation:
With Spring Boot 3.1.6 and earlier, the expected binding results below are produced:
I have tried changing the data binder to allow direct field access, but that did not resolve the issue. Stepping through the code it seems the
list
property of theDogs
class is not an available property to theAbstractNestablePropertyAccessor
class as it is in Spring Boot 3.1.6 and earlier.Update:
I've found that if I replace the
@Valid
annotation on the request body in the controller method with@Validated
the binding errors match the behavior seen in Spring Boot 3.1.6.Change
to
validation-demo.zip
The text was updated successfully, but these errors were encountered: