diff --git a/docs/src/main/asciidoc/config-mappings.adoc b/docs/src/main/asciidoc/config-mappings.adoc index 61cb45b483923..f702787756118 100644 --- a/docs/src/main/asciidoc/config-mappings.adoc +++ b/docs/src/main/asciidoc/config-mappings.adoc @@ -417,6 +417,39 @@ server.form.landing-page=index.html The configuration property needs to specify an additional name to act as the key. In this case the `form()` `Map` will contain three elements with the keys `login-page`, `error-page` and `landing-page`. +It also works for groups: +[source,java] +---- +@ConfigMapping(prefix = "server") +public interface Servers { + @WithParentName + Map allServers(); +} + +public interface Server { + String host(); + + int port(); + + String login(); + + String error(); + + String landing(); +} +---- +.application.properties +[source,properties] +---- +server."my-server".host=localhost +server."my-server".port=8080 +server."my-server".login=login.html +server."my-server".error=error.html +server."my-server".landing=index.html +---- +In this case the `allServers()` `Map` will +contain one `Server` element with the key `my-server`. + === Defaults The `@WithDefault` annotation allows to set a default property into a mapping (and prevent and error if the