insomnia
insomnia copied to clipboard
gRPC: Support JSONPath filter for response body
Description
Add support for JSONPath queries for gRPC responses bodies.
Currently the JSONPath filter input is rendered in the gRPC response tab, but does not apply the entered filter. This PR adds support for JSONPath filter by copying the current behavior of the response pane for http requests.
Type of change
Trivial change. Everything was already in place, just needed to copy the handler for applying the query.
How Has This Been Tested?
Manually tested using Insomnia UI on Ubuntu 22.04:
- Make gRPC request (that returns a json payload)
- Insert filter in the JSONData input field
Using develop branch:
- Filter is not applied
Checking out this PR:
- Filter is applied on response data
Really wish Insomnia would eventually move away from JSONPath towards something more functional and backwards compatible like JSONata
@jackkav - Could I also get you to take a look at PR?
@jackkav @filfreire @gatzjames @pavkout - Would appreciate some feedback on this PR as well. Thanks!
Thanks for the contribution, would be great to support something besides JSONPath too. jq has also been suggested but would require another native module which we aren't open to right now, but JSONata seems easier to adopt. It's not on our list right now but would be happy to help push forward a community contribution!
@sebastianjonasson you can claim a free tshirt for this PR contribution - find more at https://konghq.com/community/open-source-contribution