In JSONPath 0.9.1 the following Json path was valid:
http://jsonpath.herokuapp.com/?path=$.store.book[?(@.author==%27Nigel%20Rees%27)][0]
returning
{
"category" : "reference",
"author" : "Nigel Rees",
"title" : "Sayings of the Century",
"price" : 8.95
}
I've upgraded to the latest one (2.3) and the query now returns empty array.
Is this a bug or the way to retrieve an element from the resulting array has changed?
Given this document:
Using JsonPath 2.3.0, the following code returns a
JSONArray
(rather than anObject[]
):So, the following code ...
... will print: