kotlinx.serialization
kotlinx.serialization copied to clipboard
Kotlin multiplatform / multi-format serialization
If I receive Cbor data without knowing the format, is there a way to decipher it? With json, I can just load it as a `JsonObject` and examine it through...
**What is your use-case and why do you need this feature?** It would be nice to have JSON5 support to serialize/deserialize configs and other data files that may be written/read...
Consider this code: ``` val responseModule = SerializersModule { polymorphic(Response::class) { subclass(OkResponse::class) } } @Serializable abstract class Response @Serializable class OkResponse(val data: T) : Response() ``` Running it produces: ```...
**Describe the bug** This code: ``` data class Req(val id: Int) val req = Req(id = 5000) Json.encodeToString(req) ``` on the physical device iOS and on the emulator android works...
Resolves #614 Resolves #932
**Describe the bug** java.lang.IllegalArgumentException: Serializer for ChangeAlarmTypeRequest of kind ENUM cannot be serialized polymorphically with class discriminator All subclasses of MethodExecuteCode have this problem **To Reproduce** ``` polymorphic(MethodExecuteCode::class) { subclass(MethodExecuteStateTypeCode::class)...
**What is your use-case and why do you need this feature?** Use-cases for `U[X]Array`, are similar as for `[X]Array`. **Describe the solution you'd like** Add serializers for `UByteArray`, `UShortArray`, `UIntArray`...
Fixes #1745 Fixes #1480 Resolves #1989
**Describe the bug** Using `Nothing` in a generic type argument fails with an internal error `Serializer for element of type Nothing has not been found`. **To Reproduce** This reproduces the...
# WHY The JSON format allows for duplicate keys in objects: ```json {'a': 2, 'a': 4} ``` but the spec says it "SHOULD" not be done. Different parsers implement it...