From cc95f734d7cc8df61b5884cd2a98771d3b795b80 Mon Sep 17 00:00:00 2001 From: Madhura Bhave Date: Wed, 23 Feb 2022 15:09:15 -0800 Subject: [PATCH] Clarify relation of import path to resultant properties in configtree import data Closes gh-29606 --- .../src/docs/asciidoc/features/external-config.adoc | 3 +++ 1 file changed, 3 insertions(+) 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 8aae074af728..d921d451015d 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 @@ -386,6 +386,9 @@ 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. +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. For example, in the above example, a file named `myapp.username` in `/etc/config` would result in a `myapp.username` property in the `Environment`.