I have the json:
{"test": [{"param1": "param"}],
"test2": "test",
"test3": "test2"}
how can I get fromGson to parse the arrays in a json correctly so that it populates the arrays into an array of a particular object type.
So test should map to TestObject[] test;
test2 -> String test2;
test3 -> String test3;
I tried gson.fromJson(response, TestData.class);
that gave me an error: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected a string but was BEGIN_OBJECT at line 1 column 664
( that the fromJson is not parsing the array in the json correctly).
I also tried going through this post: Parsing JSON array into java.util.List with Gson
But got confused.
but that did not work