我希望获得除template
字段之外的整个对象,无论级别如何。
这是我的目标:
{
sections:
[
{
name: "part1",
title: "Part I",
template: "Part I template",
children: [{
name: "1",
title: "part1.1",
template:"part1.1 template"
}, {
name: "2",
title: "part1.2",
template:"part1.2 template"
}]
},
{
name:"part2",
//...
}
]
}
我试过https://github.com/s3u/JSONPath和https://github.com/dchester/jsonpath我无法弄清楚我该怎么做。