Add tip about using @Name to rename constructor bound property

Closes gh-41577
This commit is contained in:
Andy Wilkinson
2024-07-23 09:08:42 +01:00
parent 61dc82d836
commit 9bb0c45ddb

View File

@@ -749,6 +749,8 @@ NOTE: The use of `java.util.Optional` with `@ConfigurationProperties` is not rec
As such, it is not well-suited to configuration property injection.
For consistency with properties of other types, if you do declare an `Optional` property and it has no value, `null` rather than an empty `Optional` will be bound.
TIP: To use a reserved keyword in the name of a property, such as `my.service.import`, use the `@Name` annotation on the constructor parameter.
[[features.external-config.typesafe-configuration-properties.enabling-annotated-types]]