zentol commented on code in PR #19888:
URL: https://github.com/apache/flink/pull/19888#discussion_r892082723


##########
flink-docs/src/test/java/org/apache/flink/docs/configuration/ConfigOptionsDocGeneratorTest.java:
##########
@@ -592,6 +592,95 @@ void testConfigOptionExclusion() {
         assertThat(htmlTable).isEqualTo(expectedTable);
     }
 
+    private enum TestEnumWithExclusion {
+        VALUE_1,
+        @Documentation.ExcludeFromDocumentation
+        VALUE_2,
+        VALUE_3
+    }
+
+    private enum DescribedTestEnumWithExclusion implements DescribedEnum {
+        A(text("First letter of the alphabet")),
+        B(text("Second letter of the alphabet")),
+        @Documentation.ExcludeFromDocumentation
+        C(text("Third letter of the alphabet"));
+
+        private final InlineElement description;
+
+        DescribedTestEnumWithExclusion(InlineElement description) {
+            this.description = description;
+        }
+
+        @Override
+        public InlineElement getDescription() {
+            return description;
+        }
+    }
+
+    static class TestConfigGroupWithEnumConstantExclusion {
+
+        public static ConfigOption<TestEnumWithExclusion> enumWithExclusion =
+                ConfigOptions.key("exclude.enum")
+                        .enumType(TestEnumWithExclusion.class)
+                        .defaultValue(TestEnumWithExclusion.VALUE_1)
+                        .withDescription("Description");
+
+        public static ConfigOption<List<TestEnumWithExclusion>> 
enumListWithExclusion =
+                ConfigOptions.key("exclude.enum.list")
+                        .enumType(TestEnumWithExclusion.class)
+                        .asList()
+                        .defaultValues(TestEnumWithExclusion.VALUE_1, 
TestEnumWithExclusion.VALUE_2)

Review Comment:
   one could argue that this shouldn't be allowed at all, but the generator 
isn't responsible for such checks and I can't think of good place to put it.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to