I have JSON in the following format:
[
{
"nameValues": [],
"offeringId": "a"
},
{
"nameValues": [
{
"name": "key1",
"value": "true"
},
{
"name": "key2",
"value": "value2"
}
],
"offeringId": "b"
}
]
I am looking to match a create a field with the value of one of the one the name value pairs, that matches the offeringId=b. The output being key1=true. All the keyvalue pairs in nameValues would obviously also suffice.
I've struggled with spath, but not sure that you can select a specific offeringId=b like you can do in xpath. Or would I be better off attempting this via regex?
Any help would be much appreciated.
... View more