Hey for `polymorphism` it currently uses the `type...
# serialization
f
Hey for
polymorphism
it currently uses the
type
attribute. Is there any way to change the name? In my case I need it to look at the
name
attribute (which is the same as
type
just different name)
d
you can specify custom
classDiscriminator
(defaults to
type
)
Copy code
val format = Json {
    classDiscriminator = "__typename"
}
f
ah so you can only do that globally on serializer level?
👌 3
d
no idea 🙂
haven't seen anything that would limit it to just specific polymorphic serializer
this info is currently missing from https://github.com/Kotlin/kotlinx.serialization/blob/master/docs/polymorphism.md (it doesn't mention
classDiscriminator
either)
f
Ah cool subscribed to that issue