Environment variables support
Issue #483
invalid
using this technique : https://bitbucket.org/asomov/snakeyaml/wiki/Variable substitution
I can substitute environment VAR with value
var: ${VAR-test}
But I cannot with
var: Value before ${VAR-test}
Even with specifying null as “first”
yaml.addImplicitResolver(EnvScalarConstructor.ENV_TAG, EnvScalarConstructor.ENV_FORMAT, null)
because ENV_FORMAT
pattern is matching the start of line followed by $
public static final Pattern ENV_FORMAT = Pattern.compile("^\\$\\{\\s*((?<name>\\w+)((?<separator>:?(-|\\?))(?<value>\\w+)?)?)\\s*\\}$");
Comments (2)
-
-
- changed status to invalid
We cannot help if you do not answer questions.
- Log in to comment
The documentation from the link you provided explicitly says:
Since SnakeYAML is no template engine, it does not substitute parts of scalar,
If you think it can be improved - the pull request is welcome !