Skip to content

Commit 704992e

Browse files
committed
Merge branch '2.1.x'
Closes spring-projectsgh-17855
2 parents ccf9b1b + fcf4680 commit 704992e

File tree

1 file changed

+23
-16
lines changed

1 file changed

+23
-16
lines changed

spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix/configuration-metadata.adoc

+23-16
Original file line numberDiff line numberDiff line change
@@ -821,20 +821,21 @@ The annotation processor also supports the use of the `@Data`, `@Getter`, and `@
821821
lombok annotations.
822822

823823

824-
The annotation processor cannot auto-detect default values for ``Enum``s and ``Collections``s.
825-
In the cases where a `Collection` or `Enum` property has a non-empty default value,
826-
<<configuration-metadata-additional-metadata,manual metadata>> should be provided.
824+
The annotation processor cannot auto-detect default values for ``Enum``s and
825+
``Collections``s. In the cases where a `Collection` or `Enum` property has a non-empty
826+
default value, <<configuration-metadata-additional-metadata,manual metadata>> should be
827+
provided.
827828

828829
Consider the following class:
829830

830831
[source,java,indent=0,subs="verbatim,quotes,attributes"]
831832
----
832-
@ConfigurationProperties(prefix="rabbit")
833-
public class RabbitProperties {
833+
@ConfigurationProperties(prefix="acme.messaging")
834+
public class MessagingProperties {
834835
835836
private List<String> addresses = new ArrayList<>(Arrays.asList("a", "b")) ;
836837
837-
private ContainerType = ContainerType.SIMPLE;
838+
private ContainerType = ContainerType.SIMPLE;
838839
839840
// ... getter and setters
840841
@@ -849,21 +850,27 @@ Consider the following class:
849850
}
850851
----
851852

852-
In order to document default values for properties in the class above, you could add the following
853-
JSON to <<configuration-metadata-additional-metadata,the manual metadata of the module>>:
853+
In order to document default values for properties in the class above, you could add the
854+
following content to <<configuration-metadata-additional-metadata,the manual metadata of
855+
the module>>:
854856

855857
[source,json,indent=0]
856858
----
857-
{
858-
"name": "rabbit.addresses",
859-
"defaultValue": "a, b"
860-
},
861-
{
862-
"name": "rabbit.container-type",
863-
"defaultValue": "simple"
864-
}
859+
{"properties": [
860+
{
861+
"name": "acme.messaging.addresses",
862+
"defaultValue": ["a, b"]
863+
},
864+
{
865+
"name": "acme.messaging.container-type",
866+
"defaultValue": "simple"
867+
}
868+
]}
865869
----
866870

871+
Only the `name` of the property is required to document additional fields with manual
872+
metadata.
873+
867874

868875
[NOTE]
869876
====

0 commit comments

Comments
 (0)