Is there any way to treat `null` in JSON as absent...
# serialization
a
Is there any way to treat
null
in JSON as absent? I have a
val foo: List<String> = emptyList()
which fails to be parsed if
foo
is
null
in the JSON
3
d
Custom encoder.
a
I thought about that but since I couldn’t find a
peek
or similar on
Decoder
I don’t know how I would check if it’s null
d
There are two ways around this. Use the new
NullableSerializer<T>
or use
decodeJson
and eagerly parse the json manually.
The first being the preferable option.