thunderclient / thunder-client-support

Thunder Client is a lightweight Rest API Client Extension for VS Code.
https://www.thunderclient.com
Other
3.64k stars 128 forks source link

JSON Path queries #101

Open Rzublin opened 3 years ago

Rzublin commented 3 years ago

Describe the solution you'd like Insomnia offers a way to filter the response using JSON Path. It would be great if the Thunder Client had a similar feature.

rangav commented 3 years ago

Hi @Rzublin can you post a clear example for my understanding, and what is the usecase and how it’s useful to you.

mruknowme commented 3 years ago

@rangav I would also find this feature useful.

Basically, it allows to filter JSON response body using JSON Path. For example, imaging a huge GeoJSON (I am assuming you are familiar with GeoJSON format) FeatureCollection. If a user would like to view/copy only certain properties from large response he could type $.features[*].properties.name and the live preview of the body would show a flat array of names from deeply nested features[].properties.

If my explanation is confusing (it most likely is), then just download Insomnia, make a request to any JSON data and use the very bottom right field to filter the json response in real-time.

nametable commented 3 years ago

I am interested in this too. Is there an easy way to do this? I figured I could just Ctrl-F and it would do jsonPath or something

FaiyazMujawar commented 1 year ago

@rangav This feature would be very helpful for a lot of developers

rangav commented 1 year ago

@FaiyazMujawar we already support standard json queries

see here https://github.com/rangav/thunder-client-support/releases/tag/v2.0.2

And also supports filters for advanced operations https://github.com/rangav/thunder-client-support/blob/master/docs/filters.md

metawops commented 7 months ago

I'd love to be able to use JSONpath expressions for fitlering a JSON response, too.

Currently, as I understand it (please correct me if I'm wrong), the "filter" functionality of ThunderClient is tied to tests/testing.

However, I don't want to test if a certain thing is present or the count is right etc.

I just want to be able to apply some kind of search pattern (and JSONpath allows for many fancy things here) to extract the things I'm interested in from the JSON response – and save that to a file or open it directly in a new VSCode tab.

Also, the JSONpath expressions I would apply to a response should be saveable because I don't want to type them in every time again. 😉

Live preview of applying a JSONpath expression would be neat and helpful, too.