-
Notifications
You must be signed in to change notification settings - Fork 967
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Interpolation within array contantenation does not always work #339
Comments
Naming the first configuration as
|
So there was a bug in toString of ConfigDelayedMerge, which created a misleading error message. I just fixed that on master. With that fixed, we get the correct error message and this turns out to be the same problem as #332 I believe.
|
Here's a version of the test case without any external files: val replacements = ConfigFactory.parseString("""
replacement_a = a
replacement_b = b
""")
val arrayInterpolation = """
some_array = []
some_array += {
replaced_a = ${replacement_a}
}
some_array += {
replaced_b = ${replacement_b}
}
"""
@Test
def interpolationWithinArrayConcatenation(): Unit = {
val fromClasspath = ConfigFactory.load(ConfigFactory.parseString(arrayInterpolation, ConfigParseOptions.defaults()), ConfigResolveOptions.defaults().setAllowUnresolved(true))
val withSubstitutions = fromClasspath.resolveWith(replacements, ConfigResolveOptions.defaults())
val config = replacements.withFallback(withSubstitutions).resolve()
} |
Trying to load configuration from a file that has the following :
Where replacement_a & replacement_b are provided via another configuration object (I use
configFromClasspath.resolveWith(anotherConfig, ConfigResolveOptions.defaults())
)I get com.typesafe.config.ConfigException$NotResolved: called unwrapped() on value with unresolved substitutions, need to Config#resolve() first, see API docs
But when I modify the configuration to:
It works fine.
Also I see no issues when parsing the configuration String directly.
The text was updated successfully, but these errors were encountered: