Rafal
12/01/2021, 1:10 PM{
"number": 100
}
or
{
"number": "none"
}
depending on some conditions, how can I parse this kind of json if I want to have number: Int?
as a result? If the json responds a String
I wan’t the number to be null
Emil Kantis
12/01/2021, 1:13 PMJsonTransformingSerializer
that replaces "none"
with null
and delegate to a standard serializer afterwards 🙂
https://github.com/Kotlin/kotlinx.serialization/blob/master/docs/json.md#json-transformations