-
Notifications
You must be signed in to change notification settings - Fork 978
Open
Description
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
child.foo = "test-foo"
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.
Metadata
Metadata
Assignees
Labels
No labels