I have a JSON and I need to select the value of the persons roles using JMESPATH. I can do it with only one and static id, like roles[?id=='1324'], but I can't do with a list of roles ids and selected from the JSON. I tried to do that with: roles[?id==person[ * ].role[ * ].id[ ]] and using pipe, but without any result. Below an example of my JSON.
{
"person":[
{
"id":"999999999",
"role":[
{
"id":"1324",
"name":"Test"
},
{
"id":"1578",
"name":"Test 2"
}
]
},
{
"id":"888888888",
"role":[
{
"id":"1234",
"name":"Test"
},
{
"id":"1678",
"name":"Test 2"
}
]
}
],
"roles":[
{
"id":"1234",
"value":"$945.00"
},
{
"id":"1324",
"value":"$1245.00"
},
{
"id":"1578",
"value":"$3245.00"
},
{
"id":"1678",
"value":"$4245.00"
}
]
}