kotlinx.serialization
kotlinx.serialization copied to clipboard
Kotlin multiplatform / multi-format serialization
**Describe the bug** When using the workaround to force generation of a plugin generated serializer for enums, the generated serializer always treats it as a class **To Reproduce** ```kotlin import...
See the https://github.com/Kotlin/kotlinx.serialization/issues/1533 for context
**What is your use-case and why do you need this feature?** For most properties, the behavior of `encodeDefaults` or `@EncodeDefault` is determined by an `equals` check against the property's default...
**To Reproduce** ``` @Serializable data class FalsePositive( val key1: Map, val key2: Map, ) class TestFalsePositive { @Test fun testFalsePositive() { Json.decodeFromString( """ { "key1": { } "key2": { }...
**Description** Certain patterns in a `Serializable` class will cause code to be compiled incorrectly for JS. While the class will appear to function normally when used from code, instances produced...
Serializers for sealed classes use fully qualified names as discriminators by default. This can introduce instability, as these names are susceptible to changes through refactorings, potentially affecting the serialized form....
**Describe the bug** Can't generate [external serializer](https://github.com/Kotlin/kotlinx.serialization/blob/master/docs/serializers.md#deriving-external-serializer-for-another-kotlin-class-experimental) for a 3rd party Kotlin class in Android project. 3rd party class is like by definition class from "another module" why I can't...
**Describe the bug** Given an interface Image its value subclass IconImage, WebImage and a data class MaskModel: ```kotlin @Serializable sealed interface Image @JvmInline @Serializable value class IconImage internal constructor(val value:...
**Describe the bug** I can't serialize my Json into desired class with polymorphic annotation When I test it, I got this error : ```shell Polymorphic serializer was not found for...
**Describe the bug** When you have a `@Serializable` class with a `@Transient` lambda, the lambda captures the wrong parameters. The code compiles just fine, but crashes during runtime. **To Reproduce**...