Which value does Insomnia send when {{apiUrl}} exists in both base and active environments?
0 reputation · 08 May 2021, 16:49 UTC
I am standardizing a repeatable API development workflow in Insomnia using named environments and {{variable}} substitution across development, staging, and production. My workspace defines a base variable such as {{apiUrl}}, and each named environment also defines {{apiUrl}} with a different value.
I need to know which value Insomnia actually sends when the same key exists in both the shared base scope and the currently selected environment. I also need to know whether changing the active environment re-evaluates variables in requests that were already saved, or whether the substitution is fixed at request creation time. Behavior may differ between Insomnia Core and newer Kong-branded releases, and exported workspace files may store these values plaintext.
Which scope takes precedence for duplicate variable keys? Does switching environments re-substitute variables in existing requests? Are duplicate environment variables written as plaintext in exported JSON or YAML files?