I setup an example config project (https://github.com/lorenzbaier/spring-config-server-client-test/blob/spring-bootrap-binder-case-sensitive/client/src/main/resources/application.yml)
The config looks like the following:
my-config-base:
passWord: dummy-password-needed
another-value: dummy-password-needed
another-config:
value1: ${my-config-base.pass-word}
value2: ${my-config-base.another-value}
value3: ${my-config-base.passWord}
value4: ${my-config-base.anotherValue} # DOES NOT WORK because casing seems to be broken in binder
This will then result in the following:
LOOK HERE AT THIS config: AnotherConfig(value1=dummy-password-needed, value2=dummy-password-needed, value3=dummy-password-needed, value4=${my-config-base.anotherValue})
Notice that value4 could not be bound but all the other combinations work
Comment From: philwebb
This is expected behavior because those references are loaded in the same way as @Value(...)
. You can refer to other values in their original form (${my-config-base.passWord}
) or in kebab case (${my-config-base.pass-word}
, ${my-config-base.another-value}
).
There is a small note about this in the documentation.