I use kotlinx.serialization
library to serialize/deserialize JSONs. There is a JSON string:
{"id":"1"}
that can be also represented as
{"uid":"1"}
And I want to handle both names with one property, e.g.:
@Serializable
data class User(val id: String)
Is it possible to parse both JSONs using only one data
class and its property?