Re:How to Use JSON Path
by Powdering7082 on Friday May 03, 2024 @11:57AM
(#40249134)
I am kind of surprised that they don't mention jq at all, it seems like a similar tool that is fairly wide spread.
[ Parent
| on HN ]
Well, the article is about JSONPath and jq doesn't use it
Same. I was curious what the differences are.
JSONPath can only pull data out, like XPath. jq can do much more, like perform transformations.
jq is also more concise:
.book[0].title
versus JSONPath: $..book[0].title
Here's a discussion with more comparisons: https://github.com/serverlessworkflow/specification/issues/2...jq is wonderful but not relevant to the discussion.
This is about using JSONPath for OpenAPI Overlays and automated API Style Guides like Spectral.
You cannot use jq for either of those things.
Notbing against jq, just a different discussion.