h2non / jsonpath-ng

Finally, a JSONPath implementation for Python that aims to be standard compliant. That's all. Enjoy!
Apache License 2.0
582 stars 85 forks source link

Problems with documentation on extensions in README #56

Closed baynes closed 1 year ago

baynes commented 4 years ago

1: After the "Extensions" heading https://github.com/h2non/jsonpath-ng#extensions there should be a reminder that you have to use jsonpath_ng.ext.parse, not jsonpath_ng.parse to use these.

2 The following examples are wrong:

$.objects[?some_field = "foobar")]
$.objects[?some_field =~ "foobar")]
$.objects[?some_field > 5 & other < 2)]

They are missing a "(" and possibly also "@." after the "?".

trebor74hr commented 3 years ago

Maybe someone will find useful - I have provided working example that uses filter functions from extensions on https://stackoverflow.com/questions/12343282/python-jsonpath-filter-expression/64970342#64970342

michaelmior commented 1 year ago

I added a note about importing from jsonpath_ng.ext in the README.