-
Notifications
You must be signed in to change notification settings - Fork 653
Open
Labels
Description
Currently the @SerialName
annotation allows blank names, but the serial descriptor constructors/builders do not
I noticed this when migrating an existing @Serializable @SerialName("") class
from the auto-generated serializer to a custom one.
These throw:
SerialDescriptor
PrimitiveSerialDescriptor
buildSerialDescriptor
buildClassSerialDescriptor
But this does not:
@Serializable
@SerialName("")
data class MyClass(val a: String)
// {"":{a:"MyClass"}}
println(StringifiedNbt.encodeToString(MyClass("MyClass")))
I can see why maybe it should be disallowed all around, since e.g. class serial names are useful in error messages, but I thought I should post the issue to poke at what really should be allowed.