kotlinx.serialization
kotlinx.serialization copied to clipboard
Kotlin multiplatform / multi-format serialization
**Describe the bug** `@Serializable` serializers are successfully decoding JSON that is missing commas between its properties **To Reproduce** These tests will pass with multiple properties and multiple combinations of missing...
**What is your use-case and why do you need this feature?** I want to serialize a type which contains star-projected properties: `Survey` below. `InputElement` is registered as polymorphic in `SerializersModule`...
**What is your use-case and why do you need this feature?** I am writing a serializer for a custom dictionary-like format that may require multiple polymorphic types to read from...
The following fails to compile: ```kotlin import kotlinx.serialization.Serializable class NotSerializable @Serializable abstract class AA @Serializable class A : AA() ``` with > e: java.lang.IllegalStateException: Backend Internal error: Exception during code...
**Describe the bug** `serializer` function expects generic type serializer but not use it inside **To Reproduce** ``` @Serializable abstract class TypedAbstractClass ``` and when trying to get the serializer its...
Hi there, similarly to [JsonClassDiscriminator](https://kotlinlang.org/api/kotlinx.serialization/kotlinx-serialization-json/kotlinx.serialization.json/-json-class-discriminator/), I would like an annotation type to indicate the discriminator mode for data classes: ```kotlin @Serializable @JsonClassDiscriminatorMode(ClassDiscriminatorMode.ALL_JSON_OBJECTS) abstract class Base ``` The motivation is that...
## 0\. Setup We created the following class hierarchy for testing serialization library: ```kotlin Value (org.plan.research) ArrayValue (org.plan.research) BooleanArrayValue (org.plan.research) BooleanValue (org.plan.research) ByteArrayValue (org.plan.research) ByteValue (org.plan.research) CharArrayValue (org.plan.research) CharValue (org.plan.research)...
## 0\. Setup We created the following class hierarchy for testing serialization library: ```kotlin Value (org.plan.research) ArrayValue (org.plan.research) BooleanArrayValue (org.plan.research) BooleanValue (org.plan.research) ByteArrayValue (org.plan.research) ByteValue (org.plan.research) CharArrayValue (org.plan.research) CharValue (org.plan.research)...
**What is your use-case and why do you need this feature?** I have existing design. I have class that I am serializing, which contains "BlockType" property. Currently there's only one...
Is there are any way for deserialize classes like below? Tested in kotlin native ``` @Serializable sealed class Foo { abstract val value: T @Serializable data class BarInt(override val value:...