问题描述:

I am getting the list of all the available categories from a merchant site using their api.The response json string will give all the categories in a single response without page numbers..When I try to convert the json response string into a java object I get.

com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Expected EOF at line 1 column 11

This is what I have done.

String jsonResponse = restHandler.executeAPI("taxonomy");

System.out.println(jsonResponse);

System.out.println(jsonResponse);

Gson gson = new Gson();

JsonParser parser = new JsonParser();

JsonArray jArray = parser.parse(jsonResponse).getAsJsonArray();

Can anyone tell me how to get all the categories in a single response .So that I will not get the above exception.

相关阅读:
Top