How can I parse this json via Gson?
Here is my PodModel.class
And this is my for retrieve the json.
This is the gson part.
gson = new Gson();
PodsModel pods = gson.fromJson(builder.toString(), PodsModel.class);
System.out.println(pods.getPods().getDomain());
Logcat returns with this: logcat-output
It seems, that
Gsonfailed here:This
[is unexpected because in your modelPodModelpodsfield is plain field, not an array.May be you have to change
podsto by an array, and in this case you will be able to parse suchjson.UPD: Just change
podsdefinition to this one:private List<ItemPod> pods;This solution should work (tested).