私が提供したいくつかの JSON に苦労しています。次の形式です。
[
[
{
"items": [
{
"id": "xxxxxxx",
"name": "xxxxxxxxxx",
"description": "xxxxxxxxxxx"
},
{
"id": "xxxxxxx",
"name": "xxxxxxxxxx",
"description": "xxxxxxxxxxx"
}
],
"parentId": "xxxxxxxx",
"title": "xxxxxxxxx",
"type": "xxxxxxx"
}
],
[
{
"items": [
{
"id": "xxxxxxx",
"name": "xxxxxxxxxx",
"description": "xxxxxxxxxxx"
},
{
"id": "xxxxxxx",
"name": "xxxxxxxxxx",
"description": "xxxxxxxxxxx"
}
],
"parentId": "xxxxxxxx",
"title": "xxxxxxxxx",
"type": "xxxxxxx"
}
]
]
だから、「データ」という名前のオブジェクトがあります。「データ」を文字列化すると、これが上記のものになります。基本的に、parentId があり、この JSON でその parentId を検索する必要があります。私はこの構造に慣れておらず、(比較的) 単純な解決策を見つけようとしてもがき苦しんでいます。トップレベルに「アイテム」のようなものがあることに慣れていて、それを掘り下げることができます。