From 2ad52708fa5fc58c2c9a80f42481efbfbd5d9bed Mon Sep 17 00:00:00 2001 From: Marcus Holl Date: Wed, 15 May 2019 14:46:46 +0200 Subject: [PATCH 1/2] fix: null is rendered when no default value is available instead of the empty string --- documentation/bin/createDocu.groovy | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/documentation/bin/createDocu.groovy b/documentation/bin/createDocu.groovy index 1c52b6696..bf9ab06f7 100644 --- a/documentation/bin/createDocu.groovy +++ b/documentation/bin/createDocu.groovy @@ -21,7 +21,8 @@ class TemplateHelper { def props = parameters.get(it) - def defaultValue = isComplexDefault(props.defaultValue) ? renderComplexDefaultValue(props.defaultValue) : "`${props.defaultValue}`" + def defaultValue = isComplexDefault(props.defaultValue) ? renderComplexDefaultValue(props.defaultValue) : + props.defaultValue ? "`${props.defaultValue}`" : '' t += "| `${it}` | ${props.mandatory ?: props.required ? 'yes' : 'no'} | ${defaultValue} | ${props.value ?: ''} |\n" } From ee3f820e5f458eee6977198fdd551fe282d30ab3 Mon Sep 17 00:00:00 2001 From: Marcus Holl Date: Wed, 15 May 2019 15:20:14 +0200 Subject: [PATCH 2/2] explict null check in order to render also false Co-Authored-By: Christopher Fenner --- documentation/bin/createDocu.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/bin/createDocu.groovy b/documentation/bin/createDocu.groovy index bf9ab06f7..69d0e97b3 100644 --- a/documentation/bin/createDocu.groovy +++ b/documentation/bin/createDocu.groovy @@ -22,7 +22,7 @@ class TemplateHelper { def props = parameters.get(it) def defaultValue = isComplexDefault(props.defaultValue) ? renderComplexDefaultValue(props.defaultValue) : - props.defaultValue ? "`${props.defaultValue}`" : '' + props.defaultValue != null ? "`${props.defaultValue}`" : '' t += "| `${it}` | ${props.mandatory ?: props.required ? 'yes' : 'no'} | ${defaultValue} | ${props.value ?: ''} |\n" }