我是新手,我了解如何将 json 数据编组为自定义的预定义 Struct 类型,但我目前正在使用 JSON 集,该集可以在每次调用时具有动态键和值。我可以将这些动态数据编组到地图/界面中,这没问题,但我对如何访问深度嵌套在数组中的项目有点迷茫。
这是我在 USDOL 网站上使用的示例 JSON
{
"name": "osha-establishment",
"count": 15,
"frequency": "Manual Crawl",
"version": 4,
"newdata": true,
"lastrunstatus": "success",
"lastsuccess": "Mon Dec 08 2014 11:19:57 GMT+0000 (UTC)",
"thisversionstatus": "success",
"results": {
"est_search": [
{
"est_name": "Chipotle Mexican Grill",
"state": "MN",
"activity": {
"href": "https://www.osha.gov/pls/imis/establishment.inspection_detail?id=317911832",
"text": "317911832"
},
"opened": "11/20/2014",
"rid": "0552700",
"type": "Complaint",
"sc": "Partial",
"sic": {
"href": "https://www.osha.gov/pls/imis/sic_manual.display?id=44&tab=description",
"text": "5812"
},
"naics": "722110",
"vio": ""
},
}
]
}
}
我想访问sic此 JSON 集中键的值。
相关分类