Allow environment files to be loaded from a file and not from vscode settings because of which I can't version control it for now.
@pyros2097 nice suggestion, and I will consider this carefully.
@pyros2097 one problem I found is that, in order to know the content of your environment file change, I need to watch this file change in my extension. And in vscode setting file, which I can get the update notification directly. So I'd like to put it in backlog.
I thought you would load the environment file on every request and then inject it into the request params.
Anyways .. Thats great. no prob. I was trying to use this tool and format for some sort of api versioning for REST based api's using git which I don't think any current tool does well.
Thanks for your suggestion, and always waiting for your feedback ๐
@pyros2097 I love this idea! We use postman right now, but have been waiting for custom variables. Now that they are finally here, we would love to be able to put variables in a separate file.
@Huachao Our use case may be a little more complex, and I think a simple solution is to do what @pyros2097 is suggesting, just load the config file on every request and do not watch a certain file for changes. The reason for this is simple...We want multiple environment files.
We have a structure like this:
โโโ .restrc
โโโ api.http
โโโ employees
โ โโโ .restrc
โ โโโ employees.http
โโโ orders
โโโ .restrc
โโโ orders.http
2 directories, 6 files
If, for example, the environment variables files were named .restrc (I don't really care what they're named) we can now have simpler files. This is ultimately the goal. Right now our api.http file is very, VERY large, and we could split it up, but now we are duplicating everything.
It would be nice in the settings to set maybe a global environment variable that would point to a specific file and then have the ability to put a local file, next to, the api.http files. Anything in the local files would overwrite the global one.
I guess you could watch a global environment file, but it would get crazy to try a watch all the .restrc files, especially if they could exist anywhere.
@richarddavenport nice, thanks for your interesting idea, I will consider it with existing design carefully.
Sharing the environment in SCM with my colleagues is pretty important. Please take it into consideration.
Great plugin, I like it very much. Thanks.
@Huachao any thoughts on this?
I saw this kind of functionality being available in GoLand as HTTP client, which my colleagues are using, and while your extension covers most of use cases, it is missing the ability to read the environment setup from a JSON file (in our case we have test.http file with requests and env.json file with environments).
For now I have to manually copy-paste it from the env.json into my VSCode project's settings.json which seems as unnecessary work.
Hello sorry for pinging you directly @Huachao but is there any status update on this? Is this in backlog already or is the design / technical architecture still in consideration? Would love to help work on this if needed!
I understand .env files can be read now, but user's might want to name it differently or what not, so I think it is more of allowing them to specify a custom file name / path?
This is related #125 if I am not wrong?
Most helpful comment
@pyros2097 I love this idea! We use postman right now, but have been waiting for custom variables. Now that they are finally here, we would love to be able to put variables in a separate file.
@Huachao Our use case may be a little more complex, and I think a simple solution is to do what @pyros2097 is suggesting, just load the config file on every request and do not watch a certain file for changes. The reason for this is simple...We want multiple environment files.
We have a structure like this:
If, for example, the environment variables files were named
.restrc(I don't really care what they're named) we can now have simpler files. This is ultimately the goal. Right now our api.http file is very, VERY large, and we could split it up, but now we are duplicating everything.It would be nice in the settings to set maybe a global environment variable that would point to a specific file and then have the ability to put a local file, next to, the
api.httpfiles. Anything in the local files would overwrite the global one.I guess you could watch a global environment file, but it would get crazy to try a watch all the
.restrcfiles, especially if they could exist anywhere.