我正在更新我的Jolt规范,以生成正确的输出.我已经做了第一次try ,但不幸的是,为了获得好的结果,我的规范中缺少了一些东西.
这是我的json输入
{
"id": 111,
"uuid": "b4915b22-d8c0-47bd-832c-18c0",
"testKey1[xxx]": "identifier_1234",
"testKey2[yyyy]": "identifier_14",
"name": "name1",
"testValue1[xxx]": "10",
"testValue2[yyy]": "12",
"address": "S2271",
"updateTime": "2024-01-18T10:35:00Z"
}
这是我的摇摆规格
[
{
"operation": "shift",
"spec": {
"uuid": "idBus",
"id": "idTech",
"name": "title",
"address": "location",
"updateTime": "lastUpdated",
"testValue*": "myList&.value",
"testKey*": "myList&.code"
}
},
{
"operation": "shift",
"spec": {
"*": "&",
"myList*": "myListOfFields[]"
}
}
]
实际上,我有这样的输出
{
"idBus": "b4915b22-d8c0-47bd-832c-18c0",
"idTech": 111,
"title": "name1",
"location": "S2271",
"lastUpdated": "2024-01-18T10:35:00Z",
"myListOfFields": [
{
"value": "identifier_1234"
},
{
"value": "identifier_14"
},
{
"code": "10"
},
{
"code": "12"
}
]
}
我想要的输出是
{
"idBus": "b4915b22-d8c0-47bd-832c-18c0",
"idTech": 111,
"title": "name1",
"location": "S2271",
"lastUpdated": "2024-01-18T10:35:00Z",
"myListOfFields": [
{
"code": "identifier_1234",
"value": "10"
},
{
"code": "identifier_14",
"value": "12"
}
]
}
为了达到预期的yields ,有没有遗漏的部分? 如有任何帮助,我们将不胜感激
谢谢.