I have a json that looks like the following (greatly simplified):
[
{
"kind": "vehicles",
"examples": ["car", "helicopter"]
},
{
"kind": "stars",
"examples": ["blue", "red", "neutron"]
}
]
I'd like the transform into another list of dictionaries with the same keys, but the examples list flattened.
So that it looks like:
[
{
"kind": "vehicle",
"example": "car"
},
{
"kind": "vehicle",
"example": "helicopter"
},
{
"kind": "stars",
"example": "blue"
},
{
kind: "stars",
example: "red"
},
{
"kind": "stars",
"example": "neutron"
}
]
I am using Python's JMESPath library.
Is this possible using JMESPath?
If so, how?