You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As long as the MyClientProperties class is local to my spring-boot project, the spring-boot-configuration-processor is able to generate metadata for each prefix I use. In particular, the description and defaultValue metatdata is extracted from the field level javadoc of the class:
publicclassMyClientProperties {
/** * Web service remote endpoint url */publicStringendpoint = "http://localhost:8080/services";
...
}
This changes as soon as the class is moved to an external jar dependency in order to be shared among several projects and the spring-boot-configuration-processor has no access to the source code of the properties type. The description and defaultValue metadata is no longer available.
If MyClientProperties would be used with a fixed prefix only, I could run the spring-boot-configuration-processor within the external jar module and package the generated metatdata.json file. The generated metadata would be visible in the context of the consuming spring-boot application under the my-client prefix.
What I need is a mechanism to access the description and defaultValue metatdata from the externally provided properties class below the dynamic prefixes chosen by the consuming spring-boot application.
Note: I submited a question at StackOverflow, but in the meantime I think this is most likely an enhancement request.
The text was updated successfully, but these errors were encountered:
Please take a look at the official documentation, it's well written there.
Edit: Hint - you have to add the spring-boot-configuration-processor as a optional dependency to your jar containing the configuration
I use the configuration properties feature to bind properties multiple times using different prefixes which are dynamic in nature.
As long as the
MyClientProperties
class is local to my spring-boot project, thespring-boot-configuration-processor
is able to generate metadata for each prefix I use. In particular, thedescription
anddefaultValue
metatdata is extracted from the field level javadoc of the class:The generated metadata
This changes as soon as the class is moved to an external jar dependency in order to be shared among several projects and the
spring-boot-configuration-processor
has no access to the source code of the properties type. Thedescription
anddefaultValue
metadata is no longer available.If
MyClientProperties
would be used with a fixed prefix only, I could run thespring-boot-configuration-processor
within the external jar module and package the generated metatdata.json file. The generated metadata would be visible in the context of the consuming spring-boot application under themy-client
prefix.What I need is a mechanism to access the
description
anddefaultValue
metatdata from the externally provided properties class below the dynamic prefixes chosen by the consuming spring-boot application.Note: I submited a question at StackOverflow, but in the meantime I think this is most likely an enhancement request.
The text was updated successfully, but these errors were encountered: