Kotlin serialization generated code to serialize objects without reflection only by marking a class with @Serializable annotation.
Kotlin serialization consists of a compiler plugin, which automatically produces visitor code for classes, and runtime library, which uses generated code to serialize objects without reflection.
- Supports Kotlin classes marked as
@Serializable
and standard collections. - Supports JSON, CBOR, and Protobuf formats out-of-the-box.
- The same code works on Kotlin/JVM, Kotlin/JS, and Kotlin/Native