i'm trying to transform the following JSON in input:
{
"operation": "create",
"id": "$1",
"name": "esempio create",
"type": "CAR",
"status": 0,
"country": "JAP",
}
in this new format:
{
"operations": [
{
"operation": "C",
"element": {
"type": "CAR",
"other_data": {"id":$1, "name": "example", "status":0, "country":"JAP"}
}
}
]
}
i'm using the following method, where element is the JSON mentioned above:
var js=JSON.stringify({"operation":"C", "element":{"type": element.type , "other_data":{element}}});
in every javascript compiler it works correctly, when i try to apply it on WSO2 i'm not able to save the page because the IDE (Integration Studio) detect an error on javascript. Do you know any other way to do it or tell me why i'm not able to save it?
Thanks