I tried to parse JSONArray to pojoclass, using GSON, but I got errors and don't know where the point of failure is. Here my JsonArray:
[{"_id":"5829fce93c67d915b82cb93d","content":[{"content1":"first textcontent"},{"image1":"link to image"},{"content2":"second contenttext"}],"shortDescription":"really short","name":"first tutorial","__v":0,"updated":"2016-11-14T18:05:29.540Z","created_at":"2016-11-14T18:05:29.540Z","total_clicks":0,"likes":0,"community":{"area":"MVVM","name":"Android","id":1},"author":{"author_email":"me@me.de","author_name":"Me me","author_id":6}}]
I want something like this:
Content c1 = gson.fromJson(response.toString(), Content.class);
But I get this error:
com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 2 path $
I would be glad for any help.