Thread
#serialization
    Dominaezzz

    Dominaezzz

    3 years ago
    I have
    data class Request(val mode: String = "default", val extra: String? = null)
    , this produces
    { "mode": "default", "extra": null }
    . Can I get it to omit the field entirely instead of setting it to
    null
    ?
    Json(encodeDefaults = false)
    it seems.
    gildor

    gildor

    3 years ago
    hmmm, it’s really strange, looks like a bug, it shouldn’t encode null as string
    "null"
    Dominaezzz

    Dominaezzz

    3 years ago
    Oops, my bad. 😅