|
| 1 | +1.10.0-RC / 2025-12-18 |
| 2 | +================== |
| 3 | + |
| 4 | +This is a release candidate for 1.10.0 based on Kotlin 2.3.0. It stabilizes a set of frequently used JSON APIs and builder options, |
| 5 | +adopts a new 'Return Value Checker' Kotlin feature, and provides a lot of improvements and bug fixes. |
| 6 | + |
| 7 | +## Stabilization of APIs |
| 8 | + |
| 9 | +kotlinx-serialization 1.10 and subsequent releases will be focused on stabilization of existing APIs. |
| 10 | +The following APIs and configuration options are no longer experimental because they're widely used without any known major issues: |
| 11 | + |
| 12 | +* `Json` configuration options: `decodeEnumsCaseInsensitive`, `allowTrailingComma`, `allowComments`, and `prettyPrintIndent`. (#3100) |
| 13 | +* `@EncodeDefault` annotation and its modes. (#3106) |
| 14 | +* `JsonUnquotedLiteral` constructor function (#2900) |
| 15 | +* `JsonPrimitive` constructor function overloads that accept unsigned types. (#3117) |
| 16 | +* JSON DSL functions on `JsonElement` with `Nothing?` overloads. (#3117) |
| 17 | + |
| 18 | +## Readiness for return value checker |
| 19 | + |
| 20 | +Kotlin 2.3.0 [introduces a new feature](https://kotlinlang.org/docs/whatsnew23.html#unused-return-value-checker) aimed |
| 21 | +at helping you to catch bugs related to the accidentally ignored return value of the function. |
| 22 | +kotlinx-serialization 1.10.0-RC code is fully marked for this feature, meaning that you |
| 23 | +can get warnings for unused function calls like `Json.encodeToString(...)`. |
| 24 | +To get the warnings, the feature has to be enabled in your project as [described here](https://kotlinlang.org/docs/unused-return-value-checker.html#configure-the-unused-return-value-checker). |
| 25 | + |
| 26 | +## Polymorphism improvements |
| 27 | + |
| 28 | +Polymorphic serialization received a couple of improvements in this release: |
| 29 | + |
| 30 | +New `subclassesOfSealed` utility to automatically register sealed subclasses serializers in polymorphic modules (#2201). |
| 31 | +Use it in your `SerializersModule` when configuring a polymorphic hierarchy which contains both abstract and sealed classes. |
| 32 | +[For example](https://github.com/Kotlin/kotlinx.serialization/issues/2199), when root of your hierarchy is an `inteface`, but most of your inheritors are `sealed` classes. |
| 33 | +The new function will register all known sealed subclasses for you, so you don’t need to list them one by one. |
| 34 | +This makes writing your `SerializerModule`s much faster and simpler. |
| 35 | +Big thanks to [Paul de Vrieze](https://github.com/pdvrieze) for contributing this feature. |
| 36 | + |
| 37 | +Class discriminator conflict check rework (#3105). |
| 38 | +If a payload already contains a property with the same name as the configured discriminator (for example, `type`), |
| 39 | +it is called a class discriminator conflict. |
| 40 | +To produce a correct output and allow more inputs to be deserialized at the same time, the following changes were made: |
| 41 | +* Conflicts introduced by `JsonNamingStrategy` transformations are now detected during serialization as well and will cause `SerializationException`. |
| 42 | +It also affects non-polymorphic classes. |
| 43 | +* Conflicts from `ClassDisciminatorMode.ALL_JSON_OBJECTS` and `SerializersModuleBuilder.polymorphicDefaultSerializer` are also detected. |
| 44 | +* It is allowed to deserialize such a conflicting key for both sealed and open polymorphic hierarchies. |
| 45 | +Previously, it was possible in the sealed hierarchies alone due to missing assertion. See #1664 for details. |
| 46 | + |
| 47 | +## General improvements |
| 48 | + |
| 49 | + * Add `.serialName` to `MissingFieldException` for clearer diagnostics. (#3114) |
| 50 | + * Generate unique `Automatic-Module-Name` entries for metadata JARs. (#3109) |
| 51 | + * Revised ProGuard rules and added R8 tests. (#3041) |
| 52 | + * CBOR: Improved error message when a byte string/array type mismatch is encountered. (#3052) |
| 53 | + |
| 54 | +## Bugfixes |
| 55 | + |
| 56 | + * Fix the type in the `BIGNUM_NEGATIVE` tag name. (#3090) |
| 57 | + * CBOR: Fix various bugs in the decoder implementation to be more strict and consistent with the specification. |
| 58 | + |
1 | 59 | 1.9.0 / 2025-06-27 |
2 | 60 | ================== |
3 | 61 |
|
|
0 commit comments