From 7d63faac7cde17eabc92133cfb2df5cbc235b0e9 Mon Sep 17 00:00:00 2001 From: Madhura Bhave Date: Tue, 8 Mar 2022 18:05:14 -0800 Subject: [PATCH] Document the scalar types supported by MapBinder Closes gh-27581 --- .../src/docs/asciidoc/features/external-config.adoc | 5 ++++- 1 file changed, 4 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 659a3f3c49..dc426237c3 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 @@ -918,7 +918,10 @@ NOTE: For YAML files, the brackets need to be surrounded by quotes for the keys The properties above will bind to a `Map` with `/key1`, `/key2` and `key3` as the keys in the map. The slash has been removed from `key3` because it wasn't surrounded by square brackets. -You may also occasionally need to use the bracket notation if your `key` contains a `.` and you are binding to non-scalar value. +When binding to scalar values, keys with `.` in them do not need to be surrounded by `[]`. +Scalar values include enums and all types in the `java.lang` package except for `Object`. +Binding `a.b=c` to `Map` will preserve the `.` in the key and return a Map with the entry `{"a.b"="c"}`. +For any other types you need to use the bracket notation if your `key` contains a `.`. For example, binding `a.b=c` to `Map` will return a Map with the entry `{"a"={"b"="c"}}` whereas `[a.b]=c` will return a Map with the entry `{"a.b"="c"}`.