I have a map in my YAML file:
custom:
map:
'[A]': B
But in some situations, I would like to set this map with an env variable value. Let's say we have:
export ENV_VAR="key:value"
YAML file allows us to use env variable interchangeably with some default value, here's an example with a single field key-value:
custom:
uri: ${ENV_VAR:https://google.com}
So, the question here is how can I use the env variable in YAML interchangeably with the default value for maps? The code I want to work out:
custom:
map: ${ENV_VAR:'[key]':value}