Mule 3.9: How to generate the payload in JSON format from the HashMap type.
Transform the HashMap type payload to JSON array format. The sample data of HashMap
Key: Value MK1 : T1 MK2 : T2 MK3 : T3
Target format to generate in Mule from DataWeave 1.0
{
"cars": [
{
"makeId": "MK1",
"makeName": "T1"
},
{
"makeId": "MK2",
"makeName": "T2"
},
{
"makeId": "MK3",
"makeName": "T3"
}
]
}
Is it possible to covert the HashMap of key and value (both string type) to be converted to the above defined JSON array format.