News for hackers. Stuff that matters.
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.
Re:How to Use JSON Path by riquito on Friday May 03, 2024 @02:26PM (#40250716)
Well, the article is about JSONPath and jq doesn't use it
Re:How to Use JSON Path by turadg on Friday May 03, 2024 @03:23PM (#40251302)
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...
Re:How to Use JSON Path by philstu on Friday May 03, 2024 @04:14PM (#40251872)
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.