-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using dot (.) in variables names are recognized by the UI but not picked up when sending request #345
Comments
Yes, this needs to be fixed. Codemirror shouldn't be highlighting this variable. The |
@helloanoop is it just dots? Do we have some sort of a regex for valid variable names? |
@helloanoop i tried to resolve this bug please review it if possible ! I am happy for any suggestions |
Hey @razzivofficial ! Current and Expected BehaviourCurrently - env vars, request and other vars don't have a very strict validation for naming present. The expectation is that they should follow javascript's variable naming validation which is Variable Names Must Start with a Letter, Underscore (_), or Dollar Sign ($) Unless there is a strong use-case (happy to change my mind if there is one) to name a var with other chars, bruno should use javascript's naming convention. Nested Vars
I have used the nested environments of insomnia in the past and like its benefits of have a base env and other env's extending the base env. The reason why I went ahead with a simple key-val (like postman) was just because of its simplicity. Is there a plan to support nested environments ? Yes, In V2 - see roadmap Changes need to nudge users that the name is invalidTo solve this, We need to show an error when people try to save an environment with an invalid name. I am assuming we can make the table cell color red for invalid names, and disable the save button |
@helloanoop If you want to support some predefined/built-in variables in the future for example as Postman do (https://learning.postman.com/docs/writing-scripts/script-references/variables-list/) which start with |
@helloanoop I see variables using "." have been brought back, however this causes somme issue in the code generator tab. {{baseUrl}} works fine in both requests and code generator tabs, but {{base.url}} only works in requests. What's the current situation regarding these changes ? |
This whole issue around the need for Postman has simple key value pairs, and Insomnia allows nested environments where The reason why Bruno chose go with the simple key value approach was because of simplicity. Not everyone needs nested environments and forcing it by design on everyone didn't seem to be a good idea. That said, we need to figure out a way to support nested environment as well as dot-notation based parsing. I don't have the answer right now, but we should be able to figure it out in the future and come up with an approach. For Ex A different syntax that parses dot notation:
@bpoulaindev We need to fix the code generator. Also, I think the interpolation util is now used across 3 places - UI, Electron and CLI. We can move this into a single package |- bruno-common
| - src
|- interpolation
|- schema
|- query @Its-treason @martinsefcik thoughts ? |
The latest version of Bruno supports If you are interested to see how Bruno handles interpolation, you can see the examples here |
Really great tool! Keep up the good work.
However I found a small bug π
Some variables/placeholders are not picked up by the engine (but are recognized by the UI).
I tested the following:
It does not work globally, so it does not work for url, body or headers.
The text was updated successfully, but these errors were encountered: