[Question] Env var precedence #268
-
So I have a postman collection which has env vars set at collection, for instance Now when I choose an Environment from the Environment list, this Environment is also set the When calling a request which invoking this
And the question is, what shall be the higher precedence |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Restfox has a defined order: Restfox resolves environment variables from top to bottom. So you can use a workspace env var inside a folder env var. Workspace env:
Folder env:
Resolved Request Env:
Postman's behavior seems incorrect, as immediate parent should take precedence. I'll explain in code let a = 10 // workspace env
{ // folder env
a = 20
{ // sub folder env
a = 30
{
console.log(a) // a should be 30 and not 10
}
}
} |
Beta Was this translation helpful? Give feedback.
Restfox has a defined order:
Workspace (
email: [email protected]
) -> Folder (email: [email protected]
) -> Sub Folder (email: [email protected]
) -> Resolved Request Env (email: [email protected]
)Restfox resolves environment variables from top to bottom. So you can use a workspace env var inside a folder env var.
Workspace env:
Folder env:
Resolved Request Env:
Postman's behavior seems incorrect, as immediate parent should take precedence.
I'll explain in code