0

i am having troubles in parsing an object that containes LinkedTreeMap inside an ArrayList i loaded an image from the response that shows the object structureenter image description here

i am using retrofit and the parser is Gson

my objects looks like this:

data class MainResponse(val list:ArrayList<Contacts>)

data class Contacts(var contacts: LinkedTreeMap<String, String>)

@POST("load/")
fun getList(@Body req:Request): Observable<Response<MainResponse>>
Kinjal
  • 327
  • 2
  • 11
Ori Joseph
  • 13
  • 4
  • You need to provide input `JSON` and `Java` model you created. Similar questions: [Problem in parsing multiple json objects each having multiple Arrays from a validated JSON format-JavaString](https://stackoverflow.com/questions/55154226/problem-in-parsing-multiple-json-objects-each-having-multiple-arrays-from-a-vali), [GSON: JSON deserialization to variable type (List/String)](https://stackoverflow.com/questions/55167856/gson-json-deserialization-to-variable-type-list-string), [Mapping Json Array to Java Models](https://stackoverflow.com/questions/55098886/mapping-json-array-to-java-models) – Michał Ziober Mar 15 '19 at 08:06
  • Try with `data class MainResponse(val list:List>)`. Probably `JSON` payload do not include `contacts` property. – Michał Ziober Mar 15 '19 at 09:43

0 Answers0