From 0ab7129dab93e321451bf38a43640a758de33be5 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Tue, 8 Aug 2023 16:49:21 +0100 Subject: [PATCH] Clarify treatment of nested directories for configtree with wildcards Closes gh-28203 --- .../src/docs/asciidoc/features/external-config.adoc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/external-config.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/external-config.adoc index b6ae899f57..09acb2fbf1 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/external-config.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/external-config.adoc @@ -385,7 +385,7 @@ To import these properties, you can add the following to your `application.prope You can then access or inject `myapp.username` and `myapp.password` properties from the `Environment` in the usual way. -TIP: The folders under the config tree form the property name. +TIP: The names of the folders and files under the config tree form the property name. In the above example, to access the properties as `username` and `password`, you can set `spring.config.import` to `optional:configtree:/etc/config/myapp`. NOTE: Filenames with dot notation are also correctly mapped. @@ -395,6 +395,7 @@ TIP: Configuration tree values can be bound to both string `String` and `byte[]` If you have multiple config trees to import from the same parent folder you can use a wildcard shortcut. Any `configtree:` location that ends with `/*/` will import all immediate children as config trees. +As with a non-wildcard import, the names of the folders and files under each config tree form the property name. For example, given the following volume: