Insomnia: [Feature Request] Use jq for JSON filters

Created on 22 Feb 2018  路  6Comments  路  Source: Kong/insomnia

JSON filters on Insomnia are pretty useful, but there's some cases that aren't (nicely) covered by it. I have to regularly interact with APIs that return arrays of big JSON objects (40+ properties) of which I usually need a small subset of fields. JSON path allows you to do $.results[*]["asd","id"] but that prints an array with no keys which is confusing when the types of the fields are similar.

jq is really powerfull JSON processor which can transform just about any JSON input to any output you can imagine (while being really really fast). The query .results[] | {asd, id} would produce an array of objects with the proper keys, instead of simply the values.

stale

Most helpful comment

Another jq fan - I would like to add that it would be great to have the curl code generator produce valid code for jq optionally!

All 6 comments

馃憢 Thanks for opening your first issue! If you're reporting a 馃悶 bug, please make sure
you include steps to reproduce it. If you're requesting a feature 馃巵, please provide real
use cases that would benefit. 馃應

To help make this a smooth process, please be sure you have first read the
contributing guidelines.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Hello!

I'm using Insomnia at this moment and yeah I was surprised it's JSONPath which is used where https://stedolan.github.io/jq/ sounds to be a real competitor here.

I already use jq inside Sublime Text and it works like a charm!

It should be considered by the Insomnia Team. :)

Could we reopen this issue?

I attempted to write a plugin that would use jq instead of JSONPath, but there were errors because jsonpath is so integrated throughout Insomnia.

Wish we could have the option to switch between both jq or jsonpath. If you look at this plugin it is importing the JSONpath module here.

Would be nice if we could actually require node-jq and pass in jq queries to filter responses. @gschier - is this something that is feasible or would it require a lot more rework since the response filter is hardcoded for jsonpath?

Also I opened this issue here regarding adding environment variables to the filter input box beneath the response. Seems like these two items would really be useful if we could get it implemented?

Another jq fan - I would like to add that it would be great to have the curl code generator produce valid code for jq optionally!

Was this page helpful?
0 / 5 - 0 ratings