insomnia icon indicating copy to clipboard operation
insomnia copied to clipboard

gRPC: Support JSONPath filter for response body

Open sebastianjonasson opened this issue 1 year ago • 3 comments

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:

  1. Make gRPC request (that returns a json payload)
  2. Insert filter in the JSONData input field

Using develop branch:

  • Filter is not applied

Checking out this PR:

  • Filter is applied on response data

sebastianjonasson avatar May 26 '23 09:05 sebastianjonasson

Really wish Insomnia would eventually move away from JSONPath towards something more functional and backwards compatible like JSONata

bbbco avatar May 26 '23 12:05 bbbco

@jackkav - Could I also get you to take a look at PR?

sebastianjonasson avatar Jun 01 '23 12:06 sebastianjonasson

@jackkav @filfreire @gatzjames @pavkout - Would appreciate some feedback on this PR as well. Thanks!

sebastianjonasson avatar Jun 20 '23 10:06 sebastianjonasson

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!

jackkav avatar Jul 14 '23 09:07 jackkav

@sebastianjonasson you can claim a free tshirt for this PR contribution - find more at https://konghq.com/community/open-source-contribution

filfreire avatar Jul 19 '23 16:07 filfreire