For polymorphic objects, Is there any way of suppr...
# serialization
m
For polymorphic objects, Is there any way of suppressing the type field output into json by
kotlinx.serialization
when all you're doing is serializing with no care for deserialization later, or allow specification of another field instead of type as the discriminator
e
You can change the name of the property using
classDiscriminator = "otherProperty"
. As far as I know you can't omit it completely. It's something I would like as well..
m
yeah we can get away with that until we have more than one polymorphic scenario in the model 😄
e
bit of a hack but this would work (for json only):