我正在使用发送JSON响应的API,如下所示:
[
- {
"id": 46843639,
"nickname": "JSON",
"registration_date": "2004-03-07T23:16:20.000-04:00",
"country_id": "BR",
"user_type": "normal",
"logo": null,
"points": 91,
"site_id": "JSN",
"permalink": "http://xxxxxx",
"seller_reputation": - {
"level_id": "2_orange",
"power_seller_status": null,
"transactions": - {
"period": "historic",
"total": 14,
"completed": 8,
"canceled": 6,
"ratings": - {
"positive": 1,
"negative": 0,
"neutral": 0,
},
},
},
"status": - {
"site_status": "active",
},
},
]
Run Code Online (Sandbox Code Playgroud)
我找不到任何规范文件中的减号' - '.这是JSON标准吗?
不,这不对.服务器正在向您发送损坏的JSON.
唯一的时间-是有效的,当它在一个字符串,当它后面紧跟一个数字,或者当它紧跟在e或E在浮点数.
除此之外,逗号应该分隔名称/值对和数组元素,而不是遵循它们.每个对象/数组中最后一个条目后面的逗号也是无效的.