How to convert two arrays to key value with Jolt?
I have some JSON that contains two arrays that I would like to convert to key/value pairs. I've already create a spec to convert my input data into the format below.
Input
{
"rows" : [ {
"row" : [ "row1", "row2", "row3" ],
"header" : [ "header1", "header2", "header3" ]
}, {
"row" : [ "row4", "row5", "row6" ],
"header" : [ "header1", "header2", "header3" ]
} ]
}
Is it possible to convert it again with Jolt to something like:
{
"header1" : "row1",
"header2" : "row2",
"header3" : "row3",
"header1" : "row4",
"header2" : "row5",
"header3" : "row6"
}
Any guidance would be highly appreciated 🙂






