I am finding it difficult to model the API response to my schema . I have an API which gives me a list of items and its corresponding codes(API 1). In the second API I have an array of items which contains objects which refer to the codes (API 2) . API 1 structure
Animal types
[
{
"name": "Cat",
"code": "ct"
},
{
"name": "Dog",
"code": "dg"
},
{
"name": "Eagle",
"code": "eg"
}
]
and API 2 structure is Animals List
[
{
"id": 1,
"label_ct": "Lets go cats",
"label_dg": "Lets go dogs"
},
{
"id": 2,
"label_dg": "Soaring dogs",
"label_eg": "Soaring eagles"
},
{
"id": 3,
"label_ct": "Hungry cat",
"label_eg": "Hungry eagle"
},
{
"id": 4,
"label_eg": "Lazy Eagle",
"label_dg": "Lazy Dog"
}
]
I basically need some way to dynamically add columns to the Animal List scheme depending upon the response of the Animal types API response . I already tried saving the objects in the Animal list as a string but its throwing errors