如何解析以下 JSON 数组以进行 Retrofit?我尝试过 jsonschema2pojo.org 但无法生成模型和响应类。它给出了 NullPointerException
。
[
{
"id": "D5mQnyoLClw",
"created_at": "2017-01-14T04:36:41-05:00",
"width": 5760,
"height": 3840,
"color": "#D8DFE3",
"likes": 21,
"liked_by_user": false,
"user": {},
"current_user_collections": [],
"urls": {},
"categories": [],
"links": {}
},
{
"id": "iInYwn194Tk",
"created_at": "2017-01-14T03:53:55-05:00",
"width": 4896,
"height": 2760,
"color": "#FF713E",
"likes": 38,
"liked_by_user": false,
"user": {},
"current_user_collections": [],
"urls": {},
"categories": [],
"links": {}
}]
最佳答案
关于java - 使用自动生成的映射解析 JSON 数组会引发 NullPointerException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41652162/