Hi :wave: We have an api that can return ```{ "num...
# serialization
r
Hi 👋 We have an api that can return
Copy code
{
  "number": 100
}
or
Copy code
{
  "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
e
Create a
JsonTransformingSerializer
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
🎉 1
❤️ 1