kotlinx.serialization
kotlinx.serialization copied to clipboard
Kotlin multiplatform / multi-format serialization
**Describe the bug** When we create a hand-written serializer, it can be linked with some type by `@Serializable` annotation. The hand-written serializer could be placed to another package which is...
kotlinx.serialization.json.internal.JsonDecodingException: Unexpected JSON token at offset 201: EOF
**Describe the bug** "It died while decoding using the && symbol." **To Reproduce** Attach a code snippet or test data if possible. **Environment** - Kotlin version: [e.g. 1.8.22] - Library...
hey, sorry to bother you guyes, I have a problem about using abstract base class to serialize I have such sealed classes ```kotlin @Serializable sealed class Frequency { @Serializable class...
Any generic class instance, even one with a primitive type parameter, causes a memory leak when it is serialized. Edit: the same thing occurs both with Json and ProtoBuf formats,...
**Describe the bug** I have such a data class, and I want to serialize the `time` field (type is `kotlinx.datetime.LocalDateTime`) with a contextual serializer. ```kotlin @Serializable data class Data( val...
**Describe the bug** Custom serializer for third party enum does not propagate across packages **To Reproduce** I have package A, with a third-party enum that is not serializable, and I...
I have a closed polymorphic structure like this: ``` @Serializable sealed class Foo { @Serializable data class Bar( val value: T?, ): Foo() } @Serializable data class Whatever(val foo: Foo)...
**Describe the bug** I'm trying to use [example poly 16](https://github.com/Kotlin/kotlinx.serialization/blob/master/guide/example/example-poly-16.kt) with `Response`. However the library doesn't seem to be able to encode `List`, `String`, etc. in a polymorphic context. **To...
**What is your use-case and why do you need this feature?** In a JSON file I have an array of records like this: ```json { "id": "0000000000000001", "pathInJson": "a_value_for_fieldName", "nestedObject":...
**What is your use-case and why do you need this feature?** We are using custom serializers extensively. It is significantly more difficult to locate an incorrect value in case a...