From beaabd1a5a546b7912960faa6a85cc30327729a7 Mon Sep 17 00:00:00 2001 From: Tim te Beek Date: Wed, 13 Dec 2023 18:13:34 +0100 Subject: [PATCH] Only print yaml options if required or has example --- src/main/kotlin/org/openrewrite/RecipeMarkdownGenerator.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/kotlin/org/openrewrite/RecipeMarkdownGenerator.kt b/src/main/kotlin/org/openrewrite/RecipeMarkdownGenerator.kt index c2ebeef..f89db5d 100644 --- a/src/main/kotlin/org/openrewrite/RecipeMarkdownGenerator.kt +++ b/src/main/kotlin/org/openrewrite/RecipeMarkdownGenerator.kt @@ -1043,6 +1043,9 @@ class RecipeMarkdownGenerator : Runnable { """.trimIndent() ) for (option in recipeDescriptor.options) { + if (!option.isRequired && option.example == null) { + continue + } val ex = if (option.example != null && "String" == option.type && (option.example.matches("^[{}\\[\\],`|=%@*!?-].*".toRegex()) || option.example.matches(".*:\\s.*".toRegex()))