SerialDescriptor.withName is deprecated. What shou...
# serialization
a
SerialDescriptor.withName is deprecated. What should I do not if I want to use a MapSerializer for another class. Should I leave the name as is?
d
I tend to let the plugin generate the descriptor. But what's wrong with
SerialDescriptor("name")
?
a
Copy code
override val descriptor: SerialDescriptor
            get() = mapSerializer.descriptor
I use MapSerializer for class with a single map in it.
I still do not completely understand what is the purpose of descriptor name, but If I understand correctlye, there should unique name for it. If I am using map descriptor, should I change the name, or leave it
d
The name is useful for things like polymorphism, to look up serializers by name.
I tend to change the name.
a
This point is really confusing for me, because we have two entities: one for element name and one for descriptor name. Also descriptor is not directly tied to serializer. Multiple serializers tend to have the same descriptor.
In my case I can't find a way to redifine the name since
Copy code
NamedMapClassDescriptor
is now internal