-
Notifications
You must be signed in to change notification settings - Fork 73
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
Use more up-to-date and comprehensive JSONPath library #486
Use more up-to-date and comprehensive JSONPath library #486
Conversation
c64894d
to
4e313ab
Compare
@agilgur5 Hello Anton, I opened this PR to change the JSONPath library. |
Signed-off-by: Baris Erdem <baris.erdem@phrase.com>
Signed-off-by: Baris Erdem <baris.erdem@phrase.com>
e3f684c
to
c29cd18
Compare
For posterity, this is a follow-up from Slack |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for adding tests too!
I looked through some of the Go JSONPath libraries as well and noticed that several were unmaintained (and incomplete) unfortunately 😕 |
Kudos, SonarCloud Quality Gate passed!
|
@b-erdem could you make a PR to Workflows to update this dep now? |
Hi, thanks for merging it! I can open a PR on Workflows in a few hours once I’m at home. Does that work? |
Yea no rush or anything |
@b-erdem just a friendly reminder that the full update still requires a PR to Workflows |
@agilgur5 Thanks for the reminder. I’m working on it. It turned out I needed to make a few changes on the main repo. Just updating the dependencies was not enough. I’ll just open a PR and we can discuss the changes I made there. |
Recently we noticed that Argo Workflow doesn't support some JSONPath expression to extract some values from inputs. After digging a bit we found that current JSONPath library used by Argo is outdated and it does support only a fraction of the spec. After looking around for better JSONPath libraries I found this one that works for the all expressions I have tried so far: github.com/evilmonkeyinc/jsonpath
If you're also curious about other libraries you can see a comparison here but keep in mind that it's either outdated or incorrect: https://asaiyusuke.github.io/jsonpath/cburgmer-json-path-comparison/docs/index.html
Because I tried some of the JSONPath libraries listed there, including the one written by the author of the post above and most of the expressions in the comparison table didn't work.
As I see these changes don't cause any issue or break existing functionality.
I have added some test cases to cover more complex expressions.
Please let me know if there's any mistake or something I'm missing when opening a PR here.