Hi, is there a way for a class with defaults to de...
# serialization
m
Hi, is there a way for a class with defaults to decode different structure based on the default value missing? For example:
data class Test(val name: String, val age: Int = 0)
to match both
{"name":"mark", "age":30}
and
"mark"
? Or as a value of another class:
Copy code
{
  "test": "mark"
}

{
  "test": {
    "name": "mark",
    "age": 30
  }
}