-
Notifications
You must be signed in to change notification settings - Fork 41.6k
Closed
Labels
status: supersededAn issue that has been superseded by anotherAn issue that has been superseded by anothertype: enhancementA general enhancementA general enhancement
Description
At the moment, the configuration properties annotation processor harvests property descriptions from a class's fields. This doesn't work well with records as they don't have fields. It'd be nice if we could devise some other way of harvesting property descriptions from the record's source. At the moment, you have to use additional metadata instead.
One possibility may be to read the @param
s from the record-level javadoc:
/**
* @param someProperty An example property to be described in the metadata.
*/
@ConfigurationProperties(prefix = "record")
public record MyRecordProperties(String someProperty) { }
In this example, we already generate metadata for someProperty
:
{
"name": "record.some-property",
"type": "java.lang.String",
"sourceType": "com.example.recordconfigpropstest.MyRecordProperties"
}
What we're aiming for is having a description
as well:
{
"name": "record.some-property",
"type": "java.lang.String",
"description": "An example property to be described in the metadata.",
"sourceType": "com.example.recordconfigpropstest.MyRecordProperties"
}
Metadata
Metadata
Assignees
Labels
status: supersededAn issue that has been superseded by anotherAn issue that has been superseded by anothertype: enhancementA general enhancementA general enhancement