Get the latest tech news

How to Use JSON Path


A few years ago most API designers, developers, and technical writers would have had very little reason to bump into JSONPath, but its starting to get more and more relevant as more tools and standards start relying on it. So what is JSONPath, what is it used for, and how can you get up to speed with using it?

Instead of using those yq or jpp tools we grabbed just to practice, we can use the Bump.sh CLI which has support for Overlays built in, and thankfully it'll work just fine with YAML or JSON. When combined with more advanced queries you can start to get really specific with bits of the OpenAPI document you'd like to update, enabling all sorts of random use cases like cleaning up the servers list for publishing an API Catalogue, removing Development and Staging servers not accessible or relevant to API consumers. The amazing JSONPath Comparison project has collated all of the differences into a massive test suite and published the results, which was really helpful in shaping the new standard.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of JSON Path

JSON Path