Given this JSON below I want to make two jmespath queries:
- Select all the blocks which have the keys XXXclass and YYYclass (the strings "XXXclass" and "YYYclass" will be in the query)
- Select all the blocks in "item" which ".offer.type" contains the string "-interest"
I made multiples tests in https://jmespath.org/, read the tutorials, examples and specs but can't find how to make the two queries above. Thanks in advance
{
"items": [
{
"id": "1",
"type": "A",
"XXXclass": {
"offer": {
"price": "15",
"type": "dddd"
},
"label": "myLabel"
},
"YYYclass": {
"offer": {
"price": "75",
"type": "gggg"
},
"label": "myOtherLabel"
},
"ZZZclass": {
"offer": {
"price": "125",
"type": "dddd"
},
"label": "myLabelTwo"
}
},
{
"id": "2",
"type": "B",
"XXX-class": {
"offer": {
"price": "95",
"type": "dddd"
},
"label": "myLabelthree"
}
}
]
}
The below query
gives