Home > Mobile >  How to extract array element without key?
How to extract array element without key?

Time:10-20

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]"
    ]
}

CodePudding user response:

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 Jayway JsonPath

  • Related