Stefan Goessner

goessner.net · Personal blog · on HN since 2008

Stefan Goessner is the originator of JSONPath, the XPath-like query language for JSON, and hosts its original write-up.

What HN saysHN links it as the origin of JSONPath, and commenters note the 2007 post was implemented inconsistently for years before it became a standard.
22HN people shared it
20linked it in comments
2stories submitted
5story points
1 year agolast shared
2008people per year2026

Most-shared posts

  1. 1
    JSONPath - XPath for JSON
    16 people · 5 points · first shared 2009 · 6 comments on HN
  2. 2
    Jsont
    5 people · first shared 2008
  3. 3
    Index
    1 people · first shared 2023
  4. 4
    );
    1 people · first shared 2020

What HN people wrote when they linked it

lobster_johnson · 2016-11-24
Related/shameless plug: We've been working on a reimagining of JSONPath [1] which we hope will be useful to other people. Unfortunately, it's not public yet — though we have working libraries in JavaScript and Go (a heavily modified fork of Kubernetes' JSONPath code) we intend to release — mostly because we want to publish a proper spec. In fact, we're looking for a good name for it, as we feel that releasing "JSONPath 2.0" would be a little presumptious. I was thinking something like JSONMatch. If there's sufficient interest I could prioritize it (email me!). Our own version of JSONPath is intended for both searching and patching documents in general. A simple search would be something like: friends[name == 'bob'].id or shoppingItems[1:3][description, id] We use this to declaratively extract data from documents, but also change it. The patching support lets you do things like: match(document, "..[role == 'owner'].role") .set('admin'); This will set "role". It gets rather magical and beautiful when you have multiple paths that involve unions, subindexed arrays and constraints. We also have a separate patch notation, expressed in JSON, to declaratively transform documents. It uses these JSONPaths to select and set values. We might write a spec for that, too, although I'm not sure the utility outside our app is that great. [1] http://goessner.net/articles/JsonPath/
brunoc · 2010-11-15
Regarding schemas - there is JSON Schema: http://json-schema.org/ http://tools.ietf.org/html/draft-zyp-json-schema-02 We've been using this pretty extensively at work. The Java guys wrote something to generate their model from it and on the JavaScript side we've used it to do all kinds of nice things like automagically generating forms that validate according to the schema and verifying that the data we receive from the backend conforms to it in our tests. From what I can gather very few people are using it. It's not exactly fun to write but a co-worker of mine wrote a dsl to make that less painful. Of course when you write JavaScript, it's a joy to work with. On the transformation side there are a few ideas floating, notably JSON-T http://goessner.net/articles/jsont/ Neither of these things are as mature as XSD and XSLT, but if you love JSON and JavaScript, they're definitely worth investigating.
phpnode · 2025-10-27
the issue with JSONPath is that it took 17 years for it to become a properly fleshed-out standard. The original idea came from a 2007 blog post [0], which was then extended and implemented subtly differently dozens of times, with the result that almost every JSON Path implementation out there is incompatible with the others. [0] https://goessner.net/articles/JsonPath/
no_wizard · 2023-12-22
I know Reflect[0] doesn't get alot of attention however I always thought it would be a big improvement if `Reflect.set`, `Reflect.get` and `Reflect.deleteProperty` gained support to deal with nested properties. It would effective give developers built-in JSON Path support[1] (like you see in MySQL, Postgres or SQLite databases). As an unrelated aside, recursive proxies would also be extremely useful [0]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Glob… [1]: https://goessner.net/articles/JsonPath/
mdaniel · 2023-09-09
Interesting, I only knew about <https://goessner.net/articles/JsonPath/index.html> which makes no reference to =~ nor any such // syntax but it seems there's an IETF draft that is (a) an actual specification (b) includes more modern stuff like what you used: https://www.ietf.org/archive/id/draft-ietf-jsonpath-base-07.html#secti… And, while whatever is powering https://jsonpath.com/ does honor your syntax, albeit with an absolutely useless result: [ { "name": -1 }, { "name": -1 }, { "name": -1 } ] I found that `pip install jsonpath-ng` does not accept it nor mention it <https://github.com/h2non/jsonpath-ng/tree/v1.5.3?tab=readme-ov-file#ex… so I think it's out on the bleeding edge or something
ekiauhce · 2022-06-27
Good article, thanks! There is similar concept for json https://goessner.net/articles/JsonPath/ We heavily using it for validation error messages. Like { "error": "wrong value", "path": "foo/bar[1]/prop" }
cle · 2019-05-18
Here's the real JSONPath: https://goessner.net/articles/JsonPath/ This submission is for PostgreSQL's "JSON Path", which is very similar to the original JSONPath. I'm surprised, and disappointed, that there is no mention of the original JSONPath, which this is obviously inspired by.
tonyedgecombe · 2018-08-24
Just like there is always a group of people turning every programming language into Java there are also people turning JSON into XML: http://json-schema.org http://www.jsoniq.org http://goessner.net/articles/jsont/ https://json-ld.org
c-smile · 2018-02-17
There are plenty transformers already, for example: http://goessner.net/articles/jsont/
hoppelhase · 2018-02-17
jvinet · 2014-12-18
With JSONB here, JSONPath starts to become very interesting... http://goessner.net/articles/JsonPath/ http://blog.redfin.com/devblog/2012/03/json_in_postgres.html That article was written before JSON/JSONB showed up, but the idea remains the same. I didn't have plv8 installed, so I did some plumbing code in plpython. plv8 would be more suitable though. https://github.com/jvinet/pg-jsonpath
datashaman · 2014-05-06
Use JSONPath, it's a JSON version of XPath and it's awesome. http://goessner.net/articles/JsonPath/
conorgil145 · 2014-03-07
That is something I have wanted for a long time too. I came from the XML world and am very familiar with XPath. It seems like you are trying to create an XPath type parser for JSON, but also including some more complex features than XPath might include (been a while since I touched it, so I'd have to refresh my memory). Note that in your README, the links to the github repos for json-path and json-pointer 404. See also, this: http://goessner.net/articles/JsonPath/
marianoguerra · 2012-05-21
have you considered adopting the jsonpath syntax? it would be more javascripty and would be another implementation (or a superset) of jsonpath http://goessner.net/articles/JsonPath/ http://code.google.com/p/jsonpath/ https://github.com/joshbuddy/jsonpath https://github.com/marianoguerra/jsonpath-scala
arethuza · 2011-05-21
That made me wonder if there is something that uses an XPath like approach rather than CSS selectors, turns out there is just such a thing: http://goessner.net/articles/JsonPath/ These tools could be fun for writing map functions for CouchDB.
skorgu · 2009-08-28
A flag to output JSON would be nifty, then you could pass it through a filter [1] and get interweb-grep on steroids. [1] http://goessner.net/articles/JsonPath/
morbidkk · 2008-07-09
ohh and I forgot about this http://goessner.net/articles/jsont/
aabaker99 · 2015-12-11
I had a very similar problem with Ruby and some of our workloads. I ended up utilizing this evented parser [1] to process smaller subsets of the JSON document and then clear them from memory. The result is a memory usage that is at most the size of one of these subsets (plus some overhead). I have been wanting to generalize this approach with some open source software for some time, but I haven't gotten around to it. I think an attractive solution is for a user to specify a JSONPath [2] upfront about the types of subsets they are interested in. In the case of Ruby these chunks could then be yielded by an iterator and cleared, but I wonder if a more general-purpose CLI program which prints the subsets to stdout would also work if the subsets are small enough. But this adds another serialization/deserialization step. [1] https://github.com/dgraham/json-stream [2] http://goessner.net/articles/JsonPath/

Keyboard shortcuts

/Search
j kNext / previous blog
EnterOpen selected blog
vVisit the blog site
fFollow / unfollow
lSwitch grid / list view
dSwitch dark mode
g hHome
g pTop posts
g tTopics
g fFollowing
g lLiked
g yHistory
g qFAQ
EscBack / close