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
Dominaezzz
06/18/2021, 11:17 AM
Not really, if the JSON invalid then how can it proceed?
b
Ben Woodworth
06/18/2021, 7:18 PM
What makes the child object erroneous? Like is it a missing field, invalid JSON, etc.
s
sendoav
06/18/2021, 7:26 PM
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
Dominaezzz
06/18/2021, 8:25 PM
Ah, valid json. That's fixable then.
Dominaezzz
06/18/2021, 8:26 PM
You'll have to write a small custom serializer for the child object.