I have simple JSON and I want to reorganize the keys with JOLT transformation:
Input JSON looks like this:
[
{
"Firstname": "John",
"LastName": "JohnLastName",
"City": "TestCity",
"PostCode": "25466",
"Street": "85.",
"HousNumber": "5",
"Phone": "0054565685",
"Email": "-"
}
]
and wished output should be:
{
"Firstname": "John",
"LastName": "JohnLastName",
"Address": {
"City": "TestCity",
"PostCode": "25466",
"Street": "85",
"HousNumber": "5"
},
"Contact": {
"Phone": "0054565685",
"Email": "-"
}
}
2
Answers
You can use the below Jolt Spec
You can deliver the elements to the respective objects by their common properties such as
where ampersand operator replicates the value of the respective element
the demo on the site http://jolt-demo.appspot.com/ is :