我正在为运动和子运动创建 JSON,如下所示:
{
"sportName": "Men's Basketball",
"path": "mbasket",
"sportID": 7,
"parentSportName": "Basketball"
}, {
"sportName": "Women's BasketBall",
"path": "wcc",
"sportID": 8,
"parentSportName": "Basketball"
}, {
"sportName": "Women's Cross Country",
"path": "wbasket",
"sportID": 9,
"parentSportName": "Cross Country"
}, {
"sportName": "Men's Cross Country",
"path": "mcc",
"sportID": 10,
"parentSportName": "Cross Country"
}
现在我想将sportName 嵌套在 parentSportName 下,即 Cross Country 将包含 Men's Cross country 和 Women's Cross Country。我需要对 JSON 进行哪些更改?
PS:我正在创建一个嵌套列表。