bruno icon indicating copy to clipboard operation
bruno copied to clipboard

Prettify not working when “JSON body” contains variable

Open bogmart opened this issue 1 year ago • 4 comments

Hello, I noticed a bug related to “Prettify” functionality when I put variables in a “JSON body”.

Example: I have a variable named " input_idx" (it is an integer). The “Prettify” for this “JSON body” is not possible: {"method": "test", "params": {"input" : {{input_idx}} }}

Screenshot (251)_bruno_err

Tested with Bruno v1.8.0 on Ubuntu 22.04.

bogmart avatar Feb 08 '24 20:02 bogmart

Are you actually able to access the variable? I can't manage to get bruno to work at all if I pass a variable the way you did

nlassaux avatar Mar 17 '24 21:03 nlassaux

Are you actually able to access the variable? I can't manage to get bruno to work at all if I pass a variable the way you did

Yes, the variable is correctly expanded/replaced by Bruno with its value (in my case, Bruno sends a HTTP POST). Only the prettify functionality is affected. I just retested with Bruno v1.11.0, on WSL Ubuntu 22.04.

bogmart avatar Mar 17 '24 21:03 bogmart

Got it, thanks. Super weird, in my case Bruno sends the variable with the curly brackets to the backend. I'm closely monitoring #1812 in case that fixes it at the same occasion

nlassaux avatar Mar 17 '24 23:03 nlassaux

Update: on version v1.17.0, the prettify generates an invalid JSON from my example.

{
  "method": "test",
  "params": {
    "input": {
      {input_idx
      }
    }
  }
}

bogmart avatar May 10 '24 10:05 bogmart

Also see https://github.com/usebruno/bruno/issues/3019

PR - #5113 has been merged that fixes this issue. This will be available in our upcoming - v2.14.0 release scheduled to go out in last week of October

helloanoop avatar Oct 18 '25 17:10 helloanoop