Closed
Description
I am using Kotlin, and I have a sealed class as follows:
@JsonDeserialize(using = FooDeserializer::class)
sealed class Foo
data class FooA(val s: String) : Foo()
data class FooB(val l: Long) : Foo()
Then FooDeserializer
handles determining whether to instantiate FooA
or FooB
. The Jackson ObjectMapper
handles this situation no problem. But, the message conversion functionality around Jackson2JsonMessageConverter
does not allow abstract classes, which is what Foo
gets compiled to.
Please allow abstract classes and interfaces in the Jackson message conversion functionality. Let it be the responsibility of the Jackson ObjectMapper
to handle this situation instead of preventing it.