3 years ago
    📣 Serialization v
    (dev branch) has just been released! This is a companion release to Kotlin
    Highlights: • Now Native plugin supports generics, @SerialInfo annotations and other features that were missing before • Now
    is working and one can use it to deeply inspect descriptors tree • JSON now can omit default values • (breaking change) Context serializer is not enabled automatically anymore, use
    on property. Full changelog: https://github.com/Kotlin/kotlinx.serialization/blob/dev/CHANGELOG.md
    Jonas Bark

    Jonas Bark

    3 years ago
    regarding the "omit default values": when I have a simple class like this: @Serializable data class Test(val name: String? = null) then Json(encodeDefaults = false).stringify(Test.serializer(), testInstance) should print out "{}"? This doesn't seem to work for me
    got it - name needs to have @Optional. The documentation of @Optional got me confused 🙂