Reputation: 13
I would like to transform the below input JSON using JOLT. what will be the JOLT Spec?
INPUT JSON--
[
{
"Bank": [
{
"id": "101",
"PuneBranch": [
{
"id": "449",
"address": "Wakad",
"IFSC": "IEC_62196_T1",
"MICR": "123"
},
{
"id": "450",
"address": "Hinjewadi",
"IFSC": "IEC_62196_T2",
"MICR": "456"
}
]
},
{
"id": "102",
"BangaloreBranch": [
{
"id": "451",
"address": "Whitefield",
"IFSC": "IEC_62196_T3",
"MICR": "789"
},
{
"id": "452",
"address": "EC",
"IFSC": "IEC_62196_T4",
"MICR": "012"
}
]
}
]
}
]
Expected Output--
Bank 1
ID: 101
🏦PuneBranch 1
id: 449
address: Wakad
IFSC: IEC_62196_T1
MICR: 123
🏦PuneBranch 2
id: 450
address: Hinjewadi
IFSC: IEC_62196_T2
MICR: 456
Bank 2
ID: 102
🏦BangaloreBranch 1
id: 451
address: Whitefield
IFSC: IEC_62196_T3
MICR: 789
🏦BangaloreBranch 2
id: 452
address: EC
IFSC: IEC_62196_T4
MICR: 012
Basically, Jolt SPEC should contain HTML tags to show the images and excepted output. Can this be achieved using a jolt? Is this feature is provided by the jolt library?
Upvotes: 0
Views: 247
Reputation: 65323
While the expected output is not presented in JSON format, the desired spec presumably might be like
[
{
"operation": "shift",
"spec": {
"*": {
"*": {
"*": ""
}
}
}
},
{
"operation": "modify-overwrite-beta",
"spec": {
"*": {
" Bank": "=intSum(@(1,id),-100)",
" id": "=(@(1,id))"
}
}
},
{
"operation": "remove",
"spec": {
"*": {
"id": ""
}
}
},
{
"operation": "sort"
}
]
Upvotes: 0