-
Notifications
You must be signed in to change notification settings - Fork 38.6k
Description
Spring Boot BOM: 4.0.0-M1
Component: spring-web
Version: 7.0.0-M7 (This worked on 6.2.9, but failed for any Types that contained polymorphism types inside)
It seems that at the moment, the AbstractKotlinSerializationHttpMessageConverter fails to work when I use a ResponseEntity to return a response.
I have taken a picture of the debugger in the scenario, showing that the serializer is null, even though the typeSerializersCache has an Serializer registered under GameSummary.
This seems to happen because the hint given to the serializer method is a ResponseEntity, which has no kotlinx serializer impl, thus causing an error. May also happen with other wrapping types.

Also, as some strange reason, even though it is a KClass, the cache being used is the typeSerializerCache instead of the kTypeSerializerCache. I don't know the details, but this may be a problem too?
The types I declared(simplified):
@Serializable
data class GameSummary(
val state: GameState
)
enum class GameState {
LEFT_WON,
RIGHT_WON,
TIE,
ONGOING
}