@@ -820,6 +820,51 @@ is detected even if only a getter is present).
820
820
The annotation processor also supports the use of the `@Data`, `@Getter`, and `@Setter`
821
821
lombok annotations.
822
822
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.
827
+
828
+ Consider the following class:
829
+
830
+ [source,java,indent=0,subs="verbatim,quotes,attributes"]
831
+ ----
832
+ @ConfigurationProperties(prefix="rabbit")
833
+ public class RabbitProperties {
834
+
835
+ private List<String> addresses = new ArrayList<>(Arrays.asList("a", "b")) ;
836
+
837
+ private ContainerType = ContainerType.SIMPLE;
838
+
839
+ // ... getter and setters
840
+
841
+ public enum ContainerType {
842
+
843
+ SIMPLE,
844
+
845
+ DIRECT
846
+
847
+ }
848
+
849
+ }
850
+ ----
851
+
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>>:
854
+
855
+ [source,json,indent=0]
856
+ ----
857
+ {
858
+ "name": "rabbit.addresses",
859
+ "defaultValue": "a, b"
860
+ },
861
+ {
862
+ "name": "rabbit.container-type",
863
+ "defaultValue": "simple"
864
+ }
865
+ ----
866
+
867
+
823
868
[NOTE]
824
869
====
825
870
If you are using AspectJ in your project, you need to make sure that the annotation
0 commit comments