Let's say we have an environment variable exported as:
export SOME_STRING_CONFIG_PARAM="01"
and application.properties
with:
some.string.config.param=${SOME_STRING_CONFIG_PARAM:01}
injected to a Java field:
@Value("${some.string.config.param}")
String someStringConfigfParam;
After booting the Spring application printing out the field:
System.out.println("someStringConfigParam: " + someStringConfigParam);
results with:
someStringConfigParam: 1
How to tell Spring that the value should be treated as a String?