The request body you posted doesn't match the class
Change the request body structure to:
"phone": "+1 11111111",
Since you can't update the request structure, your other option is to change the class structure by creating two classes as below:
class PersonRequest(var fields: List<Field>)
class Field(var id: String, var value:Any)
The last step, which is optional based on your requirement, is that you can manipulate the
PersonRequest class now and convert it to any other class using normal setters/getters.
To convert the
PersonRequest, you could do it like this:
val personRequest = PersonRequest()
"name" -> personRequest.name = it.value
"phone" -> personRequest.phone = it.value
"birthday" -> personRequest.birthday = it.value
Not the neatest of codes, but...