You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What is your use-case and why do you need this feature?
Output the enum and primitive correctly.
If we add a PrimitiveKind descriptor to a subclass of polymorphic serializer. There is error #1486
If we add a wrapper for the primitive(#1252 (comment)). The result will be wrapped even if the classDiscriminatorMode = ClassDiscriminatorMode.NONE like below.
The same error with #1486.
This is a FR for allowing enum and primitive in polymorphic if needn't the type information.
I'll append the example to body
What is your use-case and why do you need this feature?
Output the enum and primitive correctly.
If we add a PrimitiveKind descriptor to a subclass of polymorphic serializer. There is error #1486
If we add a wrapper for the primitive(#1252 (comment)). The result will be wrapped even if the
classDiscriminatorMode = ClassDiscriminatorMode.NONE
like below.Related: #1252 #1486
Describe the solution you'd like
https://github.com/Kotlin/kotlinx.serialization/blob/master/formats/json/commonMain/src/kotlinx/serialization/json/internal/Polymorphic.kt#L41
Avoid failing if needn't discriminator for
checkKind
. Add a condition incheckKind
orencodePolymorphically
The text was updated successfully, but these errors were encountered: