I have a sealed class hierarchy, but the input JSO...
# serialization
r
I have a sealed class hierarchy, but the input JSON (externally defined) uses
_type
instead of
type
as the discriminator. Doing
@SerialName("_type") val type: String
doesn't seem to work. A JSON content-based polymorphic deserialization seems like overkill for this. Is there some annotations that will work short of that?
a
Does @JsonClassDiscriminator work for your case?
r
Yes, that's what I was looking for, thanks!
👍 1