Closed mglazer-cengage closed 8 years ago
I don't see any tests for using sandbox parameters and they don't seem to work
json = {"books":[{"title":"kids", "author":"adams"},{"title":"action", "author":"johns"}]} path = '$..books[?(@.title==@.param)]' JSONPath({json:json, path : path, sandbox : {param:'kids'}} )
This JSBIN demonstrates this with two test:
http://jsbin.com/cupehuyayo/edit
The first test above is with the param second is with a string
Any help would be appreciated, thank you.
In your case, it should be:
var ext = param ? 'param' : '"kids"';
I've also added a test to master.
master
Feel free to comment further, but closing as should be addressed now.
I don't see any tests for using sandbox parameters and they don't seem to work
This JSBIN demonstrates this with two test:
http://jsbin.com/cupehuyayo/edit
The first test above is with the param second is with a string
Any help would be appreciated, thank you.