-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
expression.search yields wrong results #63
Comments
Thank you for reporting this. It's been a long time since I worked on this code and figuring out what's going on here is going to require some thinking. Simplifying the expression to
I don't know if the problem is in the parser or the runtime. Sadly how this should work is not covered by the compliance tests, but it looks like the JavaScript, Python, and Go implementations handle this differently than this library so this library is probably wrong. I can't promise that I will have the time to work on this. It was a very long time since I used this library myself. If you need a workaround you can use |
Hi Theo, thanks for the quick reply and for looking into it! It's a pitty that this corner-case is not covered by the compliance tests. We've found a workaround for the concrete issue we're seeing in our context. However, I still wanted to report it so that it documented if maybe also others are affected by it. Best regards |
Thank you for reporting this, I am also facing this issue. Initially I thought that I was doing something wrong with my custom implementation of a runtime, however after testing it with the Gson runtime the issue persists. I also resorted to using a |
Hi everyone,
the company I'm working at uses the
io.burt.jmespath-gson
library in a Scala/Spark application in order to be able to runJMESPath
queries on largejson
-structuredString
s. However, recently we found out that there are some inconsistencies between the results of the lib compared to what interactive web interface at https://jmespath.org/ yields (or what for example the Python implementation yields).Let me outline it with a small example:
The following snippet is a small
Scala
unit test which captures the bugRunning this unit test fails with the following message:
The dependencies are:
However, if you run the same query on the same JSON string in the interactive web interface of https://jmespath.org/, it produces a different (valid?) result. See this screen shot:
This result can also be observed when running the same query on the same JSON string with the Python implementation.
This small unit test runs successfully:
Dependencies for this Python test are:
Expected behavior:
The Java implementation yields the same result as the one observed in the web interface and as that of other libraries.
If you need any further details, please let me know!
Best regards
Michael Bechtel
The text was updated successfully, but these errors were encountered: