@@ -815,20 +815,21 @@ The annotation processor also supports the use of the `@Data`, `@Getter`, and `@
815
815
lombok annotations.
816
816
817
817
818
- The annotation processor cannot auto-detect default values for ``Enum``s and ``Collections``s.
819
- In the cases where a `Collection` or `Enum` property has a non-empty default value,
820
- <<configuration-metadata-additional-metadata,manual metadata>> should be provided.
818
+ The annotation processor cannot auto-detect default values for ``Enum``s and
819
+ ``Collections``s. In the cases where a `Collection` or `Enum` property has a non-empty
820
+ default value, <<configuration-metadata-additional-metadata,manual metadata>> should be
821
+ provided.
821
822
822
823
Consider the following class:
823
824
824
825
[source,java,indent=0,subs="verbatim,quotes,attributes"]
825
826
----
826
- @ConfigurationProperties(prefix="rabbit ")
827
- public class RabbitProperties {
827
+ @ConfigurationProperties(prefix="acme.messaging ")
828
+ public class MessagingProperties {
828
829
829
830
private List<String> addresses = new ArrayList<>(Arrays.asList("a", "b")) ;
830
831
831
- private ContainerType = ContainerType.SIMPLE;
832
+ private ContainerType = ContainerType.SIMPLE;
832
833
833
834
// ... getter and setters
834
835
@@ -843,21 +844,27 @@ Consider the following class:
843
844
}
844
845
----
845
846
846
- In order to document default values for properties in the class above, you could add the following
847
- JSON to <<configuration-metadata-additional-metadata,the manual metadata of the module>>:
847
+ In order to document default values for properties in the class above, you could add the
848
+ following content to <<configuration-metadata-additional-metadata,the manual metadata of
849
+ the module>>:
848
850
849
851
[source,json,indent=0]
850
852
----
851
- {
852
- "name": "rabbit.addresses",
853
- "defaultValue": "a, b"
854
- },
855
- {
856
- "name": "rabbit.container-type",
857
- "defaultValue": "simple"
858
- }
853
+ {"properties": [
854
+ {
855
+ "name": "acme.messaging.addresses",
856
+ "defaultValue": ["a, b"]
857
+ },
858
+ {
859
+ "name": "acme.messaging.container-type",
860
+ "defaultValue": "simple"
861
+ }
862
+ ]}
859
863
----
860
864
865
+ Only the `name` of the property is required to document additional fields with manual
866
+ metadata.
867
+
861
868
862
869
[NOTE]
863
870
====
0 commit comments