0

How to parse json with variable keys the root of json using retrofit.

In the retrofit class that maps the response i defined a Map<String, DateObject> but didn't use @SerializedName since i don't know the key.

This is the json im trying to parse:

{
    "2017-04-01": [{...}, {...}, {...}],
    "2017-04-02": [{...}],
    "2017-04-03": []
}
Lyubomyr Shaydariv
  • 20,327
  • 12
  • 64
  • 105
nysertxs
  • 73
  • 2
  • 7

1 Answers1

1

so i solved it with this method in the retrofit interface:

Observable<Map<String, List<Value>>> getMap();

and no need to create a manual parser

nysertxs
  • 73
  • 2
  • 7