serialName
Serial name of the descriptor that identifies a pair of the associated serializer and target class.
For generated and default serializers, the serial name is equal to the corresponding class's fully qualified name or, if overridden, SerialName. Custom serializers should provide a unique serial name that identifies both the serializable class and the serializer itself, ignoring type arguments if they are present, for example: my.package.LongAsTrimmedString
.
Do not confuse with getElementName, which returns property name:
package my.app
@Serializable
class User(val name: String)
val userDescriptor = User.serializer().descriptor
userDescriptor.serialName // Returns "my.app.User"
userDescriptor.getElementName(0) // Returns "name"
Content copied to clipboard