Typesafe config version: 1.4.3
Summary
When a configuration object uses inheritance, non-optional environment variables are searched for before further file overlays are applied, which breaks file overlays.
Reproduction Steps
Create the following two configuration files:
File: src/main/resources/application.conf
base = {}
child = ${base} {
foo = ${FOOBAR}
}
File: src/test/resources/application.conf
When attempting to run sbt test, the following error will appear:
Caused by: sbt.ForkMain$ForkError: com.typesafe.config.ConfigException$UnresolvedSubstitution:
application.conf @ file:/[...]/target/scala-2.13/classes/application.conf: 248: Could not resolve
substitution to a value: ${FOOBAR}
In contrast, if we change src/main/resources/application.conf to be the following, the error does not appear and child.foo is correctly set to test-foo:
child = {
foo = ${FOOBAR}
}
Expected Behavior
The configuration value for child.foo should be test-foo for both cases.
Actual Behavior
Inheritance breaks the first case.
Typesafe config version: 1.4.3
Summary
When a configuration object uses inheritance, non-optional environment variables are searched for before further file overlays are applied, which breaks file overlays.
Reproduction Steps
Create the following two configuration files:
File:
src/main/resources/application.confFile:
src/test/resources/application.confWhen attempting to run
sbt test, the following error will appear:In contrast, if we change
src/main/resources/application.confto be the following, the error does not appear andchild.foois correctly set totest-foo:Expected Behavior
The configuration value for
child.fooshould betest-foofor both cases.Actual Behavior
Inheritance breaks the first case.