@@ -821,20 +821,21 @@ The annotation processor also supports the use of the `@Data`, `@Getter`, and `@
821
821
lombok annotations.
822
822
823
823
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.
827
828
828
829
Consider the following class:
829
830
830
831
[source,java,indent=0,subs="verbatim,quotes,attributes"]
831
832
----
832
- @ConfigurationProperties(prefix="rabbit ")
833
- public class RabbitProperties {
833
+ @ConfigurationProperties(prefix="acme.messaging ")
834
+ public class MessagingProperties {
834
835
835
836
private List<String> addresses = new ArrayList<>(Arrays.asList("a", "b")) ;
836
837
837
- private ContainerType = ContainerType.SIMPLE;
838
+ private ContainerType = ContainerType.SIMPLE;
838
839
839
840
// ... getter and setters
840
841
@@ -849,21 +850,27 @@ Consider the following class:
849
850
}
850
851
----
851
852
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>>:
854
856
855
857
[source,json,indent=0]
856
858
----
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
+ ]}
865
869
----
866
870
871
+ Only the `name` of the property is required to document additional fields with manual
872
+ metadata.
873
+
867
874
868
875
[NOTE]
869
876
====
0 commit comments