我输入的json是这样的:
{
"person": {
"personinfo": [
{
"VAR_KEY": "name",
"VAR_VAL": "jack"
},
{
"VAR_KEY": "sex",
"VAR_VAL": "male"
}
]
}
}
我想得到像这样的输出
{
"person": {
"personinfo": [
{
"name":"jack"
},
{
"sex":"male"
}
]
}
}
如何编写mule esb dw脚本?谢谢
答案 0 :(得分:0)
这对我有用
%dw 1.0
%output application/json
---
person : {
personinfo : payload.person.personinfo map {
($.VAR_KEY) : $.VAR_VAL
}}