Hi all, I am deserializing a big json structure an...
# serialization
s
Hi all, I am deserializing a big json structure and one of the child object is throwing a JsonDecodingException, thus the serialization process is not returning anything. Is it possible to configure kotlin serialization to continue the serialization process even if one of the child objects is erroneous?
d
Not really, if the JSON invalid then how can it proceed?
b
What makes the child object erroneous? Like is it a missing field, invalid JSON, etc.
s
In this case I was expecting a non nullable field and was receiving null. I thought there could be something that could set the child object null and continue with the deserialization.
d
Ah, valid json. That's fixable then.
You'll have to write a small custom serializer for the child object.