Skip to content

Commit 14a0064

Browse files
committed
Merge branch '2.0.x'
2 parents d958e83 + 660d284 commit 14a0064

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1112,6 +1112,24 @@ property name
11121112
TIP: We recommend that, when possible, properties are stored in lower-case kebab format,
11131113
such as `my.property-name=acme`.
11141114

1115+
When binding to `Map` properties, if the `key` contains anything other than lowercase
1116+
alpha-numeric characters or `-`, you need to use the bracket notation so that the original
1117+
value is preserved. If the key is not surrounded by `[]`, any characters that are not alpha-numeric
1118+
or `-` are removed. For example, consider binding the following properties to a `Map`:
1119+
1120+
[source,yaml,indent=0]
1121+
----
1122+
acme:
1123+
map:
1124+
"[/key1]": value1
1125+
"[/key2]": value2
1126+
/key3: value3
1127+
1128+
----
1129+
1130+
The properties above will bind to a `Map` with `/key1`, `/key2` and `key3` as the keys in the map.
1131+
1132+
11151133
[[boot-features-external-config-complex-type-merge]]
11161134
==== Merging Complex Types
11171135
When lists are configured in more than one place, overriding works by replacing the entire

0 commit comments

Comments
 (0)