h2non / jsonpath-ng

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

error in JsonExtendedParser #140

Open mwette opened 9 months ago

mwette commented 9 months 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 8 months 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! 👍