EnvFile icon indicating copy to clipboard operation
EnvFile copied to clipboard

Support JetBrains HTTP client env file format

Open medmunds opened this issue 3 years ago • 1 comments

Feature request: support using JetBrains HTTP client environment files as EnvFile sources. This would allow sharing the same env between the IDE's bundled HTTP client and run configurations.

JetBrains HTTP client env files are JSON, but they contain multiple named environments, each with its own set of environment variables. Example:

{
  "development": {
    "API_KEY": "dev-key",
    "DB_HOST": "localhost:3136"
  },
  "production": {
    "API_KEY": "prod-key",
    "DB_HOST": "db1.example.com"
  }
}

It might be possible to detect this format automatically: right now trying to use it with EnvFile results in the error class java.util.LinkedHashMap cannot be cast to class java.lang.String.

But there would also need to be something in the EnvFile panel to choose which environment to load ("development" vs "production" in the example above).

[Thanks for this amazingly helpful plugin, btw.]

medmunds avatar Sep 10 '20 23:09 medmunds

Sound like a great idea! I have very limited time available for maintaining this plugin so cannot promise I'll be able to get to it any time soon, but would welcome a PR!

ashald avatar Sep 02 '21 04:09 ashald