I have got a question on Kotlin serialization. I ...
# announcements
j
I have got a question on Kotlin serialization. I want to use sealed classes to deserialize. Is there a way to change the type key from "type" to something else on the sealed class.
p
#C7A1U5PTM But yes, you can change the type discriminator - but only at the "global" level for an entire serializer instance, e.g:
Copy code
Json {
    classDiscriminator = "\$type"
}
j
I figured it out, had to use JsonTransformingSerializer to manually tweak the json