kotlinxserialization
Kotlinx.serialization is a multiplatform serialization library for Kotlin, developed by JetBrains. It provides a uniform API for converting Kotlin data objects to and from formats such as JSON, CBOR, and Protobuf, with serializers generated at compile time rather than via reflection. It targets Kotlin/JVM, Kotlin/JS, and Kotlin/Native.
The library centers on the @Serializable annotation and a Kotlin compiler plugin that generates type-specific serializers.
Key modules include kotlinx-serialization-core and the format-specific modules such as kotlinx-serialization-json, kotlinx-serialization-protobuf, and kotlinx-serialization-cbor. In Gradle,
Usage typically involves annotating data classes with @Serializable and using a Json instance to encode and
Kotlinx.serialization is designed for Kotlin Multiplatform projects and emphasizes performance by avoiding reflection. It integrates with