h2non / jsonpath-ng

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

error in JsonExtendedParser #140

Open mwette opened 1 year ago

mwette commented 1 year ago

I could not get an extended parser form (something like) "$..key[?(@.sub == "bar"] to work. Tried many forms. Then I started digging into the code and I ran across what I show below. It looks odd (having put together a number of lalr grammars myself). I'd expect the rule to be something like "sorts: sorts sort". Just thought I'd report .

    def p_sorts_comma(self, p):
        "sorts : sorts sorts"
        p[0] = p[1] + p[2]
kurtmckee commented 1 year ago

@mwette If you can provide the following information I think it will be easier to understand how to address this issue:

These three values can be plugged directly into the test suite to help identify the root cause.

If you can provide the full document you're working with, that's great, but if you're able to reduce the document to the smallest size that reproduces the issue it will be helpful! 👍