Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I wish to transform my JSON Payload based on a set of lookup values in WSO2 ESB.

e.g.

input


[
{
 "name" : "Apple",
 "type" : "fruit"
},
{
 "name" : "Cabbage",
 "type" : "fruit"
},
{
 "name" : "Rice",
 "type" : "grains"
}
]

Expected Output


[
{
 "name" : "Apple",
 "type" : "perishable"
},
{
 "name" : "Cabbage",
 "type" : "perishable"
},
{
 "name" : "Rice",
 "type" : "non-perishable"
}
]

Lookup Table for transformation.

{
"fruits": "perishable"
"grains": "non-perishable"
}

I have tried looking into DataMapper mediator but that does not support as far as I understand.

How to achieve this type of transformation? Kindly help me with this.

question from:https://stackoverflow.com/questions/66064373/transform-payload-values-based-on-a-lookup-table-in-wso2-esb

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
1.1k views
Welcome To Ask or Share your Answers For Others

1 Answer

Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...