You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> Kotlin versions before 1.4.0 are not supported by the stable release of Kotlin serialization
112
+
> Kotlin versions before 1.4.0 are not supported by the stable release of Kotlin serialization.
110
113
111
-
#### Using `apply plugin` (the old way)
114
+
<details>
115
+
<summary>Using <code>apply plugin</code> (the old way)</summary>
112
116
113
117
First, you have to add the serialization plugin to your classpath as the other [compiler plugins](https://kotlinlang.org/docs/reference/compiler-plugins.html):
114
118
@@ -145,10 +149,11 @@ Then you can `apply plugin` (example in Groovy):
145
149
apply plugin: 'kotlin' // or 'kotlin-multiplatform' for multiplatform projects
146
150
apply plugin: 'kotlinx-serialization'
147
151
```
152
+
</details>
148
153
149
-
#### Dependency on the JSON library
154
+
#### 2) Dependency on the JSON library
150
155
151
-
After setting up the plugin one way or another, you have to add a dependency on the serialization library.
156
+
After setting up the plugin, you have to add a dependency on the serialization library.
152
157
Note that while the plugin has version the same as the compiler one, runtime library has different coordinates, repository and versioning.
Copy file name to clipboardExpand all lines: docs/serialization-guide.md
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -71,6 +71,7 @@ Once the project is set up, we can start serializing some classes.
71
71
* <aname='serializing-3rd-party-classes'></a>[Serializing 3rd party classes](serializers.md#serializing-3rd-party-classes)
72
72
* <aname='passing-a-serializer-manually'></a>[Passing a serializer manually](serializers.md#passing-a-serializer-manually)
73
73
* <aname='specifying-serializer-on-a-property'></a>[Specifying serializer on a property](serializers.md#specifying-serializer-on-a-property)
74
+
* <aname='specifying-serializer-for-a-particular-type'></a>[Specifying serializer for a particular type](serializers.md#specifying-serializer-for-a-particular-type)
74
75
* <aname='specifying-serializers-for-a-file'></a>[Specifying serializers for a file](serializers.md#specifying-serializers-for-a-file)
75
76
* <aname='specifying-serializer-globally-using-typealias'></a>[Specifying serializer globally using typealias](serializers.md#specifying-serializer-globally-using-typealias)
76
77
* <aname='custom-serializers-for-a-generic-type'></a>[Custom serializers for a generic type](serializers.md#custom-serializers-for-a-generic-type)
| Avro |[sksamuel/avro4k](https://github.com/sksamuel/avro4k) <br> `com.sksamuel.avro4k:avro4k`| JVM only | This library allows serialization and deserialization of objects to and from [Avro](https://avro.apache.org). It will read and write from Avro binary or json streams or generate Avro Generic Records directly. It will also generate Avro schemas from data classes. The library allows for easy extension and overrides for custom schema formats, compatiblity with schemas defined outside out of the JVM and for types not supported out of the box. |
22
22
| Bson |[jershell/kbson](https://github.com/jershell/kbson) <br> `com.github.jershell:kbson`| JVM only | Allows serialization and deserialization of objects to and from [BSON](https://docs.mongodb.com/manual/reference/bson-types/). |
23
+
| TOML |[Peanuuutz/tomlkt](https://github.com/Peanuuutz/tomlkt) <br> `net.peanuuutz.tomlkt:tomlkt`| all supported platforms | Multiplatform encoder and decoder for [TOML](http://toml.io/) 1.0.0 compliant. This library aims to provide similar API to the official JSON format (such as TomlLiteral, TomlTable), while adding TOML specific features (such as @TomlComment, @TomlMultilineString). |
23
24
| TOML |[akuleshov7/ktoml](https://github.com/akuleshov7/ktoml) <br> `com.akuleshov7:ktoml-core`| all supported platforms | Fully Native and Multiplatform Kotlin serialization library for serialization/deserialization of TOML format. This library contains no Java code and no Java dependencies and it implements multiplatform parser, decoder and encoder of TOML. |
24
-
| Minecraft NBT |[BenWoodworth/knbt](https://github.com/BenWoodworth/knbt) <br> `net.benwoodworth.knbt:knbt`| all supported platforms | Implements the [NBT format](https://minecraft.fandom.com/wiki/NBT_format) for kotlinx.serialization, and provides a type-safe DSL for constructing NBT tags. |
25
+
| Minecraft NBT |[BenWoodworth/knbt](https://github.com/BenWoodworth/knbt) <br> `net.benwoodworth.knbt:knbt`| all supported platforms | Implements the [NBT format](https://minecraft.wiki/w/NBT_format) for kotlinx.serialization, and provides a type-safe DSL for constructing NBT tags. |
25
26
| MsgPack |[esensar/kotlinx-serialization-msgpack](https://github.com/esensar/kotlinx-serialization-msgpack) <br> `com.ensarsarajcic.kotlinx:serialization-msgpack`| all supported platforms | Allows serialization and deserialization of objects to and from [MsgPack](https://msgpack.org/). |
26
27
| SharedPreferences |[EdwarDDay/serialization.kprefs](https://github.com/EdwarDDay/serialization.kprefs) <br> `net.edwardday.serialization:kprefs`| Android only | This library allows serialization and deserialization of objects into and from Android [SharedPreferences](https://developer.android.com/reference/android/content/SharedPreferences). |
27
28
| XML |[pdvrieze/xmlutil](https://github.com/pdvrieze/xmlutil) <br> `io.github.pdvrieze.xmlutil:serialization`| all supported platforms | This library allows for reading and writing of XML documents with the serialization library. It is multiplatform, providing both a shared parser/writer for xml as well as platform-specific parsers where available. The library is designed to handle existing xml formats that use features that would not be available in other formats such as JSON. |
@@ -32,4 +33,4 @@ For convenience, they have same `groupId`, versioning and release cycle as core
32
33
| android.os.Bundle |[AhmedMourad0/bundlizer](https://github.com/AhmedMourad0/bundlizer) <br> `dev.ahmedmourad.bundlizer:bundlizer-core`| Android | Allow serialization and deserialization of objects to and from [android.os.Bundle](https://developer.android.com/reference/android/os/Bundle). |
33
34
| CSV |[hfhbd/kotlinx-serialization-csv](https://github.com/hfhbd/kotlinx-serialization-csv) <br> `app.softwork:kotlinx-serialization-csv`| all supported platforms | Allows serialization and deserialization of CSV files. There are still some limitations (ordered properties). |
34
35
| Fixed Length Format |[hfhbd/kotlinx-serialization-csv](https://github.com/hfhbd/kotlinx-serialization-csv) <br> `app.softwork:kotlinx-serialization-flf`| all supported platforms | Allows serialization and deserialization of [Fixed Length Format files](https://www.ibm.com/docs/en/psfa/7.2.1?topic=format-fixed-length-files). Each property must be annotated with `@FixedLength` and there are still some limitations due to missing delimiters. |
35
-
| JSON5 |[xn32/json5k](https://github.com/xn32/json5k) <br> `io.github.xn32:json5k`| JVM, Native | Library for the serialization to and deserialization from [JSON5](https://json5.org) text. |
36
+
| JSON5 |[xn32/json5k](https://github.com/xn32/json5k) <br> `io.github.xn32:json5k`| JVM, Native | Library for the serialization to and deserialization from [JSON5](https://json5.org) text. |
0 commit comments