kotlinx.serialization
kotlinx.serialization copied to clipboard
Kotlin multiplatform / multi-format serialization
Related to https://github.com/Kotlin/kotlinx.serialization/issues/2848
```kotlin import kotlinx.serialization.json.* import kotlinx.serialization.* import kotlin.reflect.* fun main() { println(Json.encodeToString(serializer(typeOf()), "string")) } ``` compiles just fine, but throws ``` Exception in thread "main" java.lang.ClassCastException: class java.lang.String cannot be cast...
Introducing new annotation `@ProtoUnknownFields` and built-in type `ProtoMessage`, to store any fields with proto ids that are undefined in current message class. In my understanding, both ktx-serialization and protocol buffer...
**Describe the bug** Trying to serialize a third party class through use of the experimental serialization API @Serializer(forClass = Class::class). The trouble I am having is, most of the times...
Consider the following class: ``` data class Node(val data: Int, val nodes: List) ``` For that, `kotlinx.serialization` is able to generate a proper serializer (using the coupling between auto-generated serializer...
I have a third party class that is generated as the following ``` kt data class Example ( property: String ) data class AnotherExample ( property: Example ) ``` I...
**What is your use-case and why do you need this feature?** I am investigating using Protobuf to serialize polymorphic types. Using an example similar to the one in the guide,...
**Describe the bug** Cbor encoder/decoder treats Unit as an empty array. That means you get an empty array output every time a unit appears in the serialization chain. It is...
**What is your use-case and why do you need this feature?** I've been experimenting with MongoDB through [KMongo](https://litote.org/kmongo) and [KtMongo](https://opensavvy.gitlab.io/ktmongo), specifically around polymorphic documents. Both [kbson](https://github.com/jershell/kbson) (used by KMongo) and...
**What is your use-case and why do you need this feature?** decodeSequentially is the only function of CompositeDecoder that does not have the SerialDescriptor as parameter. I need to dynamically...