If I include spring-boot-configuration-processor as a dependency, my build will produce a json file like this:
{
"groups": [
{
"name": "attachments",
"type": "com.example.config.AttachmentsSettings",
"sourceType": "com.example.config.AttachmentsSettings"
}
],
"properties": [
{
"name": "attachments.max-size",
"type": "java.lang.Integer",
"sourceType": "com.example.config.AttachmentsSettings",
"defaultValue": 1024
},
{
"name": "attachments.min-size",
"type": "java.lang.Integer",
"sourceType": "com.example.config.AttachmentsSettings"
},
{
"name": "attachments.invalid-chars",
"type": "java.lang.String",
"sourceType": "com.example.config.AttachmentsSettings",
"defaultValue": "abc"
}
],
"hints": []
}
I want to additionally produce a properties file that lists all the properties with their default values like this:
attachments.max-size=1024
attachments.invalid-chars=abc
# attachments.min-size=
Ideally, I'd also like it to list the properties that don't have a default value, but commented out.
Is it possible to do something like this already using Spring Boot? Or will I need to write something myself?