I am using spring-boot-configuration-processor to generate a spring-configuration-metadata.json file.
When I use a class for my configuration, the description is taken from the javadoc above the field like in this example using Lombok:
@Getter
@ConfigurationProperties("my.second.properties")
public class MySecondProperties {
/**
* This is the description for stringProperty
*/
private final String stringProperty;
/**
* This is the description for booleanProperty
*/
private final boolean booleanProperty;
public MySecondProperties(@DefaultValue("default value for stringProperty") String stringProperty,
boolean booleanProperty) {
this.stringProperty = stringProperty;
this.booleanProperty = booleanProperty;
}
}
However, when using records I do not manage to get the description. I have created a record as in the example below, but the description remains empty in the generated json-file.
/**
* @param stringProperty This is the description for stringProperty
* @param booleanProperty This is the description for booleanProperty
*/
@ConfigurationProperties("my.fourth.properties")
public record MyFourthProperties (@DefaultValue("default value for stringProperty") String stringProperty,
boolean booleanProperty) {
}
How can I ensure that the description is filled when using records?