Thread
#serialization
    l

    LastExceed

    6 months ago
    i need to decode a json string with a weird quirk. lists with only 1 entry omit the
    []
    as if it was just a simple property of the inner type. eg
    x = listOf("foo", "bar")
    is serialized as
    "x": ["foo", "bar"]
    (as expected), but
    x = listOf("foo")
    is serialized as
    "x": "foo"
    instead of
    "x": ["foo"]
    . this breaks the parser, because it sees a
    x: String
    property where
    x: List<String>
    is expected. how do i work around this?