Huachao / vscode-restclient

REST Client Extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=humao.rest-client
MIT License
5.21k stars 433 forks source link

Evaluate {{$processEnv}} in settings.json #511

Open mchelen opened 4 years ago

mchelen commented 4 years ago

It would be great if it were possible to use {{$processEnv}} in settings.json and have their output evaluated. For example:

settings.json

  "rest-client.environmentVariables": {
    "$shared": {},
    "local": {
      "esUri": "http://localhost:9200",
      "esUser": "elastic",
      "esPass": "changeme"
    },
    "dev": {
      "esUri": "http://dev.example.com:9201",
      "esUser": "root",
      "esPass": "{{$processEnv ES_PASSWORD}}"
    },

elasticsearch.http

### cluster health
GET {{esUri}}/_cluster/health?pretty=true
Authorization: Basic {{esUser}} {{esPass}}

There is the {{$processEnv [%]envVarName}} but that does not allow a hardcoded value to exist for some environments, while reading an environment variable for others.

vholmer commented 4 months ago

Bumping this 4 years later, this'd be great.