5 ms·
There are a ridiculous number of JSON query/path languages. Wish all the authors got together and harmonized on a standard.
by lenkite 1y ago
There are a ridiculous number of JSON query/path languages. Wish all the authors got together and harmonized on a standard.
- nartho 1y agoPlus, I feel like most, if not all, higher level languages already come with everything you need to do that easily. Well except for go that requires you to create your own filter function.
- miohtama 1y agoXkcd.gif
- thayne 1y agoThere is a standard in RFC 9535 (JSONPath)[1]. But as far as I can tell, it isn't very widely used, and it has more limited functionality than some of the alternatives. [1]: https://datatracker.ietf.org/doc/html/rfc9535 https://datatracker.ietf.org/doc/html/rfc9535
- NewJazz 1y agoPostgresql supports jsonpath, right?
- Groxx 1y agoSQLite might too, though I'm struggling to find anything explicit about the syntax: https://sqlite.org/json1.html#jptr https://sqlite.org/json1.html#jptr it might just be a very limited subset?
- lelandbatey 1y agoDon't forget the also standardized way of referring to a single value in JSON, "JSON Pointer": datatracker.ietf.org/doc/html/rfc6901
- phpnode 1y agothe 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/ https://goessner.net/articles/JsonPath/
- voidfunc 1y agoThe standard is called jq, any new standard is just going to be a committee circle jerk that doesn't move the ball forward in any meaningful way.
- lenkite 1y agojq is good but its syntax is strangely unmemorizable. Have used it for a decade and always need to look at the manual or at examples to refresh my knowledge.
- cmckn 1y agoThe AWS CLI supports JMESPath (https://jmespath.org https://jmespath.org) for the `--query` flag. I don't think I've run into anything else that uses it. Pretty similar to JSONPath IIRC.
- gegtik 1y agoazure tools also support JMESPath