[Feature Request] Add templates or default values for variables
- Dominant language
- TypeScript
- Stars
- 40k
- Forks
- 2.4k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 61
Description
- Insomnia Version: ___ 7.0.3
- Operating System: ___ Linux
## Details
This is perhaps best explained via some workflow examples.
Say I have a set of api calls to make in a particular order. These calls can be authenticated, or not. *Here in lies my problem*
If I write the requests so that they take the authentication token from a Login response...then those requests do not work for unauthenticated flows. I would need to duplicate all of those apis. What I really want is to be able to set in the template something like: if this value isn't here, use this default value (in this example the default value would be nothing, for unauthenticated).
This then brings me to another potential problem. Once I've tested an authenticated flow, I have no way to "log out", or clear the value.
What are the suggested ways around this problem?
From my limited view, the easiest way would be to two things
1) Have the ability to specify a default value if no value found via the filtering.
2) Have a button to click to clear out populated values so to be able to start with a clean slate. The Clear History mechanism does cover this, although it requires you to click back the previous request you made, clear it's history, then go back to the request you are intending to make...
Contributor guide
Research direction
Start by reviewing the template-variable filtering flow and the Clear History mechanism described in the issue. Clarify how missing values should fall back and how authenticated values should be cleared, then define the affected request workflows and tests needed to verify both authenticated and unauthenticated calls.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100