@DeprecatedConfigurationProperty must be used on the getter of the deprecated element. For a record, that looks like this:

@ConstructorBinding
@ConfigurationProperties("example")
public record Example(String alpha, String bravo) {

    @Deprecated
    @DeprecatedConfigurationProperty
    public String alpha() {
        return this.alpha;
    }

}

This does not work as the deprecation is not captured in the metadata:

{
  "groups": [
    {
      "name": "example",
      "type": "com.example.demo.Example",
      "sourceType": "com.example.demo.Example"
    }
  ],
  "properties": [
    {
      "name": "example.alpha",
      "type": "java.lang.String",
      "sourceType": "com.example.demo.Example"
    },
    {
      "name": "example.bravo",
      "type": "java.lang.String",
      "sourceType": "com.example.demo.Example"
    }
  ],
  "hints": []
}

Comment From: wilkinsona

In the example above alpha() isn't considered to be a getter for the alpha property as it doesn't match the get… or is… pattern that's currently looked for.