mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-26 01:06:00 +03:00
[GH-ISSUE #5515] [feature]: Custom Variable Priority #2123
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#2123
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 @tldzyx on GitHub (Oct 26, 2025).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/5515
Is there an existing issue for this?
Summary
Features/Variables
Is there any way let sort change to bottom in order to support collection variable as default?
In my context, I will switch many host/port with the same request, it's work rigth in postman, but not in hoppscotch
Why should this be worked on?
for example: http://{{host}}:{{port}}{{prefix}}/a/b/c
I want set the collection variable point to the shared service as default export to my classmate, but I need switch environment let it point to my different devices, or the api has bug, my classmate need switch to my computer help me debug
@jazuntee commented on GitHub (Dec 20, 2025):
Setting a custom variable priority would certainly address what I am trying to do as well but could also make sharing collections much harder or more confusing because different collections might assume different priority handling. You could store the custom priority handling in the collection so an export/import would keep the intended order but now you lost the consistency of understanding which variables will be used. I think the default priority should actually be changed to allow this default value scenario.
Both Postman and Insomnia let you select an environment with higher priority than Collection. Insomnia actually has two environment slots so you can set environment variables before or after Collection scope resolution.
https://learning.postman.com/docs/sending-requests/variables/variables/#variable-scopes
https://developer.konghq.com/insomnia/environments/#environment-priority
To avoid breaking requests that already assume collection variables override environment variables. I propose another environment slot scope be introduced with higher priority than Collection so the user could choose which Environment variable set goes before and which comes after Collection resolution similar to Insomnia.
Environment scope is the only easily swappable variable set where you can have multiple options.
While Global, Collection, and Request scopes are fairly static because they can only have a single set of variables and only Request allows toggling individual variables on or off without removing the variable entirely. This makes setting defaults in a collection impossible to override based on environment which is quite limiting, and I suspect that is why Postman and Insomnia allow environment variables that can override Collection scope.
A simple example would be calling the OIDC config endpoint for Microsoft Entra ID. I want:
Collection Variables (Static list of variables for collection with default values):
Collection Environment Variables (easily swappable for different environments):