-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Closed
Closed
Copy link
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)type: regressionA bug that is also a regressionA bug that is also a regression
Milestone
Description
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)
.
@RestController
class WebController {
@GetMapping(path = ["/test"])
fun test(container: RequestParameterContainer) = ResponseEntity.ofNullable(container)
}
data class RequestParameterContainer(val duration: Duration = Duration.parse("PT1H"))
When making the class mutable, for instance something like this, it works:
class RequestParameterContainerMutable {
var duration: Duration = Duration.parse("PT1H")
}
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.
Metadata
Metadata
Assignees
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)type: regressionA bug that is also a regressionA bug that is also a regression