Input
{
"item" : "some value",
"get" : :some other value",
"org"{
"animal-type": ["mammal","reptile","bird"],
"animal-name": ["rat","pigeon"],
"some-random": ["one array"]
....
....any number of items with any name can show up here..
....
....
},
"some_weight" : "yuad asf-do-not-convet"
}
Output
{
"item" : "some value",
"get" : :some other value",
....
Array of "org"
....
.... any format with "-" converted to "_" AND any representation in such a way that the number of elements in it is a fixed number
.... This one has ultimately to be converted into avro schema and we don't want to update schemas when occasional items appear within "org"
....
"some_weight" : "yuad asf-do-not-convet"
}
Jolt I have been trying so far,
[
{
"operation": "shift",
"spec": {
"org": {
"*-*-*": "&(0,1)_&(0,2)_&(0,3)",
"*-*": "&(0,1)_&(0,2)",
"*": "&"
},
"*": "&"
}
}
]
This replaces the - to _ and removes the org, which is totally fine with me. However, I am struggling how to make the names, animal-type,animal-name,some-random (three here but can be any number) into a key value type representation so that I don't have to keep adjusting my avro schema with some fields that I am not anticipating appear.