-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Open
Labels
Description
Description
Generator creates code like this:
protected inline fun <reified I : Any, reified T: Any?> request(requestConfig: RequestConfig<I>): ResponseEntity<T> {
return prepare(defaults(requestConfig))
.retrieve()
.toEntity(object : ParameterizedTypeReference<T>() {})
}This code das not compile anymore in Spring Web 7 (used by Spring Boot 3):
None of the following candidates is applicable:
fun <T : Any> toEntity(bodyType: Class<T>): ResponseEntity<T>
fun <T : Any> toEntity(bodyType: ParameterizedTypeReference<T>): ResponseEntity<T>`
Propsed solution
It should be enough to change the outer bounds from Any? to Any like this:
protected inline fun <reified I : Any, reified T: Any> request(requestConfig: RequestConfig<I>): ResponseEntity<T> {
return prepare(defaults(requestConfig))
.retrieve()
.toEntity(object : ParameterizedTypeReference<T>() {})
}openapi-generator version
7.17.0