From 40f4c8960235ddffbc221a77c0abe9f270f91dc5 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Wed, 12 Apr 2017 11:15:24 +0200 Subject: [PATCH] Document list merge restrictions with YAML Closes gh-6911 --- .../src/main/asciidoc/spring-boot-features.adoc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc b/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc index 108f7b1d4b..e2ee3d50fa 100644 --- a/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc +++ b/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc @@ -666,6 +666,22 @@ with a mutable value, e.g. this will bind to the properties above } ---- +[NOTE] +==== +Extra care is required when configuring lists that way as overriding will not work as you +would expect. In the example above, when `my.servers` is redefined in several places, the +individual elements are targeted for override, not the list. To make sure that a +`PropertySource` with higher precedence can override the list, you need to define it as +a single property: + +[source,yaml,indent=0] +---- + my: + servers: dev.bar.com,foo.bar.com +---- + +==== + [[boot-features-external-config-exposing-yaml-to-spring]]