【发布时间】:2019-02-26 22:57:48
【问题描述】:
我想访问 JSONArray 中的字段。 JSONArray 内部的嵌套括号很麻烦。我看不出这种格式如何成为可接受的 JSONArray 返回值。当我尝试使用getJSONObject() 访问一个字段(例如“rethink3__Address__c”)时,我得到一个JSONException。
[
[
{
"attributes":{
"type":"rethink3__Listing__c",
"url":"\/services\/data\/v42.0\/sobjects\/rethink3__Listing__c\/a06m0000005OPb9AAG"
},
"rethink3__Address__c":null,
"Alarm_Code__c":null,
"rethink3__Bathrooms__c":0,
"rethink3__Bedrooms__c":0,
"rethink3__Size__c":0,
"Lock_Box_Code__c":null,
"Lock_Box_Location_Notes__c":null,
"_soupEntryId":1,
"_soupLastModifiedDate":1537657104801
}
],
[
{
"attributes":{
"type":"rethink3__Listing__c",
"url":"\/services\/data\/v42.0\/sobjects\/rethink3__Listing__c\/a06m0000005OPb9AAG"
},
"rethink3__Address__c":null,
"Alarm_Code__c":null,
"rethink3__Bathrooms__c":0,
"rethink3__Bedrooms__c":0,
"rethink3__Size__c":0,
"Lock_Box_Code__c":null,
"Lock_Box_Location_Notes__c":null,
"_soupEntryId":1,
"_soupLastModifiedDate":1537657104801
}
]
]
【问题讨论】:
-
http://jsonviewer.stack.hu,使用此网站查看您的 JSON 结构。至少对我很有帮助。
标签: arrays json object multidimensional-array jsonexception