Kong / insomnia

The open-source, cross-platform API client for GraphQL, REST, WebSockets, SSE and gRPC. With Cloud, Local and Git storage.
https://insomnia.rest
Apache License 2.0
33.72k stars 1.88k forks source link

[Feature Request] Add hook to allow plugins to edit the URL Preview in the Query tab #4037

Open ConnorJennison opened 2 years ago

ConnorJennison commented 2 years ago

It would be nice to allow plugins to be able to edit the URL Preview under the Query tab. More specifically I have been using the insomnia-plugin-path-parameters plugin which allows you to add URL query params but then edit the values of those in the query params section of insomnia. However, the only issue is it doesn't update the URL Preview, so you end up with the below.

image

Even though the URL Preview looks improper, the api call works as expected and replaces :id in the url with the query parameter defined in the section below I saw an issue the plugin repo here where the maintainer said there was no hook to replace the URL Preview, so it would be nice to allow plugins to do that if it doesn't cause any issues.

Thank you!

ESA2012 commented 2 years ago

I stopped using plugins for path variables.

  1. Just add Query parameter tag in your path
  2. Edit tag: enter query parameter name (for example "userId")
  3. Add query parameter "userId" and its value
  4. Disable query parameter to avoid adding ?userId=... to your request URL

In this case you can use disabled query params as path variables and enabled ones as common query params.

2022-03-10_13-46