kotlinx.serialization v0.11.0 Release Notes

Release Date: 2019-04-12 // about 1 year ago
  • 🔌 Plugin:

    • Semantic change: Now properties with default values are @Optional by default, and properties without backing fields are @Transient by default.
    • Allow '@Serializable' on a type usage (fixes #367)
    • Auto-applying @Polymorphic for interfaces and serializable abstract classes
    • Do not enable PolymorphicSerializer without special annotation
    • Fix missing optionality of property when generating descriptor in Native
    • Fix impossibility to make @Optional field in a class hierarchy on JS
    • Add synthetic companion with .serializer() getter even if default serializer is overridden. (fixes #228)
    • Ban primitive arrays in JVM codegen too (fixes #260)
    • Don't generate writeSelf/internal constructor if corresponding serialize/deserialize aren't auto-generated
    • Support Serializable class hierarchies on Native and JS
    • Replace @Optional with @Required
    • Support classes with more than 32 serializable properties (fixes #164)
    • Make enums and interfaces not serializable internally. However, they still can be serialized using custom companion object. Fixes #138 and #304

    ⚙ Runtime:

    • Introduce JsonBuilder and JsonConfiguration as a better mechanism for configuring and changing configuration of the JSON
    • Implement polymorphic serialization in JSON using class discriminator key
    • Force quoting for map keys (fixes #379)
    • Fix bug with endianness in Native for Longs/Doubles
    • Do not allow to mutate SerialModule in formats
    • Implement multiplatform (JVM, JS and Native) PolymorphicSerializer
    • Remove obsolete and poorly designed global class cache. Remove JVM-only PolymorphicSerializer
    • 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
    • Improve error message for unknown enum constant
    • Deprecate @Optional, introduce @Required
    • Use long instead of int in JsonLiteralSerializer
    • Json and protobuf schemas recording prototype
    • 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.
    • Make JsonElementSerializer public