mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-25 16:55:59 +03:00
[GH-ISSUE #1029] ENV Variables in request highlighting #363
Labels
No labels
CodeDay
a11y
browser limited
bug
bug fix
cli
core
critical
design
desktop
discussion
docker
documentation
duplicate
enterprise
feature
feature
fosshack
future
good first issue
hacktoberfest
help wanted
i18n
invalid
major
minor
need information
need testing
not applicable to hoppscotch
not reproducible
pull-request
question
refactor
resolved
sandbox
self-host
spam
stale
testmu
wip
wont fix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hoppscotch#363
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @NicOfNoomers on GitHub (Jul 27, 2020).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/1029
Originally assigned to: @AndrewBastin on GitHub.
Is your feature request related to a problem? Please describe.
Trying to use environment variables is pretty difficult, and we never know if a variable is successfully attached to the request
Describe the solution you'd like
If there was some kind of checking with underline or changing text color it would be much easier to identify wrong env. variables
Describe alternatives you've considered
Insomnia Rest does smth like this, as shown in the screenshot
Additional context

Attached Screenshots
@sukheja-varun commented on GitHub (Aug 14, 2020):
I totally agree, in Insomnia it hardly took any time to figure out how env variables work but in postwoman, it is a bit difficult.
I have created an env with few variables but still not able to figure out how to make any env active.
@liyasthomas commented on GitHub (Aug 15, 2020):
Got it. Since
envsare used inline inside an input box (URLfield), it's quite hard to list / highlight registered envs from input. I tried to parseURLinput with some regex to show registered envs in a tooltip but had no luck with it. Will try another method. Let me know if there's any UI wise implementation that could tackle this. May be like auto-complete for envs?@gordolio commented on GitHub (Sep 10, 2020):
Auto-complete is a start, but a custom component that allows you to choose more than just environment variables would be better, I think. Here is an example from the program "Paw".
It auto-completes known environment variables and places them as a "badge".

Here's an example of it grabbing the a jwt token from a login response using a jq filter.

I know how I'd create something like this in React. I'd have a special input component that would have a dual renderer. One function would render how it should appear in the user-interface. The second render function would render how it should be used in a request. The underlying storable data would be an array of different types of blocks (
RawStringBlock,EnvironmentVariableBlock,ResponseParsedBodyBlock, etc...). Then when you click the badge you'd have a popover for changing that particular block.I think it could be done in a similar way in vue.
@liyasthomas commented on GitHub (Sep 10, 2020):
That's great input. Visually, this is something I'd in mind. Let me dig deep into this approach. Will ping you in need of any help ;)
@AndrewBastin commented on GitHub (Sep 10, 2020):
Umm, I am actually working on the implementation of this. Along with a overhaul of the URL parsing system. Just that all new feature work is paused for a while to work on tests and improving the stability and reliability until the Teams feature has rolled out.
@AndrewBastin commented on GitHub (Sep 18, 2020):
Update: Environment variable highlighting is now implemented in the URL field as an Experiment. You can enable the experiment in the settings page. It is not stable yet, but it is on track to be stable soon.
Closing this issue meanwhile.
@yoerriwalstra commented on GitHub (Nov 20, 2020):
I feel a bit dumb for having to ask this, but what is the syntax for using environment variables in your URLs?
I have an environment with variable
base_urlin it, but I can't get my requests to work with it... I couldn't find any examples showcasing this feature, so I had to guess how it should work. I read the discussion in #147 which suggested that Hoppscotch would, like Postman, support nunchucks syntax for environment variables. I've tried different variations, but without success.Example:
@liyasthomas commented on GitHub (Nov 20, 2020):
@yoerriwalstra
Ex:
<<variable_name>>Use environment variables enclosed in double angular brackets (<<>>) anywhere in request section.
@yoerriwalstra commented on GitHub (Nov 20, 2020):
Thanks for the quick reply! And the awesome work you guys are doing :D