I have a json as below. I want a json path expression that checks if [e3] exists in the below json. Can someone help please?
{
"status": "ok",
"error": [
"[e1]",
"[e2]",
"[e3]",
"[e4]"
]
}
The below JSONPath
will return a list with one element. Indefinite
paths always returns a list. A path is indefinite
if it contains an expression - ?(<expression>)
. Refer What is Returned When?
$.error[?(@ == '[e3]')]