When using a property with a placeholder like

    domain:
      test:
        second: "${domain.test.first}"

and the referred property is resolved as a default value of a @ConfigurationProperties

@Getter
@ConfigurationProperties("domain.test")
public static class SampleProperties {
    String first = "defaultFirstVarValue";
}

it looks like Spring Boot (latest 2.7) is not smart enough to know you want in "second" var, the default value of "first" This scenario is exactly the same when use it through @Value("${domain.test.second}")

Is this by design or a bug? If the first, could the new behaviour be considerable?

Comment From: wilkinsona

When placeholders are being resolved in the property's value, they're resolved against the Environment. These resolved values are then bound to the @ConfigurationProperties classes. I don't think this can be changed to behave as you would like as it would require the inputs to configuration property binding (fully resolved property values) to consume the default values of configuration property binding. This would create a cycle in the binding process.

Comment From: nightswimmings

Ok! Thanks for the fast-answer!