usebruno / bruno

Opensource IDE For Exploring and Testing Api's (lightweight alternative to postman/insomnia)
https://www.usebruno.com/
MIT License
25.67k stars 1.17k forks source link

Nested vars support? #2456

Closed darcien closed 3 months ago

darcien commented 3 months ago

I have checked the following:

Describe the bug

Variable value is not resolved when used in another variable.

See how the variable sent in the request is the literal text written in vars: image

Hovering cursor on the nested variable does show the actual variable value: image

If Bruno does support nested variable, then the nested variable value should be resolved before the request is sent.

If not, the variable input should not indicate it's resolving to the referenced variable. And docs for vars might need to be updated to note this behavior.

.bru file to reproduce the bug

meta {
  name: Example
  type: http
  seq: 5
}

get {
  url: https://example.com?q={{hello}}
  body: none
  auth: none
}

query {
  q: {{hello}}
}

vars:pre-request {
  foo: bar
  hello: world-{{foo}}
}

Screenshots/Live demo link

image

sanjai0py commented 3 months ago

Duplicate of #956

darcien commented 3 months ago

Apologies, my search keyword was vars, I didn't see that one.