rest-book icon indicating copy to clipboard operation
rest-book copied to clipboard

add vscode settings to variables

Open RandomFractals opened this issue 3 years ago • 5 comments

could be exposed similar to secrets in #78

My use case:

I have an extension I am working on that requires REST API host and a few other settings. In general, similar extensions allow to set those settings in user or workspace configuraiton files.

I would like to be able to use and access them in REST Book cells for queries without the need to change target host in my test notebook and all of the rest call cells.

I think this scenario is very common for a typical REST apps workflow.

Would be good to access them with getConfiguration('path.to.setting.key') as vars or something similar in the context of REST book.

RandomFractals avatar Apr 25 '21 16:04 RandomFractals

Just to clarify, you'd like to pull from your current vscode settings into REST calls? or you'd like to add and use settings through the extension?

tanhakabir avatar Apr 26 '21 15:04 tanhakabir

pull existing settings into REST calls.

For example, I might be testing dev or staging env.

I have xyz.api.host setting set in vscode. That config is different for dev or staging env.

I would like to use that as a variable and when I change that setting all REST calls would still work, but I'll be hitting a different server :)

I believe it's a very common scenario when working with REST APIs and testing or comparing different environments.

RandomFractals avatar Apr 26 '21 16:04 RandomFractals

And would you want an UI to edit your settings or would you rather just edit your settings on your own?

tanhakabir avatar Apr 26 '21 18:04 tanhakabir

nah, I like the built-in Settings editor.

RandomFractals avatar Apr 26 '21 18:04 RandomFractals

cool! Should be easy enough then!

tanhakabir avatar Apr 26 '21 18:04 tanhakabir