需要根据元素值input.json进行变换
{
"Result": {
"owner": {
"name": "test user"
},
"Components": [
{
"id": "123-456-789"
}
],
"123-456-789": {
"temp": {
"emip": "abc",
"teto": "123"
}
}
}
}
转换json
[
{
"operation": "shift",
"spec": {
"Result": {
"Components": {
"*": {
"id": "compId"
}
},
"compId": {
"@": "component"
}
}
}
},
{
"operation": "default",
"spec": {
"compId": null
}
}
]
预计输出为
"123-456-789": {
"temp": {
"emip": "abc",
"teto": "123"
}
}
但结果答案如下,当我用 123-456-789 对值进行硬编码时,我得到了该值,但我需要动态获取该值。
{
"compId" : "123-456-789"
}