Hello,
I have JSON that I’m using findAll() upon, like so: https://gist.github.com/dragoonis/2168d2079f2e684f0306360d364c6d4e#file-file-scala-L11
It’s fine for the “documents” key in the JSON to be empty array, such as: “documents: []”, because I have a doif() here to check if we have documents, or not: https://gist.github.com/dragoonis/2168d2079f2e684f0306360d364c6d4e#file-file-scala-L19
This is the full JSON body:
{"limit":999,"metadata":{"doctype":[],"direction":[]},"pages":{"current":1,"total":0},"total":0,"documents":[]}
When I have a payload that’s got an empty documents array, I still get this error every time, and it fails.
> jsonPath($.documents).findAll.exists, found nothing 1 (100.0%)
Can you please advise what should change in my script, to get all the $.documents, but not fail if it's an empty JSON array.
Many thanks,
Paul