I have tried to parse this json
{"status":"ok","results":{"query":{"id":"6081","name":"UB1656-Palazzo Versace Resort in Culture Village","query":"Aswathy VS : <\/strong>
Test Query","add_date":"2014-08-05 08:27:45"},"replies":[{"replied_by":"Ventures Onsite","replied_on":"05-Aug-2014 09:05:19 AM","reply":"We have received your Test Query."},{"replied_by":"Me","replied_on":"05-Aug-2014 01:28:00 PM","reply":"Thanks... "}]}}
My Pojo classs
import java.util.ArrayList;
public class QueryRepliesList {
public String status;
public ArrayList<Result> results;
public class Replies {
public String id;
public String name;
public String query;
public String add_date;
public String replied_by;
public String replied_on;
public String reply;
}
public class Result {
public ArrayList<Replies> query;
public ArrayList<Replies> replies;
}
}
I trie dto call this by
QueryRepliesList queryReply = gson.fromJson(reader,
QueryRepliesList.class);
But i got the following exception
Caused by: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected a string but was BEGIN_OBJECT
I tried by changing
the Pojo class several times as suggested by similar answer to the questions But nothing worked Please some one help Thanks in advance
resultsas a collection but thejsoncontains an object.