

Serialization support should work out of the box, if you have 1.3.x Kotlin plugin installed and have imported the project from Maven or Gradle with serialization enabled in their build scripts. Maven plugin coordinates before Kotlin 1.3.20 were kotlinx-maven-serialization-plugin. Library versions 0.11.0 and higher require Kotlin 1.3.30 and higher and incompatible with previous versions.Īll versions of library before 0.10.0 are using Gradle metadata v0.3 and therefore require Gradle 4.7 for build. Library version 0.14.0 require Kotlin 1.3.60/61 and incompatible with other versions.Īll versions of library before 0.13.0 are using Gradle metadata v0.4 and therefore it is recommended to use Gradle 4.8-5.1 to build. Library versions 0.20.0 and higher require Kotlin 1.3.70 and higher and incompatible with previous versions. You can also use JCenter or Bintray repository.Īdd serialization plugin to Kotlin compiler plugin: Īdd dependency on serialization runtime library: Val jsonList = json.stringify(rializer().list, listOf(Data(42))) Val jsonData = json.stringify(rializer(), Data(42)) Val json = Json(JsonConfiguration.Stable) but is subject to change in future versions

Default configuration which provides more reasonable settings, Import class Data(val a: Int, val b: String = "42")


Multiplatform polymorphic serialization.More examples of supported Kotlin classes.Incompatible changes from older versions.Complete multiplatform support: JVM, JS and Native.Provides JSON, CBOR, and Protobuf formats.Supports Kotlin classes marked as and standard collections.Runtime library with core serialization API and JSON format, and support libraries with ProtoBuf, CBOR and properties formats. Kotlin serialization consists of a compiler plugin, that generates visitor code for serializable classes, Kotlin multiplatform / multi-format reflectionless serialization
