Разбираю json возвращаемый api методов vk.com wall.get
https://vk.com/dev/wall.get?params[owner_id]=-1636...
Создал POJO помощью сайта:
www.jsonschema2pojo.org
Родитель:
public class ResultObject extends ArrayList {
@SerializedName("response")
@Expose
private Response response;
public Response getResponse() {
return response;
}
public void setResponse(Response response) {
this.response = response;
}
}
Как дальше распарсить и получить данные? Выдает ошибку:
Gson gson = new Gson();
ResultObject resultObject = gson.fromJson(result, ResultObject.class);
Структура json:
{
"response": {
"count": 1,
"items": [{
"id": 1,
"from_id": -163637512,
"owner_id": -163637512,
"date": 1521195983,
"marked_as_ads": 0,
"post_type": "post",
"text": "",
"attachments": [{
"type": "photo",
"photo": {
"id": 456239017,
"album_id": -6,
"owner_id": -163637512,
"user_id": 100,
"photo_75": "https://pp.userap...6c3/dpB1i0kmx28.jpg",
"photo_130": "https://pp.userap...6c4/chFSdx-5YcQ.jpg",
"photo_604": "https://pp.userap...6c5/fNDftqXiJek.jpg",
"width": 300,
"height": 500,
"text": "",
"date": 1521195983,
"post_id": 1
}
}],
"post_source": {
"type": "api",
"platform": "android",
"data": "profile_photo"
},
"comments": {
"count": 0,
"groups_can_post": true,
"can_post": 1
},
"likes": {
"count": 0,
"user_likes": 0,
"can_like": 1,
"can_publish": 1
},
"reposts": {
"count": 0,
"user_reposted": 0
},
"views": {
"count": 2
}
}],
"profiles": [],
"groups": [{
"id": 163637512,
"name": "ღThe Rivera Dynastyღ",
"screen_name": "ofrivera",
"is_closed": 0,
"type": "page",
"is_admin": 0,
"is_member": 0,
"photo_50": "https://pp.userap...6cd/MV1tb_1xmG0.jpg",
"photo_100": "https://pp.userap...6cc/e8swFwR2Pt0.jpg",
"photo_200": "https://pp.userap...6cb/iaKMY64vnt0.jpg"
}]
}
}
Уже всю голову сломал, как распарсить данный json