11.6.3 / 2024-02-16 2================== 3 4This release provides a couple of new features and uses Kotlin 1.9.22 as default. 5 6### Class discriminator output mode 7 8Class discriminator provides information for serializing and deserializing [polymorphic class hierarchies](docs/polymorphism.md#sealed-classes). 9In case you want to encode more or less information for various third party APIs about types in the output, it is possible to control 10addition of the class discriminator with the `JsonBuilder.classDiscriminatorMode` property. 11For example, `ClassDiscriminatorMode.NONE` does not add class discriminator at all, in case the receiving party is not interested in Kotlin types. 12You can learn more about this feature in the documentation and corresponding [PR](https://github.com/Kotlin/kotlinx.serialization/pull/2532). 13 14### Other features 15 16* Add kebab-case naming strategy (#2531) (thanks to [Emil Kantis](https://github.com/Kantis)) 17* Add value class support to the ProtoBufSchemaGenerator (#2542) (thanks to [Felipe Rotilho](https://github.com/rotilho)) 18 19### Bugfixes and improvements 20 21* Fix: Hocon polymorphic serialization in containers (#2151) (thanks to [LichtHund](https://github.com/LichtHund)) 22* Actualize lenient mode documentation (#2568) 23* Slightly improve error messages thrown from serializer<T>() function (#2533) 24* Do not try to coerce input values for properties (#2530) 25* Make empty objects and arrays collapsed in pretty print mode (#2506) 26* Update Gradle dokka configuration to make sure "source" button is visible in all API docs (#2518, #2524) 27 281.6.2 / 2023-11-30 29================== 30 31This is a patch release accompanying Kotlin 1.9.21. It also provides additional targets that were not available in 1.6.1: 32wasm-wasi and (deprecated) linuxArm32Hfp. 33 34* Add Wasm WASI target (#2510) 35* Bring back linuxArm32Hfp target because it is deprecated, but not removed yet. (#2505) 36 371.6.1 / 2023-11-15 38================== 39 40This release uses Kotlin 1.9.20 by default, while upcoming 1.9.21 is also supported. 41 42### Trailing commas in Json 43 44Trailing commas are one of the most popular non-spec Json variations. 45A new configuration flag, `allowTrailingComma`, makes Json parser accept them instead of throwing an exception. 46Note that it does not affect encoding, so kotlinx.serialization always produces Json without trailing commas. 47See details in the corresponding [PR](https://github.com/Kotlin/kotlinx.serialization/pull/2480) 48 49### Support of WasmJs target 50 51Kotlin/Wasm has been experimental for some time and gained enough maturity to be added to the kotlinx libraries. 52Starting with 1.6.1, kotlinx.serialization provides a wasm-js flavor, so your projects with Kotlin/Wasm can have even more 53functionality. 54As usual, just add serialization dependencies to your build 55and [declare wasmJs target](https://kotlinlang.org/docs/whatsnew1920.html#new-wasm-wasi-target-and-the-renaming-of-the-wasm-target-to-wasm-js). 56Please remember that Kotlin/Wasm is still experimental, so changes are expected. 57 58### Bugfixes and improvements 59 60* Fix TaggedDecoder nullable decoding (#2456) (thanks to [Phillip Schichtel](https://github.com/pschichtel)) 61* Fix IllegalAccessException for some JPMS boundaries (#2469) 62* Cbor: check if inline value classes are marked as @ByteString (#2466) (thanks to [eater](https://github.com/the-eater)) 63* Improve polymorphic deserialization optimization (#2481) 64* Update Okio dependency to 3.6.0 (#2473) 65* Add protobuf conformance tests (#2404) (thanks to [Doğaç Eldenk](https://github.com/Dogacel)) 66* Support decoding maps with boolean keys (#2440) 67 681.6.0 / 2023-08-22 69================== 70 71This release contains all features and bugfixes from [1.6.0-RC](https://github.com/Kotlin/kotlinx.serialization/releases/tag/v1.6.0-RC) plus some bugfixes on its own (see below). 72Kotlin 1.9.0 is used as a default, while 1.9.10 is also supported. 73 74### Bugfixes 75 76 * Improve error messages from Json parser (#2406) 77 * Mark @SerialName, @Required and @Transient with @MustBeDocumented (#2407) 78 * Ensure that no additional files except java compiler output get into multi-release jar (#2405) 79 * Fix enums with negative numbers in protobuf not serializing & de-serializing (#2400) (thanks to [Doğaç Eldenk](https://github.com/Dogacel)) 80 811.6.0-RC / 2023-08-03 82================== 83 84This release is based on the Kotlin 1.9.0. 85 86### Removal of Legacy JS target 87 88Some time ago, in Kotlin 1.8, [JS IR compiler was promoted to stable and old JS compiler was deprecated](https://kotlinlang.org/docs/whatsnew18.html#stable-js-ir-compiler-backend). 89Kotlin 1.9 promotes the usage of deprecated JS compiler to an error. As a result, kotlinx.serialization no longer builds with the legacy compiler 90and does not distribute artifacts for it. You can read the migration guide for JS IR compiler [here](https://kotlinlang.org/docs/js-ir-migration.html). 91 92Also pay attention to the fact that Kotlin/Native also has some [deprecated targets](https://kotlinlang.org/docs/native-target-support.html#deprecated-targets) 93that are going to be removed in the Kotlin 1.9.20. Therefore, kotlinx.serialization 1.6.0-RC and 1.6.0 are likely the last releases that support these targets. 94 95### Case insensitivity for enums in Json 96 97This release features a new configuration flag for Json: `decodeEnumsCaseInsensitive` 98that allows you to decode enum values in a case-insensitive manner. 99For example, when decoding `enum class Foo { VALUE_A , VALUE_B}` both inputs `"value_a"` and `"value_A"` will yield `Foo.VALUE_A`. 100You can read more about this feature in the documentation and corresponding [PR](https://github.com/Kotlin/kotlinx.serialization/pull/2345). 101 102### Other bugfixes and enhancements 103 104 * Add support to decode numeric literals containing an exponent (#2227) (thanks to [Roberto Blázquez](https://github.com/xBaank)) 105 * Fix NoSuchMethodError related to Java 8 API compatibility (#2328, #2350) (thanks to [Björn Kautler](https://github.com/Vampire)) 106 * Changed actual FormatLanguage annotation for JS and Native to avoid problems with duplicating org.intellij.lang.annotations.Language (#2390, #2379) 107 * Fix error triggered by 'consume leading class discriminator' polymorphic parsing optimization (#2362) 108 * Fix runtime error with Serializer for Nothing on the JS target (#2330) (thanks to [Shreck Ye](https://github.com/ShreckYe)) 109 * Fix beginStructure in JsonTreeDecoder when inner structure descriptor is same as outer (#2346) (thanks to [Ugljesa Jovanovic](https://github.com/ionspin)) 110 * Actualize 'serializer not found' platform-specific message (#2339) 111 * Fixed regression with serialization using a list parametrized with contextual types (#2331) 112 113 1141.5.1 / 2023-05-11 115================== 116This release contains an important Native targets overhaul, as well as numerous enhancements and bugfixes. 117Kotlin 1.8.21 is used by default. 118 119### New set of Native targets 120 121The official [Kotlin target support policy](https://kotlinlang.org/docs/native-target-support.html) has recently been published 122describing new target policy: each target belongs to a certain _tier_, and different tiers have different stability guarantees. 123The official recommendation for library authors is to support targets up to Tier 3, 124and kotlinx.serialization now follows it. 125It means that in this release, there are a lot of new targets added from this tier, 126such as `androidNativeX86` or `watchosDeviceArm64`. 127Note that since they belong to Tier 3, they're not auto-tested on CI. 128 129kotlinx.serialization also ships some deprecated Kotlin/Native targets that do not belong to any tier (e.g. `iosArm32`, `mingwX86`). 130We'll continue to release them, but we do not provide support for them, nor do we plan to add new targets from the deprecated list. 131 132### Improvements in Json elements 133 134There are two new function sets that should make creating raw Json elements easier. 135[First one](https://github.com/Kotlin/kotlinx.serialization/pull/2160) contains overloads for `JsonPrimitive` constructor-like function 136that accept unsigned types: `JsonPrimitive(1u)`. 137[Second one](https://github.com/Kotlin/kotlinx.serialization/pull/2156) adds new `addAll` functions to `JsonArrayBuilder` to be used with collections 138of numbers, booleans or strings: `buildJsonArray { addAll(listOf(1, 2, 3)) }` 139Both were contributed to us by [aSemy](https://github.com/aSemy). 140 141### Other enhancements 142 143 * **Potential source-breaking change**: Rename json-okio `target` variables to `sink` (#2226) 144 * Function to retrieve KSerializer by KClass and type arguments serializers (#2291) 145 * Added FormatLanguage annotation to Json methods (#2234) 146 * Properties Format: Support sealed/polymorphic classes as class properties (#2255) 147 148### Bugfixes 149 150 * KeyValueSerializer: Fix missing call to endStructure() (#2272) 151 * ObjectSerializer: Respect sequential decoding (#2273) 152 * Fix value class encoding in various corner cases (#2242) 153 * Fix incorrect json decoding iterator's .hasNext() behavior on array-wrapped inputs (#2268) 154 * Fix memory leak caused by invalid KTypeWrapper's equals method (#2274) 155 * Fixed NoSuchMethodError when parsing a JSON stream on Java 8 (#2219) 156 * Fix MissingFieldException duplication (#2213) 157 158 1591.5.0 / 2023-02-27 160================== 161 162This release contains all features and bugfixes from 1.5.0-RC plus some experimental features and bugfixes on its own (see below). 163Kotlin 1.8.10 is used as a default. 164 165### HoconEncoder and HoconDecoder interfaces and HOCON-specific serializers 166 167These interfaces work in a way similar to `JsonEncoder` and `JsonDecoder`: they allow intercepting (de)serialization process, 168making writing if custom HOCON-specific serializers easier. New `ConfigMemorySizeSerializer` and `JavaDurationSerializer` already make use of them. 169See more details in the [PR](https://github.com/Kotlin/kotlinx.serialization/pull/2094). 170Big thanks to [Alexander Mikhailov](https://github.com/alexmihailov) for contributing this! 171 172### Ability to read buffered huge strings in custom Json deserializers 173 174New interface `ChunkedDecoder` allows you to read huge strings that may not fit in memory by chunks. 175Currently, this interface is only implemented by Json decoder that works with strings and streams, 176but we may expand it later, if there's a demand for it. 177See more details in the [PR](https://github.com/Kotlin/kotlinx.serialization/pull/2012) authored by [Alexey Sviridov](https://github.com/fred01). 178 179### Bugfixes 180 181 * Improve runtime exceptions messages (#2180) 182 * Added support for null values for nullable enums in lenient mode (#2176) 183 * Prevent class loaders from leaking when using ClassValue cache (#2175) 184 1851.5.0-RC / 2023-01-25 186================== 187 188This is a release candidate for the next version with many new features to try. 189It uses Kotlin 1.8.0 by default. 190 191### Json naming strategies 192 193A long-awaited feature (#33) is available in this release. 194A new interface, `JsonNamingStrategy` and Json configuration property `namingStrategy` allow 195defining a transformation that is applied to all properties' names serialized by a Json instance. 196There's also a predefined implementation for the most common use case: `Json { namingStrategy = JsonNamingStrategy.SnakeCase }`. 197Check out the [PR](https://github.com/Kotlin/kotlinx.serialization/pull/2111) for more details and documentation. 198 199### Json unquoted literals 200 201kotlinx-serialization-json has an API for manipulating raw Json values: functions and classes `JsonObject`, `JsonPrimitive`, etc. 202In this release, there is a new addition to this API: `JsonUnquotedLiteral` constructor function. 203It allows to produce a string that is not quoted in the Json output. This function has a lot of valuable 204applications: from writing unsigned or large numbers to embedding whole Json documents without the need for re-parsing. 205For an example, read the [Encoding literal Json content docs](https://github.com/Kotlin/kotlinx.serialization/blob/v1.5.0-RC/docs/json.md#encoding-literal-json-content-experimental). 206This huge feature was contributed to us by [aSemy](https://github.com/aSemy): [#2041](https://github.com/Kotlin/kotlinx.serialization/pull/2041). 207 208### Stabilization of serializer(java.lang.Type) function family 209 210Functions `serializer`, `serializerOrNull` and extensions `SerializersModule.serializer`, `SerializersModule.serializerOrNull` 211have JVM-only overloads that accept `java.lang.Type`. These overloads are crucial for interoperability: with them, third-party Java frameworks 212like Spring, which usually rely on Java's reflection and type tokens, can retrieve `KSerializer` instance and use kotlinx.serialization properly. 213We've removed `@ExperimentalSerializationApi` from these functions, and starting from 1.5.0-RC they're considered stable with all backward compatibility guarantees. 214This change should improve third-party support for kotlinx.serialization in various frameworks. 215See the [PR](https://github.com/Kotlin/kotlinx.serialization/issues/2069) for details. 216 217### Deprecations in module builders for polymorphism 218 219Some time ago, in 1.3.2, new functions `SerializersModuleBuilder.polymorphicDefaultSerializer/polymorphicDefaultDeserializer` and `PolymorphicModuleBuilder.defaultDeserializer` were introduced 220— better names allow an easier understanding of which serializers affect what part of the process. 221In 1.5.0-RC, we finish the migration path: these functions are no longer experimental. 222And old functions, namely `SerializersModuleCollector.polymorphicDefault` and `PolymorphicModuleBuilder.default`, are now deprecated. 223See the [PR](https://github.com/Kotlin/kotlinx.serialization/issues/2076) for details. 224 225### Bundled Proguard rules 226 227The `kotlinx-serialization-core-jvm` JAR file now includes consumer Proguard rules, 228so manual Proguard configuration is no longer necessary for most of the setups. 229See updated [Android setup section](https://github.com/Kotlin/kotlinx.serialization/blob/169a14558ca13cfd731283a854d825d1f19ef195/README.md#android) 230and corresponding PRs: [#2092](https://github.com/Kotlin/kotlinx.serialization/issues/2092), [#2123](https://github.com/Kotlin/kotlinx.serialization/issues/2123). 231 232### Support for kotlin.Duration in HOCON format 233 234HOCON specifies its own formatting for duration values. Starting with this release, 235kotlinx-serialization-hocon is able to serialize and deserialize `kotlin.Duration` 236using proper representation instead of the default one. Big thanks to [Alexander Mikhailov](https://github.com/alexmihailov) 237and his PRs: [#2080](https://github.com/Kotlin/kotlinx.serialization/issues/2080), [#2073](https://github.com/Kotlin/kotlinx.serialization/issues/2073). 238 239### Functional and performance improvements 240 241 * Make DeserializationStrategy covariant at declaration-site (#1897) (thanks to [Lukellmann](https://github.com/Lukellmann)) 242 * Added support for the `kotlin.Nothing` class as built-in (#1991, #2150) 243 * Further improve stream decoding performance (#2101) 244 * Introduce CharArray pooling for InputStream decoding (#2100) 245 * Consolidate exception messages and improve them (#2068) 246 247### Bugfixes 248 249 * Add stable hashCode()/equals() calculation to PrimitiveSerialDescriptor (#2136) (thanks to [Vasily Vasilkov](https://github.com/vgv)) 250 * Added a factory that creates an enum serializer with annotations on the class (#2125) 251 * Correctly handle situation where different serializers can be provided for the same KClass in SealedClassSerializer (#2113) 252 * Fixed serializers caching for parametrized types from different class loaders (#2070) 253 254 2551.4.1 / 2022-10-14 256================== 257 258This is patch release contains several bugfixes and improvements. 259Kotlin 1.7.20 is used by default. 260 261### Improvements 262 263 * Add @MustBeDocumented to certain annotations (#2059) 264 * Deprecate .isNullable in SerialDescriptor builder (#2040) 265 * Unsigned primitives and unsigned arrays serializers can be retrieved as built-ins (#1992) 266 * Serializers are now cached inside reflective lookup, leading to faster serializer retrieval (#2015) 267 * Compiler plugin can create enum serializers using static factories for better speed (#1851) (Kotlin 1.7.20 required) 268 * Provide foundation for compiler plugin intrinsics available in Kotlin 1.8.0 (#2031) 269 270### Bugfixes 271 272 * Support polymorphism in Properties format (#2052) (thanks to [Rodrigo Vedovato](https://github.com/rodrigovedovato)) 273 * Added support of UTF-16 surrogate pairs to okio streams (#2033) 274 * Fix dependency on core module from HOCON module (#2020) (thanks to [Osip Fatkullin](https://github.com/osipxd)) 275 276 2771.4.0 / 2022-08-18 278================== 279 280This release contains all features and bugfixes from 1.4.0-RC plus some bugfixes on its own (see below). 281Kotlin 1.7.10 is used as a default. 282 283### Bugfixes 284 * Fixed decoding of huge JSON data for okio streams (#2006) 285 286 2871.4.0-RC / 2022-07-20 288================== 289 290This is a candidate for the next big release with many new exciting features to try. 291It uses Kotlin 1.7.10 by default. 292 293### Integration with Okio's BufferedSource and BufferedSink 294 295[Okio library by Square](https://square.github.io/okio/) is a popular solution for fast and efficient IO operations on JVM, K/N and K/JS. 296In this version, we have added functions that parse/write JSON directly to Okio's input/output classes, saving you the overhead of copying data to `String` beforehand. 297These functions are called `Json.decodeFromBufferedSource` and `Json.encodeToBufferedSink`, respectively. 298There's also `decodeBufferedSourceToSequence` that behaves similarly to `decodeToSequence` from Java streams integration, so you can lazily decode multiple objects the same way as before. 299 300Note that these functions are located in a separate new artifact, so users who don't need them wouldn't find themselves dependent on Okio. 301To include this artifact in your project, use the same group id `org.jetbrains.kotlinx` and artifact id `kotlinx-serialization-json-okio`. 302To find out more about this integration, check new functions' documentation and corresponding pull requests: 303[#1901](https://github.com/Kotlin/kotlinx.serialization/pull/1901) and [#1982](https://github.com/Kotlin/kotlinx.serialization/pull/1982). 304 305### Inline classes and unsigned numbers do not require experimental annotations anymore 306 307Inline classes and unsigned number types have been promoted to a Stable feature in Kotlin 1.5, 308and now we are promoting support for them in kotlinx.serialization to Stable status, too. 309To be precise, [we've removed all](https://github.com/Kotlin/kotlinx.serialization/pull/1963) `@ExperimentalSerializationApi` annotations from functions related to inline classes encoding and decoding, 310namely `SerialDescriptor.isInline`, `Encoder.encodeInline`, and some others. We've also updated related [documentation article](docs/value-classes.md). 311 312Additionally, all `@ExperimentalUnsignedTypes` annotations [were removed](https://github.com/Kotlin/kotlinx.serialization/pull/1962) completely, 313so you can freely use types such as `UInt` and their respective serializers as a stable feature 314without opt-in requirement. 315 316### Part of SerializationException's hierarchy is public now 317 318When kotlinx.serialization 1.0 was released, all subclasses of `SerializationException` were made internal, 319since they didn't provide helpful information besides the standard message. 320Since then, we've received a lot of feature requests with compelling use-cases for exposing some of these internal types to the public. 321In this release, we are starting to fulfilling these requests by making `MissingFieldException` public. 322One can use it in the `catch` clause to better understand the reasons of failure — for example, to return 400 instead of 500 from an HTTP server — 323and then use its `fields` property to communicate the message better. 324See the details in the corresponding [PR](https://github.com/Kotlin/kotlinx.serialization/pull/1983). 325 326In future releases, we'll continue work in this direction, and we aim to provide more useful public exception types & properties. 327In the meantime, we've [revamped KDoc](https://github.com/Kotlin/kotlinx.serialization/pull/1980) for some methods regarding the exceptions — all of them now properly declare which exception types are allowed to be thrown. 328For example, `KSerializer.deserialize` is documented to throw `IllegalStateException` to indicate problems unrelated to serialization, such as data validation in classes' constructors. 329 330### @MetaSerializable annotation 331 332This release introduces a new `@MetaSerializable` annotation that adds `@Serializable` behavior to user-defined annotations — i.e., those annotations would also instruct the compiler plugin to generate a serializer for class. In addition, all annotations marked with `@MetaSerializable` are saved in the generated `@SerialDescriptor` 333as if they are annotated with `@SerialInfo`. 334 335This annotation will be particularly useful for various format authors who require adding some metadata to the serializable class — this can now be done using a single annotation instead of two, and without the risk of forgetting `@Serializable`. Check out details & examples in the KDoc and corresponding [PR](https://github.com/Kotlin/kotlinx.serialization/pull/1979). 336 337> Note: Kotlin 1.7.0 or higher is required for this feature to work. 338 339### Moving documentation from GitHub pages to kotlinlang.org 340 341As a part of a coordinated effort to unify kotlinx libraries users' experience, Dokka-generated documentation pages (KDoc) were moved from https://kotlin.github.io/kotlinx.serialization/ to https://kotlinlang.org/api/kotlinx.serialization/. No action from you is required — there are proper redirects at the former address, so there is no need to worry about links in your blogpost getting obsolete or broken. 342 343Note that this move does not affect guides written in Markdown in the `docs` folder. We aim to move them later, enriching text with runnable examples as in the Kotlin language guides. 344 345### Other improvements 346 347 * Allow Kotlin's null literal in JSON DSL (#1907) (thanks to [Lukellmann](https://github.com/Lukellmann)) 348 * Stabilize EmptySerializersModule (#1921) 349 * Boost performance of polymorphic deserialization in optimistic scenario (#1919) 350 * Added serializer for the `kotlin.time.Duration` class (plugin support comes in Kotlin 1.7.20) (#1960) 351 * Support tagged not null marks in TaggedEncoder/Decoder (#1954) (thanks to [EdwarDDay](https://github.com/EdwarDDay)) 352 353### Bugfixes 354 355 * Support quoting unsigned integers when used as map keys (#1969) 356 * Fix protocol buffer enum schema generation (#1967) (thanks to [mogud](https://github.com/mogud)) 357 * Support diamond inheritance of sealed interfaces in SealedClassSerializer (#1958) 358 * Support retrieving serializer for sealed interface (#1968) 359 * Fix misleading token description in JSON errors (#1941) (thanks to [TheMrMilchmann](https://github.com/TheMrMilchmann)) 360 3611.3.3 / 2022-05-11 362================== 363 364This release contains support for Protocol Buffers packed fields, as well as several bugfixes. 365It uses Kotlin 1.6.21 by default. 366 367### Protobuf packed fields 368 369It is now possible to encode and decode Kotlin classes to/from Protobuf messages with [packed repeated fields](https://developers.google.com/protocol-buffers/docs/encoding#packed). 370To mark the field as packed, use `@ProtoPacked` annotation on it. 371Note it affects only `List` and primitive collection such as `IntArray` types. 372With this feature, it is now possible to decode Proto3 messages, where all repeated fields are packed by default. 373[Protobuf schema generator](https://kotlin.github.io/kotlinx.serialization/kotlinx-serialization-protobuf/kotlinx.serialization.protobuf.schema/-proto-buf-schema-generator/index.html) also supports new `@ProtoPacked` annotation. 374 375Many thanks to [Paul de Vrieze](https://github.com/pdvrieze) for his valuable contribution! 376 377### Other improvements & small features 378 379 * Incorporate JsonPath into exception messages (#1841) 380 * Mark block in corresponding encodeStructure/decodeStructure extensions as crossinline to reduce amount of bytecode (#1917) 381 * Support serialization of compile-time `Collection<E>` properties that are not lists at the runtime (#1821) 382 * Best-effort kotlin reflect avoidance in serializer(Type) (#1819) 383 384### Bugfixes 385 386 * Iterate over element indices in ObjectSerializer in order to let the format skip unknown keys (#1916) 387 * Correctly support registering both default polymorphic serializer & deserializer (#1849) 388 * Make error message for captured generic type parameters much more straightforward (#1863) 389 3901.3.2 / 2021-12-23 391================== 392 393This release contains several features and bugfixes for core API as well as for HOCON format. 394It uses Kotlin 1.6.10 by default. 395 396### Serializing objects to HOCON 397 398It's now possible to encode Kotlin objects to `Config` values with new `Hocon.encodeToConfig` function. 399This feature may help edit existing configs inside Kotlin program or generate new ones. 400 401Big thanks to [Osip Fatkullin](https://github.com/osipxd) for [implementing](https://github.com/Kotlin/kotlinx.serialization/pull/1740) this. 402 403### Polymorphic default serializers 404 405As of now, `polymorphicDefault` clause inside `SerializersModule { }` builder specifies a 406fallback serializer to be used only during deserialization process. A new function has been introduced to allow setting 407fallback serializer for serialization: `polymorphicDefaultSerializer`. 408This function should ease serializing vast hierarchies of third-party or Java classes. 409 410Note that there are two new experimental functions, `polymorphicDefaultSerializer` and `polymorphicDefaultDeserializer`. 411To avoid naming confusion, we are going to deprecate `polymorphicDefault` in favor of `polymorphicDefaultDeserializer` in the next minor release (1.4.0). 412 413Credit for [the PR](https://github.com/Kotlin/kotlinx.serialization/pull/1686) goes to our contributor [Joseph Burton](https://github.com/Earthcomputer). 414 415### Other improvements 416 417 * HOCON: parse strings into integers and booleans if possible (#1795) (thanks to [tobiaslieber](https://github.com/tobiaslieber)) 418 * Add an encodeCollection extensions (#1749) (thanks to [Nicklas Ansman Giertz](https://github.com/ansman)) 419 420### Bugfixes 421 422 * Properly handle top-level value classes in encodeToJsonElement (#1777) 423 * Fix incorrect handling of object end when JsonTreeReader (JsonElement) is used with decodeToSequence (#1782) 424 4251.3.1 / 2021-11-11 426================== 427 428This release mainly contains bugfixes for 1.3.0 and provides new experimental `Json.decodeToSequence` function. 429 430### Improvements 431 432 * Provide decodeToSequence to read multiple objects from stream lazily (#1691) 433 434### Bugfixes 435 436 * Correctly handle buffer boundaries while decoding escape sequences from json stream (#1706) 437 * Properly skip unknown keys for objects and structures with zero properties (#1720) 438 * Fix merging for maplikeSerializer when the map is not empty (by using the actual size * 2). (#1712) (thanks to [pdvrieze](https://github.com/pdvrieze)) 439 * Fix lookup of primitive array serializers by Java type token (#1708) 440 441 4421.3.0 / 2021-09-23 443================== 444 445This release contains all of the cool new features from 1.3.0-RC (see below) as well as minor improvements. 446It uses Kotlin 1.5.31 by default. 447 448### Bugfixes and improvements 449 450 * Promote JsonConfiguration and its usages to stable (#1690) 451 * Remove opt-in annotations from SerialFormat, StringFormat, BinaryFormat (#1688) 452 * Correctly throw SerializationException instead of IOOBE for some cases with EOF in streams (#1677) 453 * CBOR: ignore tags when reading (#1614) (thanks to [David Robertson](https://github.com/DavidJRobertson)) 454 4551.3.0-RC / 2021-09-06 456================== 457 458This is a release candidate for the next version. It contains a lot of interesting features and improvements, 459so we ask you to evaluate it and share your feedback. 460Kotlin 1.5.30 is used by default. 461 462### Java IO stream-based JSON serialization 463 464Finally, in `kotlinx.serialization` 1.3.0 we’re presenting the first experimental version of the serialization API for IO streams: 465`Json.encodeToStream` and `Json.decodeFromStream` extension functions. 466With this API, you can decode objects directly from files, network connections, and other data sources without reading the data to strings beforehand. 467The opposite operation is also available: you can send encoded objects directly to files and other streams in a single API call. 468IO stream serialization is available only on the JVM platform and for the JSON format for now. 469 470Check out more in the [PR](https://github.com/Kotlin/kotlinx.serialization/pull/1569). 471 472### Property-level control over defaults values encoding 473 474Previous versions of the library allowed to specify whether to encode or drop default properties values with 475format configuration flags such as `Json { encodeDefaults = false }`. 476In 1.3.0 we’re extending this feature by adding a new way to fine-tune the serialization of default values: 477you can now control it on the property level using the new `@EncodeDefaults` annotation. 478 479`@EncodeDefaults` annotation has a higher priority over the `encodeDefaults` property and takes one of two possible values: 480- `ALWAYS` (default value) encodes a property value even if it equals to default. 481- `NEVER` doesn’t encode the default value regardless of the format configuration. 482 483Encoding of the annotated properties is not affected by `encodeDefault` format flag 484and works as described for all serialization formats, not only JSON. 485 486To learn more, check corresponding [PR](https://github.com/Kotlin/kotlinx.serialization/pull/1528). 487 488### Excluding null values from JSON serialization 489 490In 1.3.0, we’re introducing one more way to reduce the size of the generated JSON strings: omitting null values. 491A new JSON configuration property `explicitNulls` defines whether `null` property values should be included in the serialized JSON string. 492The difference from `encodeDefaults` is that `explicitNulls = false` flag drops null values even if the property does not have a default value. 493Upon deserializing such a missing property, a `null` or default value (if it exists) will be used. 494 495To maintain backwards compatibility, this flag is set to `true` by default. 496You can learn more in the [documentation](docs/json.md#explicit-nulls) or the [PR](https://github.com/Kotlin/kotlinx.serialization/pull/1535). 497 498### Per-hierarchy polymorphic class discriminators 499 500In previous versions, you could change the discriminator name using the 501[classDiscriminator](https://github.com/Kotlin/kotlinx.serialization/blob/master/docs/json.md#class-discriminator) property of the `Json` instance. 502In 1.3.0, we’re adding a way to set a custom discriminator name for each class hierarchy to enable more flexible serialization. 503You can do it by annotating a class with `@JsonClassDiscriminator` with the discriminator name as its argument. 504A custom discriminator is applied to the annotated class and its subclasses. 505Only one custom discriminator can be used in each class hierarchy, thanks to the new `@InheritableSerialInfo` annotation. 506 507Check out corresponding [PR](https://github.com/Kotlin/kotlinx.serialization/pull/1608) for details. 508 509### Support for Java module system 510 511Now all kotlinx.serialization runtime libraries are shipped as a multi-release JAR with `module-info.class` file for Java versions 9 and higher. 512This enables possibilities to use kotlinx.serialization with modern tools such as `jlink` and various technologies such as `TorandoFX`. 513 514Many thanks to our contributor [Gerard de Leeuw](https://github.com/lion7) and his [PR](https://github.com/Kotlin/kotlinx.serialization/pull/1624) for making this possible. 515 516### Native targets for Apple Silicon 517 518This release includes klibs for new targets, introduced in Kotlin/Native 1.5.30 — 519`macosArm64`, `iosSimulatorArm64`, `watchosSimulatorArm64`, and `tvosSimulatorArm64`. 520 521### Bugfixes and improvements 522 523 * Properly handle quoted 'null' literals in lenient mode (#1637) 524 * Switch on deep recursive function when nested level of JSON is too deep (#1596) 525 * Support for local serializable classes in IR compiler 526 * Support default values for `@SerialInfo` annotations in IR compiler 527 * Improve error message for JsonTreeReader (#1597) 528 * Add guide for delegating serializers and wrapping serial descriptor (#1591) 529 * Set target JVM version to 8 for Hocon module in Gradle metadata (#1661) 530 5311.2.2 / 2021-07-08 532================== 533 534This release contains various bugfixes, some useful features and important performance improvements. 535It also uses Kotlin 1.5.20 as default. 536 537### Features 538 539 * Support for `@JsonNames` and `coerceInputValues` in `Json.decodeFromDynamic` (#1479) 540 * Add factory function to wrap a serial descriptor with a custom name for custom delegating serializers (#1547) (thanks to [Fadenfire](https://github.com/Fadenfire)) 541 * Allow contextually serialized types to be used as map keys in Json (#1552) (thanks to [pdvrieze](https://github.com/pdvrieze)) 542 543### Bugfixes and performance improvements 544 545 * Update size in `JsonStringBuilder` slow-path to avoid excessive array-copies for large strings with escape symbols (#1491) 546 * Optimize integer encoding length in CBOR (#1570) (thanks to [davertay](https://github.com/davertay)) 547 * Throw `JsonDecodingException` instead of `ClassCastException` during unexpected null in `TreeJsonDecoder` (#1550) 548 * Prohibit 'null' strings in lenient mode in order to get rid of 'null' and "null" ambiguity (#1549) 549 * Avoid usage of reflective-like `serialDescriptor<KType>` in production sources (#1540) 550 * Added correct error message when deserializing missing enum member for Properties format (#1539) 551 * Make `DescriptorSchemaCache` in Json thread-local on Native (#1484) 552 5531.2.1 / 2021-05-14 554================== 555 556This release mainly contains bugfixes for various issues, including important [broken thread-safety](https://github.com/Kotlin/kotlinx.serialization/issues/1455) and [improper encoding](https://github.com/Kotlin/kotlinx.serialization/issues/1441). 557 558### Features 559 560 * Added support for nullable values, nested and empty collections in protobuf (#1430) 561 562### Bugfixes 563 564 * Support @JsonNames for enum values (#1473) 565 * Handle EOF in skipElement correctly (#1475) 566 * Allow using value classes with primitive carriers as map keys (#1470) 567 * Read JsonNull only for non-string literals in JsonTreeReader (#1466) 568 * Properly reuse JsonStringBuilders in CharArrayPool (#1455) 569 * Properly ensure capacity of the string builder on the append slow-path (#1441) 570 5711.2.0 / 2021-04-27 572================== 573 574**This release has some known critical bugs, so we advise to use 1.2.1 instead.** 575 576This release contains a lot of new features and important improvements listed below; 577Kotlin 1.5.0 is used as a default compiler and language version. 578 579### JSON performance improvements 580 581JSON encoder and decoder were revisited and significantly rewritten, 582which lead us to up to 2-3x times speedup in certain cases. 583Additional details can be found in the corresponding issues: [[1]](https://github.com/Kotlin/kotlinx.serialization/pull/1343), [[2]](https://github.com/Kotlin/kotlinx.serialization/pull/1354). 584 585### Ability to specify alternative names during JSON decoding 586 587[The one of the most voted issues](https://github.com/Kotlin/kotlinx.serialization/issues/203) is fixed now — it is possible to specify multiple names for one property 588using new `@JsonNames` annotation. 589Unlike `@SerialName`, it only affects JSON decoding, so it is useful when dealing with different versions of the API. 590We've prepared a [documentation](https://github.com/Kotlin/kotlinx.serialization/blob/dev/docs/json.md#alternative-json-names) for you about it. 591 592### JsonConfiguration in public API 593 594`JsonConfiguration` is exposed as a property of `Json` instance. You can use it to adjust behavior in 595your [custom serializers](https://github.com/Kotlin/kotlinx.serialization/blob/dev/docs/json.md#maintaining-custom-json-attributes). 596Check out more in the corresponding [issue](https://github.com/Kotlin/kotlinx.serialization/issues/1361) and the [PR](https://github.com/Kotlin/kotlinx.serialization/pull/1409). 597 598### Generator for .proto files based on serializable Kotlin classes 599 600Our implementation of Protocol Buffers format uses `@Serializable` Kotlin classes as a source of schema. 601This is very convenient for Kotlin-to-Kotlin communication, but makes interoperability between languages complicated. 602To resolve this [issue](https://github.com/Kotlin/kotlinx.serialization/issues/34), we now have a 603schema generator that can produce .proto files out of Kotlin classes. Using it, you can keep Kotlin 604classes as a source of truth and use traditional protoc compilers for other languages at the same time. 605To learn more, check out the documentation for the new `ProtoBufSchemaGenerator` class or 606visit the [corresponding PR](https://github.com/Kotlin/kotlinx.serialization/pull/1255). 607 608>Note: this generator is on its experimental stage and any feedback is very welcomed. 609 610### Contextual serialization of generic classes 611 612Before 1.2.0, it was [impossible](https://github.com/Kotlin/kotlinx.serialization/issues/1407) to register context serializer for generic class, 613because `contextual` function accepted a single serializer. 614Now it is possible to register a provider — lambda that allows to construct a serializer for generic class 615out of its type arguments serializers. See the details in the [documentation](https://github.com/Kotlin/kotlinx.serialization/blob/dev/docs/serializers.md#contextual-serialization-and-generic-classes). 616 617### Other features 618 619 * Support for watchosX64 target (#1366). 620 * Introduce kotlinx-serialization-bom (#1356). 621 * Support serializer<T> on JS IR when T is an interface (#1431). 622 623### Bugfixes 624 625 * Fix serializer lookup by KType for third party classes (#1397) (thanks to [mvdbos](https://github.com/mvdbos)). 626 * Fix inability to encode/decode inline class with string to JsonElement (#1408). 627 * Throw SerializationException instead of AIOB in ProtoBuf (#1373). 628 * Fix numeric overflow in JsonLexer (#1367) (thanks to [EdwarDDay](https://github.com/EdwarDDay)). 629 630 6311.1.0 / 2021-02-17 632================== 633 634This release contains all features and bugfixes from 1.1.0-RC plus an additional fix for incorrect exception type 635(#1325 — Throw `SerializationException` instead of `IllegalStateException` in `EnumSerializer`) and uses release version of Kotlin 1.4.30. 636 637In the light of [JCenter shutdown](https://jfrog.com/blog/into-the-sunset-bintray-jcenter-gocenter-and-chartcenter/), starting from 1.1.0-RC and now on, 638all new releases of kotlinx.serialization are published directly to Maven Central and therefore are not available in `https://kotlin.bintray.com/kotlinx/` repository. 639We suggest you to remove `jcenter()` and other kotlin bintray repositories from your buildscripts and to use `mavenCentral()` repository instead. 640 6411.1.0-RC / 2021-02-03 642================== 643 644This is a release candidate of 1.1.0 version. Note that final 1.1.0 version may include more features and bugfixes, 645which would be listed in the corresponding changelog. 646 647### Kotlin version requirement updated 648 649Due to changes in calling conventions between compiler plugin and serialization core runtime, this release requires 650Kotlin version at least 1.4.30-M1. However, this changes should not affect your code, 651because only deprecated functions were removed from public API. 652See [corresponding PR](https://github.com/Kotlin/kotlinx.serialization/pull/1260) for the details. 653 654### Experimental support for inline classes (IR only) 655 656Using 1.1.0-RC, you can mark inline classes as `@Serializable` and use them in other serializable classes. 657Unsigned integer types (`UByte`, `UShort`, `UInt` and `ULong`) are serializable as well and have special support in JSON. 658This feature requires Kotlin compiler 1.4.30-RC and enabling new IR compilers for [JS](https://kotlinlang.org/docs/reference/js-ir-compiler.html) and [JVM](https://kotlinlang.org/docs/reference/whatsnew14.html#new-jvm-ir-backend). 659 660You can learn more in the [documentation](docs/value-classes.md) 661and corresponding [pull request](https://github.com/Kotlin/kotlinx.serialization/pull/1244). 662 663### Other features 664 665 * Add `serializerOrNull` function for `KType` and `Type` arguments (#1164) 666 * Allow shared prefix names in `Properties` (#1183) (thanks to [TorRanfelt](https://github.com/TorRanfelt)) 667 * Add support for encoding/decoding `Properties` values as Strings (#1158) (thanks to [daniel-jasinski](https://github.com/daniel-jasinski)) 668 669### Bugfixes and performance improvements 670 671 * Support contextual serialization for derived classes (#1277) (thanks to [Martin Raison](https://github.com/martinraison)) 672 * Ensure serialization is usable from K/N background thread (#1282) 673 * Fail on primitive type overflow during `JsonElement` deserialization (#1300) 674 * Throw `SerializationException` instead of ISE when encountering an invalid boolean in JSON (#1299) 675 * Optimize the loop for writing large varints in `ProtoBuf` (#1294) 676 * Fix serializing property with custom accessors and backing field (#1197) 677 * Optimize check for missing fields in deserialization and improve `MissingFieldException` message (#1153) 678 * Improved support of nullable serializer in `@UseSerializers` annotation (#1195) 679 * Correctly escape keys in `JsonObject.toString()` (#1246) (thanks to [Karlatemp](https://github.com/Karlatemp)) 680 * Treat `Collection` as `ArrayList` in serializer by type lookups (#1257) 681 * Do not try to end structure in encode/decode structure extensions if an exception has been thrown, so the original exception will be propagated (#1201) 682 * Properly cache serial names in order to improve performance of JSON parser with strict mode (#1209) 683 * Fix dynamic serialization for nullable values (#1199) (thanks to [ankushg](https://github.com/ankushg)) 684 6851.0.1 / 2020-10-28 686================== 687 688This patch release contains several feature improvements as well as bugfixes and performance improvements. 689 690### Features 691 * Add object-based serialization and deserialization of polymorphic types for `dynamic` conversions on JS platform (#1122) 692 * Add support for object polymorphism in HOCON decoder (#1136) 693 * Add support of decoding map in the root of HOCON config (#1106) 694 695### Bugfixes 696 * Properly cache generated serializers in PluginGeneratedSerialDescriptor (#1159) 697 * Add Pair and Triple to serializer resolving from Java type token (#1160) 698 * Fix deserialization of half-precision, float and double types in CBOR (#1112) 699 * Fix ByteString annotation detection when ByteArray is nullable (#1139) 700 7011.0.0 / 2020-10-08 702================== 703 704The first public stable release, yay! 705The definitions of stability and backwards compatibility guarantees are located in the [corresponding document](docs/compatibility.md). 706We now also have a GitHub Pages site with [full API reference](https://kotlinlang.org/api/kotlinx.serialization/). 707 708Compared to RC2, no new features apart from #947 were added and all previously deprecated declarations and migrations were deleted. 709If you are using RC/RC2 along with deprecated declarations, please, migrate before updating to 1.0.0. 710In case you are using pre-1.0 versions (e.g. 0.20.0), please refer to our [migration guide](docs/migration.md). 711 712### Bugfixes and improvements 713 714 * Support nullable types at top-level for JsonElement decoding (#1117) 715 * Add CBOR ignoreUnknownKeys option (#947) (thanks to [Travis Wyatt](https://github.com/twyatt)) 716 * Fix incorrect documentation of `encodeDefaults` (#1108) (thanks to [Anders Carling](https://github.com/anderscarling)) 717 7181.0.0-RC2 / 2020-09-21 719================== 720 721Second release candidate for 1.0.0 version. This RC contains tweaks and changes based on users feedback after 1.0.0-RC. 722 723### Major changes 724 725* JSON format is now located in different artifact (#994) 726 727In 1.0.0-RC, the `kotlinx-serialization-core` artifact contained core serialization entities as well as `Json` serial format. 728We've decided to change that and to make `core` format-agnostic. 729It would make the life easier for those who use other serial formats and also make possible to write your own implementation of JSON 730or another format without unnecessary dependency on the default one. 731 732In 1.0.0-RC2, `Json` class and related entities are located in `kotlinx-serialization-json` artifact. 733To migrate, simply replace `kotlinx-serialization-core` dependency with `-json`. Core library then will be included automatically 734as the transitive dependency. 735 736For most use-cases, you should use new `kotlinx-serialization-json` artifact. Use `kotlinx-serialization-core` if you are 737writing a library that depends on kotlinx.serialization in a format-agnostic way of provides its own serial format. 738 739* `encodeDefaults` flag is now set to `false` in the default configuration for JSON, CBOR and Protocol Buffers. 740 741The change is motivated by the fact that in most real-life scenarios, this flag is set to `false` anyway, 742because such configuration reduces visual clutter and saves amount of data being serialized. 743Other libraries, like GSON and Moshi, also have this behavior by default. 744 745This may change how your serialized data looks like, if you have not set value for `encodeDefaults` flag explicitly. 746We anticipate that most users already had done this, so no migration is required. 747In case you need to return to the old behavior, simply add `encodeDefaults = true` to your configuration while creating `Json/Cbor/ProtoBuf` object. 748 749* Move `Json.encodeToDynamic/Json.decodeFromDynamic` functions to json package 750 751Since these functions are no longer exposed via `DynamicObjectParser/Serializer` and they are now `Json` class extensions, 752they should be moved to `kotlinx.serialization.json` package. 753To migrate, simply add `import kotlinx.serialization.json.*` to your files. 754 755 756### Bugfixes and improvements 757 758 * Do not provide default implementation for serializersModule in AbstractEncoder/Decoder (#1089) 759 * Support JsonElement hierarchy in `dynamic` encoding/decoding (#1080) 760 * Support top-level primitives and primitive map keys in `dynamic` encoding/decoding 761 * Change core annotations retention (#1083) 762 * Fix 'Duplicate class ... found in modules' on Gradle != 6.1.1 (#996) 763 * Various documentation clarifications 764 * Support deserialization of top-level nullable types (#1038) 765 * Make most serialization exceptions eligible for coroutines exception recovery (#1054) 766 * Get rid of methods that do not present in Android API<24 (#1013, #1040) 767 * Throw JsonDecodingException on empty string literal at the end of the input (#1011) 768 * Remove new lines in deprecation warnings that caused errors in ObjC interop (#990) 769 7701.0.0-RC / 2020-08-17 771================== 772 773Release candidate for 1.0.0 version. The goal of RC release is to collect feedback from users 774and provide 1.0.0 release with bug fixes and improvements based on that feedback. 775 776While working on 1.0.0 version, we carefully examined every public API declaration of the library and 777split it to stable API, that we promise to be source and binary-compatible, 778and experimental API, that may be changed in the future. 779Experimental API is annotated with `@ExperimentalSerializationApi` annotation, which requires opt-in. 780For a more detailed description of the guarantees, please refer to the [compatibility guide](docs/compatibility.md). 781 782The id of the core artifact with `@Serializable` annotation and `Json` format was changed 783from `kotlinx-serialization-runtime` to `kotlinx-serialization-core` to be more clear and aligned with other kotlinx libraries. 784 785A significant part of the public API was renamed or extracted to a separate package. 786To migrate from the previous versions of the library, please refer to the [migration guide](docs/migration.md). 787 788### API changes 789 790#### Json 791 792* Core API changes 793 * `stringify` and `parse` are renamed to `encodeToString` and `decodeFromString` 794 * `parseJson` and `fromJson` are renamed to `parseToJsonElement` and `decodeFromJsonElement` 795 * Reified versions of methods are extracted to extensions 796 797* `Json` constructor is replaced with `Json {}` builder function, `JsonConfiguration` is deprecated in favor 798of `Json {}` builder 799 * All default `Json` implementations are removed 800 * `Json` companion object extends `Json` 801 802* Json configuration 803 * `prettyPrintIndent` allows only whitespaces 804 * `serializeSpecialFloatingPointValues` is renamed to `allowSpecialFloatingPointValues`. It now affects both serialization and deserialization behaviour 805 * `unquoted` JSON flag is deprecated for removal 806 * New `coerceInputValues` option for null-defaults and unknown enums (#90, #246) 807 808* Simplification of `JsonElement` API 809 * Redundant members of `JsonElement` API are deprecated or extracted to extensions 810 * Potential error-prone API is removed 811 * `JsonLiteral` is deprecated in favor of `JsonPrimitive` constructors with nullable parameter 812 813* `JsonElement` builders rework to be aligned with stdlib collection builders (#418, #627) 814 * Deprecated infix `to` and unaryPlus in JSON DSL in favor of `put`/`add` functions 815 * `jsonObject {}` and `json {}` builders are renamed to `buildJsonObject {}` and `buildJsonArray {}` 816 * Make all builders `inline` (#703) 817 818* JavaScript support 819 * `DynamicObjectParser` is deprecated in the favor of `Json.decodeFromDynamic` extension functions 820 * `Json.encodeToDynamic` extension is added as a counterpart to `Json.decodeFromDynamic` (former `DynamicObjectParser`) (#116) 821 822* Other API changes: 823 * `JsonInput` and `JsonOutput` are renamed to `JsonDecoder` and `JsonEncoder` 824 * Methods in `JsonTransformingSerializer` are renamed to `transformSerialize` and `transformDeserialize` 825 * `JsonParametricSerializer` is renamed to `JsonContentPolymorphicSerializer` 826 * `JsonEncodingException` and `JsonDecodingException` are made internal 827 828* Bug fixes 829 * `IllegalStateException` when `null` occurs in JSON input in the place of an expected non-null object (#816) 830 * java.util.NoSuchElementException when deserializing twice from the same JsonElement (#807) 831 832#### Core API for format authoring 833 834* The new naming scheme for `SerialFormats` 835 * Core functions in `StringFormat` and `BinaryFormat` are renamed and now follow the same naming scheme 836 * `stringify`/`parse` are renamed to `encodeToString`/`decodeFromString` 837 * `encodeToByteArray`/`encodeToHexString`/`decodeFromByteArray`/`decodeFromHexString` in `BinaryFormat` are introduced instead of `dump`/`dumps`/`load`/`loads` 838 839* New format instances building convention 840 * Constructors replaced with builder-function with the same name to have the ability to add new configuration parameters, 841 while preserving both source and binary compatibility 842 * Format's companion objects now extend format class and can be used interchangeably 843 844* SerialDescriptor-related API 845 * `SerialDescriptor` and `SerialKind` are moved to a separate `kotlinx.serialization.descriptors` package 846 * `ENUM` and `CONTEXTUAL` kinds now extend `SerialKind` directly 847 * `PrimitiveDescriptor` is renamed to `PrimitiveSerialDescriptor` 848 * Provide specific `buildClassSerialDescriptor` to use with classes' custom serializers, creating other kinds is considered experimental for now 849 * Replace extensions that returned lists (e.g. `elementDescriptors`) with properties that return iterable as an optimization 850 * `IndexOutOfBoundsException` in `descriptor.getElementDescriptor(index)` for `List` after upgrade to 0.20.0 is fixed (#739) 851 852* SerializersModule-related API 853 * `SerialModule` is renamed to `SerializersModule` 854 * `SerialModuleCollector` is renamed to `SerializersModuleCollector` 855 * All builders renamed to be aligned with a single naming scheme (e.g. `SerializersModule {}` DSL) 856 * Deprecate infix `with` in polymorphic builder in favor of subclass() 857 * Helper-like API is extracted to extension functions where possible. 858 * `polymorphicDefault` API for cases when type discriminator is not registered or absent (#902) 859 860* Contextual serialization 861 * `@ContextualSerialization` is split into two annotations: `@Contextual` to use on properties and `@UseContextualSerialization` to use on file 862 * New `SerialDescriptor.capturedKClass` API to introspect SerializersModule-based contextual and polymorphic kinds (#515, #595) 863 864* Encoding-related API 865 * Encoding-related classes (`Encoder`, `Decoder`, `AbstractEncoder`, `AbstractDecoder`) are moved to a separate `kotlinx.serialization.encoding` package 866 * Deprecated `typeParameters` argument in `beginStructure`/`beginCollectio`n methods 867 * Deprecated `updateSerializableValue` and similar methods and `UpdateMode` enum 868 * Renamed `READ_DONE` to `DECODE_DONE` 869 * Make extensions `inline` where applicable 870 * `kotlinx.io` mockery (`InputStream`, `ByteArrayInput`, etc) is removed 871 872* Serializer-related API 873 * `UnitSerializer` is replaced with `Unit.serializer()` 874 * All methods for serializers retrieval are renamed to `serializer` 875 * Context is used as a fallback in `serializer` by KType/Java's Reflect Type functions (#902, #903) 876 * Deprecated all exceptions except `SerializationException`. 877 * `@ImplicitReflectionSerializer` is deprecated 878 * Support of custom serializers for nullable types is added (#824) 879 880#### ProtoBuf 881 882* `ProtoBuf` constructor is replaced with `ProtoBuf {}` builder function 883* `ProtoBuf` companion object now extends `ProtoBuf` 884* `ProtoId` is renamed to `ProtoNumber`, `ProtoNumberType` to `ProtoIntegerType` to be consistent with ProtoBuf specification 885* ProtoBuf performance is significantly (from 2 to 10 times) improved (#216) 886* Top-level primitives, classes and objects are supported in ProtoBuf as length-prefixed tagless messages (#93) 887* `SerializationException` is thrown instead of `IllegalStateException` on incorrect input (#870) 888* `ProtobufDecodingException` is made internal 889 890#### Other formats 891 * All format constructors are migrated to builder scheme 892 * Properties serialize and deserialize enums as strings (#818) 893 * CBOR major type 2 (byte string) support (#842) 894 * `ConfigParser` is renamed to `Hocon`, `kotlinx-serialization-runtime-configparser` artifact is renamed to `kotlinx-serialization-hocon` 895 * Do not write/read size of collection into Properties' map (#743) 896 8970.20.0 / 2020-03-04 898================== 899 900### Release notes 901 9020.20.0 release is focused on giving a library its final and stable API shape. 903 904We have carefully evaluated every `public` declaration and 905decided whether it should be publicly available. As a result, some declarations were deprecated with an intention of removing 906them from public API because they are going to be replaced with others, more valuable and useful for users. 907 908Deprecated symbols include: 909 - Pre-defined JSON instances like `nonStrict` — `strictMode` was split to 3 separate, more granular, flags. 910Users are encouraged to create their own configuration; 911 - Top-level serializers like `IntSerializer` and `ArrayListSerializer`. 912They were replaced with constructor-like factory functions. 913 - `SerialClassDescImpl` creation class replaced with `SerialDescriptor` 914builder function to ease writing of custom serializers and maintain `SerialDescriptor` contract. 915 - Internal utilities, like HexConverter and ByteBuffer, were deprecated as not relevant to serialization public API. 916 - Add-on formats like Protobuf, CBOR and Properties (formerly Mapper) 917are now extracted to [separate artifacts](formats/README.md#protobuf) to keep the core API lightweight. 918 919We have spent a lot of effort into the quality, 920documenting most of the core interfaces, establishing their contracts, 921fixing numerous of bugs, and even introducing new features that may be useful for those of you who 922write custom serializers — see [JsonTransformingSerializer](docs/json_transformations.md). 923 924Such API changes, of course, may be not backwards-compatible in some places, in particular, between compiler plugin and runtime. 925Given that the library is still is in the experimental phase, we took the liberty to introduce breaking changes in order to give users 926the better, more convenient API. Therefore, this release has number `0.20.0` instead of `0.15.0`; 927Kotlin 1.3.70 is compatible _only_ with this release. 928 929To migrate: 9301. Replace `import kotlinx.serialization.internal.*` with `import kotlinx.serialization.builtins.*`. 931This action is sufficient for most of the cases, except primitive serializers — instead of using `IntSerializer`, use `Int.serializer()`. 932For other object-like declarations, you may need to transform it to function call: `ByteArraySerializer` => `ByteArraySerializer()`. 933 9342. Pay attention to the changed `JsonConfiguration` constructor arguments: instead of `strictMode`, 935now three different flags are available: `ignoreUnknownKeys`, `isLenient`, and `serializeSpecialFloatingPointValues`. 936 9373. If you used formats other than JSON, make sure you've included the corresponding artifact as dependency, 938because now they're located outside of core module. See [formats list](formats/README.md) for particular artifact coordinates. 939 9404. Other corresponding deprecation replacements are available via standard `@Deprecated(replaceWith=..)` mechanism. 941(use Alt+Enter for quickfix replacing). 942 943### Full changelog (by commit): 944 945 * This release is compatible with Kotlin 1.3.70 946 * Rework polymorphic descriptors: polymorphic and sealed descriptor elements are now aligned with an actual serialization process (#731) 947 * Hide internal collection and map serializers 948 * Introduce factories for ArraySerializers as well, deprecate top-level array serializers 949 * Extract ElementValue encoder and decoder to builtins and rename it to AbstractEncoder and AbstractDecoder respectively 950 * Hide as much internal API as possible for collections. Now ListSerializer(), etc factories should be used 951 * Replace top-level primitive serializers with corresponding companion functions from builtins 952 * Move Tagged.kt to internal package 953 * Hide tuple serializers from the public usages and replace them with factory methods in builtins package 954 * Deprecate top-level format instances, leave only companion objects 955 * Document contracts for JsonInput/JsonOutput (#715) 956 * Ensure that serialization exception is thrown from JSON parser on invalid inputs (#704) 957 * Do best-effort input/output attach to exceptions to simplify debugging 958 * JSON configuration rework: strictMode is splitted into three flags. 959 * Make strictMode even more restrictive, prohibit unquoted keys and values by default, always use strict boolean parser (#498, #467) 960 * Preserve quotation information during JsonLiteral parsing (#536, #537) 961 * Change MapEntrySerializer.descriptor to be truly map-like. Otherwise, it cannot be properly serialized by TaggedDecoder (-> to JsonObject) 962 * Cleanup ConfigParser: move to proper package to be consistent with other formats 963 * Support primitive and reference arrays in serializer(KType) 964 * Add option to use HOCON naming convention 965 * Allow DynamicObjectParser to handle polymorphic types (array-mode polymorphism only) 966 * Get rid of PrimitiveKind.UNIT and corresponding encoder methods. Now UNIT encoded as regular object. 967 * JsonParametricSerializer and JsonTransformingSerializer implementation 968 * Remove AbstractSerialFormat superclass since it is useless 969 * Deprecate most of the functions intended for internal use 970 * Document core kotlinx.serialization.* package 971 * Introduce UnionKind.CONTEXTUAL to cover Polymorphic/Contextual serializers, get rid of elementsCount in builders 972 * SerialDescriptor for enums rework: now each enum member has object kind 973 * Introduce DSL for creating user-defined serial descriptors 974 * Update README with Gradle Kotlin DSL (#638) 975 * Fix infinite recursion in EnumDescriptor.hashCode() (#666) 976 * Allow duplicating serializers during SerialModule concatenation if they are equal (#616) 977 * Rework sealed class discriminator check to reduce the footprint of the check when no JSON is used 978 * Detect collisions with class discriminator and for equal serial names within the same sealed class hierarchy (#457) 979 * Detect name conflicts in polymorphic serialization during setup phase (#461, #457, #589) 980 * Extract all mutable state in modules package to SerialModuleBuilder to have a single mutable point and to ensure that SerialModule can never be modified 981 * Omit nulls in Properties.store instead of throwing an exception 982 * Add optionals handling to Properties reader (#460, #79) 983 * Support StructureKind.MAP in Properties correctly (#406) 984 * Move Mapper to separate 'properties' module and rename it to Properties 985 * Reified extensions for registering serializers in SerialModule (#671, #669) 986 * Promote KSerializer.nullable to public API 987 * Object serializer support in KType and Type based serializer lookups on JVM (#656) 988 * Deprecate HexConverter 989 * Supply correct child descriptors for Pair and Triple 990 * Rename SerialId to ProtoId to better reflect its semantics 991 * Support of custom generic classes in typeOf()/serializer() API (except JS) 992 * Allow setting `ProtoBuf.shouldEncodeElementDefault` to false (#397, #71) 993 * Add Linux ARM 32 and 64 bit targets 994 * Reduce number of internal dependencies: deprecate IOException, mark IS/OS as internal serialization API (so it can be removed in the future release) 995 * Reduce number of internal dependencies and use bitwise operations in ProtoBuf/Cbor instead of ByteBuffer. Deprecate ByteBuffer for removal 996 * Extract ProtoBuf & CBOR format to the separate module 997 * READ_ALL rework (#600) 998 * SerialDescriptor API standartization (#626, #361, #410) 999 * Support polymorphism in CBOR correctly (fixes #620) 1000 * Add forgotten during migration WASM32 target (#625) 1001 * Fix exception messages & typos in JsonElement (#621) 1002 1003v0.14.0 / 2019-11-19 1004================== 1005 1006 * Bump version to 0.14.0 @ Kotlin 1.3.60 1007 * Add empty javadoc artifact to linking with Maven Central 1008 * Mark more things as @InternalSerializationApi. 1009 * Support @SerialId on enum members in protobuf encoding 1010 * Move Polymorphic and sealed kinds from UnionKind to special PolymorphicKind 1011 * Sealed classes serialization & generated serializers for enum classes (@SerialInfo support) 1012 * Objects serialization 1013 * Don't use deprecated UTF8<>ByteArray conversions in Native 1014 * Improve error message when static non-generic serializer can't be found 1015 * Support optional values for typesafe config format 1016 1017v0.13.0 / 2019-09-12 1018================== 1019 1020 * Add mingwX86 target (#556) 1021 * Replace KClass.simpleName with artificial expect/actual with java.lang.Class.simpleName on JVM to overcome requirement for kotlin-reflect.jar (#549) 1022 * Update Gradle to 5.6.1 (therefore Gradle metadata to 1.0) 1023 * Fix incorrect index supply during map deserialization when READ_ALL was used (#526) 1024 * Serializers for primitive arrays (ByteArray etc) 1025 * Hide NullableSerializer, introduce '.nullable' extension instead 1026 * Fix the library to not create a stack overflow exception when creating a MissingDescriptorException. (#545) 1027 1028v0.12.0 / 2019-08-23 1029================== 1030 1031 * Set up linuxArm32Hfp target (#535) 1032 * wasm32 is added as a build target (#518) 1033 * MPP (JVM & Native) serializer resolving from KType (via typeOf()/serializer() function) 1034 * Support maps and objects decoding when map size present in stream (fix #517) 1035 * Add proper SerialClassDescImpl.toString 1036 * Make JSON parser much more stricter; e.g. Prohibit all excessive separators in objects and maps 1037 * Robust JsonArray parsing 1038 * Improve json exceptions, add more contextual information, get rid of obsolete exception types 1039 * Prohibit trailing commas in JSON parser 1040 * Make the baseclass of the polymorphic serializer public to allow formats (#520) 1041 * Fix decoding for ProtoBuf when there are missing properties in the model. (#506) 1042 * Rework JsonException and related subclasses 1043 * Fix #480 (deserialization of complex map keys). Add tests for structured map keys in conjuction with polymorphism 1044 * Implement 'allowStructuredMapKeys' flag. Now this flag is required for serializing into JSON maps which keys are not primitive. 1045 1046v0.11.1 / 2019-06-19 1047================== 1048 1049 * Fixed some bugs in compiler plugin for Native (#472, #478) (Kotlin 1.3.40 required) 1050 * Remove dependency on stdlib-jvm from common source set (Fixes #481) 1051 * Fix @UseSerializers argument type and clarify some docs 1052 * Support primitives (ints, strings, JsonLiterals, JsonNull, etc) on a top-level when saving/restoring JSON AST (#451) 1053 * Migrate to the new (Kotlin 1.3) MPP model 1054 * Add @SharedImmutable to default json module. Fixes #441 and #446 1055 1056v0.11.0 / 2019-04-12 1057==================== 1058 1059#### Plugin: 1060 1061 * **Semantic change**: Now properties with default values are @Optional by default, and properties without backing fields are @Transient by default. 1062 * Allow '@Serializable' on a type usage (fixes #367) 1063 * Auto-applying @Polymorphic for interfaces and serializable abstract classes 1064 * Do not enable PolymorphicSerializer without special annotation 1065 * Fix missing optionality of property when generating descriptor in Native 1066 * Fix impossibility to make @Optional field in a class hierarchy on JS 1067 * Add synthetic companion with .serializer() getter even if default serializer is overridden. (fixes #228) 1068 * Ban primitive arrays in JVM codegen too (fixes #260) 1069 * Don't generate writeSelf/internal constructor if corresponding serialize/deserialize aren't auto-generated 1070 * Support Serializable class hierarchies on Native and JS 1071 * Replace @Optional with @Required 1072 * Support classes with more than 32 serializable properties (fixes #164) 1073 * Make enums and interfaces not serializable internally. However, they still can be serialized using custom companion object. Fixes #138 and #304 1074 1075#### Runtime: 1076 * Introduce JsonBuilder and JsonConfiguration as a better mechanism for configuring and changing configuration of the JSON 1077 * Implement polymorphic serialization in JSON using class discriminator key 1078 * Force quoting for map keys (fixes #379) 1079 * Fix bug with endianness in Native for Longs/Doubles 1080 * Do not allow to mutate SerialModule in formats 1081 * Implement multiplatform (JVM, JS and Native) PolymorphicSerializer 1082 * Remove obsolete and poorly designed global class cache. Remove JVM-only PolymorphicSerializer 1083 * Replace old SerialModule with new one which: - Can not be installed, should be passed in format constructor - Has polymorphic resolve and contextual resolve - Has DSL for creation - Immutable, but can be combined or overwritten 1084 * Improve error message for unknown enum constant 1085 * Deprecate @Optional, introduce @Required 1086 * Use long instead of int in JsonLiteralSerializer 1087 * Json and protobuf schemas recording prototype 1088 * Change JsonObject so it would comply to a Map interface: .get should return null for a missing key Incompatibility with standard Map contract may bring a lot of problems, e.g. broken equals. 1089 * Make JsonElementSerializer public 1090 10910.10.0 / 2019-01-22 1092================== 1093 1094 * Migrate to Gradle 4.10 and metadata 0.4 1095 * Update to 1.3.20 1096 * Reorder Json parameter for consistency 1097 * Make JsonElement.toString() consistent with stringify (#325) 1098 * Reader.read(): Int should return -1 on EOF. 1099 * Optimize the Writer.write(String) case. 1100 * Update the docs with new annotations 1101 11020.10.0-eap-1 / 2018-12-19 1103================== 1104 1105#### Plugin: 1106 1107 * Support @SerialInfo annotation for Native 1108 * Remove redundant check for 'all parameters are properties' in a case of fully-customized serializer. 1109 * Fix unresolved symbol to SerialDescriptor in KSerializer if it was referenced from user custom serializer code (#290) 1110 * Support for @UseSerializers annotation 1111 * Restrict auto-implementing serializers methods to certain type of classes 1112 * Increase priority of overridden serializer on type (#252) 1113 * Fix instantiation of generic serializers on JS (#244) 1114 * .shouldEncodeElementDefault for JVM (#58) 1115 * Support skipping values equals to defaults in output stream for JS and Native backends (#58) 1116 * Support enums in Native 1117 * Support reference array and context serializers in Native 1118 * Fix order of overriding @Serializable(with) on property: check override, than @ContextualSerialization. 1119 * Support @Transient properties initializers and init blocks in Native 1120 * Better lookup for `serializer()` function in companion for generic classes because user can define a parameterless shorthand one (#228) 1121 * Generics serialization in Native 1122 * .getElementDescriptor for JVM, JS and Native 1123 * Respect @ContextualSerialization on file 1124 * Remove auto-applying ContextSerializer. @ContextualSerialization should be used instead. 1125 1126#### Runtime: 1127 1128 * Turn around messed endianness names (#308) 1129 * Update to Kotlin 1.3.20 EAP 2 1130 * Get rid of protobuf-platform functions since @SerialInfo annotations are supported now. Auto-assign ids starting with 1 because 0 is not a valid protobuf ID. 1131 * Delegates `equals`, `hashCode` of `JsonObject` and `JsonArray`. 1132 * Test for fixed #190 in plugin 1133 * UseSerializers annotation 1134 * Introduce LongAsStringSerializer 1135 * Add validation for parsing dynamic to Long Fixes #274 1136 * Merge pull request #294 from Kotlin/recursive_custom_parsing 1137 * Fix recursive serialization for JsonOutputs/Inputs 1138 * Production-ready JSON API 1139 * Remove ValueTransformer 1140 * Json improvements 1141 * @Serializable support for JsonArray 1142 * @Serializable support for JsonObject 1143 * @Serializable support for JsonNull and JsonPrimitive 1144 * Hide JsonTreeParser, provide Json.parseJson as replacement, implement basic JsonElementSerializer.deserialize 1145 * Migrate the rest of the test on JsonTestBase, implement nullable result in tree json 1146 * Implement custom serializers support for TreeJsonInput 1147 * Implement JsonArray serialization 1148 * Implement strict mode for double in TreeJsonOutput (fixes JsonModesTest) 1149 * Introduce JsonTestBase in order to ensure streaming and tree json compatibility, transient and strict support in TreeJsonInput 1150 * Make JsonElement serializable via common machinery 1151 * Json rework, consolidate different parsing mechanisms, hide implementation details 1152 * Polymorphic serializer improvements 1153 * Renamed identifiers to align with Kotlin's coding conventions. https://kotlinlang.org/docs/reference/coding-conventions.html#naming-rules 1154 * Changed JSON -> Json and CBOR -> Cbor 1155 1156v0.9.1 / 2018-11-19 1157================== 1158 1159 * Update lib to 0.9.1/Kotlin to 1.3.10 1160 * Make some clarifications about Gradle plugin DSL and serialization plugin distribution 1161 * Primitive descriptor with overriden name 1162 * Add missing shorthands for float and char serializers (Fixes #263) 1163 * Fix bug where primitive non-string values created by hand and created by parser could be inequal due to a redundant type comparison. 1164 * Don't look at default serializer too early during reflective lookup (Fixes #250) 1165 1166v0.9.0 / 2018-10-24 1167================== 1168 1169 * Fix bug where `.simpleName` was not available for primitives' KClasses. 1170 * Improve Mapper: it is now a class (with default instance in Companion) which extends AbstractSerialFormat and therefore have context and proper reflectionless API. 1171 * Introduce @ImplicitReflectionSerializer for API which involves reflection. 1172 * Add Boolean.Companion.serializer() extension method. 1173 * Refactor surface API: introduce interfaces for different formats, move some inline functions for serialization start to extensions. As a minor change, now nulls can be serialized at top-level, where it is supported by the format. 1174 * Add AbstractSerialFormat as a base class to all major formats 1175 * Update general readme and versions: Library to 0.9, K/N to 1.0 beta 1176 * Update documentation for the new API 1177 * Updated info about eap13 releases 1178 1179v0.8.3-rc13 / 2018-10-19 1180================== 1181 1182 * Set default byte order to BigEndian (to be more platform-independent and get rid of posix.BYTE_ORDER dependency) 1183 * Update Kotlin version to 1.3-RC4 1184 * Remove Gradle metadata from non-native modules 1185 * Add missing targets (Fixes #232) 1186 * Add license, developer and scm information in Maven pom in publication (Fixes #239) 1187 * Add builder for JsonArray 1188 * Redesign and unify exceptions from parsers (Fixes #238) 1189 * Move json parser back to monolith module (drops `jsonparser` artifact) 1190 * Little improvement of error messages 1191 > Not working until plugin is updated: 1192 * Initial support for skipping defaults: JSON 1193 * Replace choicesNames to Array to be easily instantiated from generated IR 1194 1195v0.8.2-rc13 / 2018-10-03 1196======================== 1197 1198 * Update to RC-3 1199 * Add @SharedImmutable from K/N to some global declarations in JSON parser, so it is now accessible from multiple workers (Fixes #225) 1200 > Not working until plugin is updated: 1201 * Tests for generic descriptors 1202 * Generated serializer and stuff for providing descriptors from plugin 1203 * Tests on @ContextualSerialization on file 1204 1205v0.8.1-rc13 / 2018-09-24 1206======================== 1207 1208 * Upgrade Kotlin/Native version 1209 1210v0.8.0-rc13 / 2018-09-19 1211======================== 1212 1213 * Add (currently) no-op annotations to the kibrary for smoother migration 1214 * Update migration guide and versions to RCs. 1215 * Support WildcardType in serializerByTypeToken (#212) 1216 > Not working until plugin is updated: 1217 * Added experimental support of reference arrays for Native 1218 1219v0.7.3-eap-13 / 2018-09-18 1220========================== 1221 1222 * New enum serializing model 1223 * New context: SerialModules draft. Renaming and mutable/immutable hierarchy 1224 * Remove untyped encoding 1225 * Improve serializers resolving by adding primitive serializers. Also add some helper methods to JSON to serialize lists without pain 1226 * Fix protobuf by adapting MapLikeSerializer to HashSetSerializer(MapEntrySerializer). Elements' serializers in collection serializers are now accessible for such adaptions. 1227 * Prohibit NaN and infinite values in JSON strict mode 1228 * Cleanup JSON, reflect opt-in strict mode in naming 1229 * Get rid of StructureKind.SET and StructureKind.ENTRY 1230 * Remove SIZE_INDEX 1231 * Remove inheritance from Encoder and CompositeEncoder 1232 * Working over primitive kinds and enums 1233 * Reworked SerialDescriptor and kinds 1234 * Renaming of ElementValue* and Tagged* 1235 * Renaming: KOutput -> Encoder/CompositeEncoder KInput -> Decoder/CompositeDecoder 1236 * Renaming: KSerialClassDesc -> SerialDescriptor SerialSaver, SerialLoader -> *Strategy 1237 > Not working until plugin is updated: 1238 * Provide limited `equals` on collections' descriptors 1239 * Support for `isElementOptional` 1240 1241v0.6.2 / 2018-09-12 1242=================== 1243 1244 * Updated Kotlin to 1.2.70 and Kotlin/Native to 0.9 1245 1246v0.6.1 / 2018-08-06 1247=================== 1248 1249 * Compatibility release for 1.2.60 1250 * Don't throw NoSuchElement if key is missing in the map in `Mapper.readNotNullMark`, 1251 because tag can be only prefix for nested object. Fixes #182 1252 * Update ios sample with latest http client 1253 1254v0.6.0 / 2018-07-13 1255=================== 1256 1257 Plugin: 1258 1259 * Allow @SerialName and @SerialInfo on classes 1260 * Fix resolving serializers for classes from other modules (#153 and #166) 1261 1262 Runtime: 1263 1264 * Use new 0.8 K/N DSL 1265 * Simplify JSON AST API, Provide JSON builder, provide useful extensions, add documentation, update K/N 1266 * Get rid of JsonString to align json primitives with each other. Provide JSON AST pojo parser which exposes current design issues 1267 * [JSON-AST] Introduce non-nullable methods throwing exceptions for getting json elements 1268 * [JSON-AST] Add ability to parse JSONInput element as tree. Symmetric functionality for JsonOutput + JsonTree 1269 * [JSON-AST] Docs writeup 1270 * [JSON-AST] Publishing native artifact on bintray 1271 * [JSON-AST] Saving AST back to JSON 1272 * [JSON-AST] JsonAstMapper to serializable classes 1273 * Remove annoying "for class class" message in not found serializer exception 1274 * Introduce module for benchmarks 1275 * Add notes about snapshot versions 1276 * Tests for bugs fixed in latest published plugin (#118 and #125) 1277 * Auto-assign proto ids using field index 1278 1279v0.5.1 / 2018-06-13 1280=================== 1281 1282 Plugin: 1283 1284 * Fix 1.2.50 compatibility 1285 * Workaround for recursive resolve on @Serializable(with) and @Serializer(for) pair annotations 1286 * Don't generate additional constructor if @SerialInfo has no properties 1287 * Fix order of resolving serializers: user-overriden should go before polymorphic and default 1288 * While creating descriptors, add type arguments not from serializable class definition but from actual KSerializer implementation. This provides better support for user-defined or external generic serializers 1289 * Don't generate constructor for passing generic serializers if user already defined proper one. 1290 * Respect `@Serializable(with)` on properties on JS too. 1291 * Fix for Kotlin/kotlinx.serialization/136 1292 * Fix for Kotlin/kotlinx.serialization/125 1293 * Fix for Kotlin/kotlinx.serialization/118 1294 * Fix for Kotlin/kotlinx.serialization/123: resolve annotation parameters in-place 1295 1296 Runtime: 1297 1298 * Added some shorthands for standard serializers 1299 * Fix for bug #141 that uses an extra boolean to determine whether to write a separating comma rather than assuming that the element with the index 0 is written first(or at all) in all cases. 1300 * Move mode cache to output class to make .stringify stateless and thread-safe (#139) 1301 * Bugfix #95: Can't locate default serializer for classes with named co… (#130) 1302 * Updated versions in docs and examples Add changelog 1303 1304v0.5.0 / 2018-04-26 1305=================== 1306 1307 * Improve buildscript and bumped kotlin version to 1.2.40 1308 * Remove code warnings 1309 * Add note about different IDEA plugin versions 1310 * Add null check to Companion when looking up serializer. 1311 * Improved performance of JSON.stringify 1312 * Improved performance of JSON.parse 1313 * Added compatibility note 1314 * Fix #107 and #112. #76 awaits next compiler release. 1315 1316v0.4.2 / 2018-03-07 1317=================== 1318 1319 * Update runtime library version to match plugin version. Update examples to use latest version of compiler, plugin and runtime. Update Gradle to run on build agents with Java 9. 1320 * Fix ProGuard rules docs for serialization of classes with generic types 1321 * Fix ProGuard rules docs for serialization 0.4.1 version 1322 * Add support for @Serializable classes that are private and live out of kotlinx.serialization package. In such case the Companion field is not visible and must be set accessible before use. 1323 * update jvm-example to latest versions 1324