【发布时间】:2021-11-10 07:43:05
【问题描述】:
我有两个输入负载,我想将另一个嵌套 JSON 对象中的 JSON 对象组合到特定对象。 预期的输出是将输入 2 与“Response_Data”下的输入 1 结合起来。
我尝试过,但我可以在最后合并输入 2,但无法将其添加到“Response_Data”中。
有人可以帮我写 dataweave 代码吗?
输入 1:
[{
"Org_Response": {
"Request_Criteria": {
"Org_Type_Reference": {
"ID": {
"type": "Org_Type",
"text": "Business_Unit"
}
},
"Include_Inactive": "0"
},
**"Response_Data"**: {
"Org": {
"Reference": {
"ID": {
"type": "Business_Unit_Reference_ID",
"text": "999-99-FD"
}
},
"Org_Data": {
"Reference_ID": "999-99-FD",
"Name": "Management"
}
}
}
}
}]
输入 2:
{
"Org": {
"Reference": {
"ID": {
"type": "Business_Unit_Reference_ID",
"text": "90000"
}
},
"Org_Data": {
"Reference_ID": "90000",
"Name": "TAXES"
}
}
}
预期输出:
[{
"Org_Response": {
"Request_Criteria": {
"Org_Type_Reference": {
"ID": {
"type": "Org_Type",
"text": "Business_Unit"
}
},
"Include_Inactive": "0"
},
**"Response_Data"**: {
"Org": {
"Reference": {
"ID": {
"type": "Business_Unit_Reference_ID",
"text": "999-99-FD"
}
},
"Org_Data": {
"Reference_ID": "999-99-FD",
"Name": "Management"
}
},
"Org": {
"Reference": {
"ID": {
"type": "Business_Unit_Reference_ID",
"text": "90000"
}
},
"Org_Data": {
"Reference_ID": "90000",
"Name": "TAXES"
}
}
}
}
}]
提前致谢
【问题讨论】:
标签: dataweave