kotlinx.serialization v1.0.0-RC2 Release NotesRelease Date: 2020-09-21 // almost 2 years ago
🚀 Second release candidate for 1.0.0 version. This RC contains tweaks and changes based on users feedback after 1.0.0-RC.
JSON format is now located in different artifact (#994)
In 1.0.0-RC, the
kotlinx-serialization-coreartifact contained core serialization entities as well as
We've decided to change that and to make
It would make the life easier for those who use other serial formats and also make possible to write your own implementation of JSON
0️⃣ or another format without unnecessary dependency on the default one.
Jsonclass and related entities are located in
To migrate, simply replace
-json. Core library then will be included automatically
as the transitive dependency.
For most use-cases, you should use new
kotlinx-serialization-coreif you are
writing a library that depends on kotlinx.serialization in a format-agnostic way of provides its own serial format.
encodeDefaultsflag is now set to
falsein the default configuration for JSON, CBOR and Protocol Buffers.
The change is motivated by the fact that in most real-life scenarios, this flag is set to
🔧 because such configuration reduces visual clutter and saves amount of data being serialized.
0️⃣ Other libraries, like GSON and Moshi, also have this behavior by default.
0️⃣ This may change how your serialized data looks like, if you have not set value for
We anticipate that most users already had done this, so no migration is required.
🔧 In case you need to return to the old behavior, simply add
encodeDefaults = trueto your configuration while creating
Json.encodeToDynamic/Json.decodeFromDynamicfunctions to json package
📜 Since these functions are no longer exposed via
DynamicObjectParser/Serializerand they are now
📦 they should be moved to
To migrate, simply add
import kotlinx.serialization.json.*to your files.
🛠 Bugfixes and improvements
- 0️⃣ Do not provide default implementation for serializersModule in AbstractEncoder/Decoder (#1089)
- 👌 Support JsonElement hierarchy in
- 👌 Support top-level primitives and primitive map keys in
- 🔄 Change core annotations retention (#1083)
- 🛠 Fix 'Duplicate class ... found in modules' on Gradle != 6.1.1 (#996)
- 📚 Various documentation clarifications
- 👌 Support deserialization of top-level nullable types (#1038)
- 👻 Make most serialization exceptions eligible for coroutines exception recovery (#1054)
- Get rid of methods that do not present in Android API<24 (#1013, #1040)
- Throw JsonDecodingException on empty string literal at the end of the input (#1011)
- ✂ Remove new lines in deprecation warnings that caused errors in ObjC interop (#990)