Reputation: 315
Is it possible to change field name in Kotlin runtime? I need change filed name in my json serializator for use fild with dots (for example: "fields.field":"value"
)
Upvotes: 1
Views: 436
Reputation: 94
What serializator are you using? In most cases it can be done using annotations. Using Moshi you can do it like that:
class SomeClass(
@field:Json(name = "newPropertyName")
var someProperty: String
)
Upvotes: 1