Having environment variables defined in VSCode setting works, but is awkward when you are working on a multi-person project since it's harder to share the settings with your colleagues, save them in Git, version them, etc.
Would be really nice if there was a way to load different environments from a separate file rather than settings.
Maybe some way to set the environment file in the rest-client script, then select which actual environment you want the same way it works now (lower right of the VSCode window)
You can use the .vscode workspace settings file for this use case, but that is less than ideal since it requires that you keep a hidden folder in your Git repo, and that all your collaborators use the exact same workspace settings which are much broader than just rest-client settings. Being able to save the environments in a file that is stored next to the .http/.rest file that imports it would be much cleaner.
+1
+1
Maybe just recurse up from http files finding a environment.json that overrides it's parent?
Have you looked at the dotenv variables like {{$dotenv USERNAME}}?
@mchelen-gov That only works from the same folder as where the files are in.
Also, it doesn't allow you to change environments using the editor UI. You'll end up having "environment-a.env" and renaming them when you need them.
Yes please. This would be great timesaver when sharing a .http collection.
Most helpful comment
@mchelen-gov That only works from the same folder as where the files are in.
Also, it doesn't allow you to change environments using the editor UI. You'll end up having "environment-a.env" and renaming them when you need them.