List of strings to List of strings in App State

An API call returns a JSON array in this format

[
  {
    "title": "some title",
    "summary": "some summary",
    "labels": ["label 01", "label 02"]
  },
  .
  .
]

There is an date type to map exactly to the each item in the list:

  • title: String

  • summary: String

  • labels: String<list>

The response is sent to a custom function to convert it to List struct. afterwards, a loop create the new app state with the data type mentioned above. The mapping works fine with everything, except with labels. Somehow it combines all the labels in the response, and add them to each instance of the data type.

I tried every possible way. either I get combined or error.

Is there a way to sort this out?

1