Skip to content
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

Added JPath expression operation #171

Merged
merged 3 commits into from
Aug 4, 2017
Merged

Conversation

mattnotmitt
Copy link
Collaborator

@mattnotmitt mattnotmitt commented Jul 25, 2017

Should be able to close #96 with this.
Still todo:

  • Add tests
  • Figure out if a try-catch around jpath.filter() is required

@mattnotmitt
Copy link
Collaborator Author

Turns out there are better JSONPath implementations closer to the reference - hence I'm changing the library used to jsonpath.

@mattnotmitt
Copy link
Collaborator Author

I've now added tests and changed the library over - unfortunately, I can't use the npm package for jsonpath as it causes errors in webpack, which have been reported by other users. Instead I'm using a pre-packed file of the library which is the recommended fix by the author for this issue. Other users have found success by requiring it as a webpack external package but that wouldn't work for CyberChef's use case.

@n1474335 n1474335 merged commit 31bfd86 into gchq:master Aug 4, 2017
@n1474335
Copy link
Member

n1474335 commented Aug 4, 2017

Nice work. I've made a couple of slight changes, improving error messages with a bit more detail.

I found a fairly simple workaround for importing the jsonpath library which I've implemented. It's better to import our dependencies through npm if at all possible as it allows us to manage their updates in a more automated fashion.

Thanks for checking another operation off the list!

@mattnotmitt
Copy link
Collaborator Author

@n1474335 That is really weird - I was using that fix, but when building for tests, it wouldn't work at all! I wonder why it worked out for you...

@n1474335
Copy link
Member

n1474335 commented Aug 4, 2017

Not sure. I've recently updated some of the dependencies, including webpack itself, so that might be the difference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Operation request: JPath for navigating/traversing JSON data
2 participants