Constructor binding fails for Duration
argument if request parameter is not present
#31709
Labels
in: web
Issues in web modules (web, webmvc, webflux, websocket)
type: regression
A bug that is also a regression
Milestone
Affects:
Spring Web 6.1.1
Spring Boot 3.2.0
When having a Kotlin class as a container for request parameters with a default arg, this used to work without any problems up to Spring Boot 3.1.6. After switch to 3.2.0 the controller now throws an IllegalStateException
Cannot resolve parameter names for constructor private java.time.Duration(long,int)
.When making the class mutable, for instance something like this, it works:
I created a small reproducible for you. When setting a value for the parameter, it works. When omitting and the default should be triggered, instead the exception is thrown.
kotlin-default-bug.zip
The text was updated successfully, but these errors were encountered: