How to parse the different type of json

Viewed 31

When I call an api with specific parameter, I get a json like this:

{
“name”:“my name”,
“family”:”my family”
},
{
“name”:“my name1”,
“family”:”my family1”
}

But when I call same api with different parameter I get same JSON but with the different type for example an empty array :

[]

How can create a data model for this type of response in kotlin?

0 Answers
Related