8 ms·
I love JMESPath. I first discovered it when using the AWS CLI `--query` option[0]. I then realized that using it in my code would make things much more declara
by gingerlime 9y ago
I love JMESPath. I first discovered it when using the AWS CLI `--query` option[0].
I then realized that using it in my code would make things much more declarative and easy to grok than a bunch of maps, filters etc. Here's a real example which I think illustrates it[1]. It has libraries for lots of languages with a clear specification/compliance test[2].
The cherry on the top is the interactive query on the website. You can tweak any of the examples (both queries and data) and get results instantly. Extremely useful for playing around, building queries to work with JSON data (webhooks, API responses etc)
[0] https://docs.aws.amazon.com/cli/latest/userguide/controlling-output.html https://docs.aws.amazon.com/cli/latest/userguide/controlling...
[1] https://gist.github.com/gingerlime/757c7b4778c1ab68605dfce66ceb8378 https://gist.github.com/gingerlime/757c7b4778c1ab68605dfce66...
[2] http://jmespath.org/libraries.html http://jmespath.org/libraries.html