From 6eb8dc81914f55e28c4256b78dea36f16066810a Mon Sep 17 00:00:00 2001 From: Christopher Fenner <26137398+CCFenner@users.noreply.github.com> Date: Thu, 30 Apr 2020 06:39:48 +0200 Subject: [PATCH] docs: add possible value for bool parameters (#1486) --- pkg/generator/helper/docuHelper.go | 2 ++ pkg/generator/helper/docuHelper_test.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/generator/helper/docuHelper.go b/pkg/generator/helper/docuHelper.go index 29a0b138c..6aa3f8a52 100644 --- a/pkg/generator/helper/docuHelper.go +++ b/pkg/generator/helper/docuHelper.go @@ -69,6 +69,7 @@ func setDefaultStepParameters(stepData *config.StepData) { switch param.Type { case "bool": param.Default = "`false`" + param.PossibleValues = append(param.PossibleValues, true, false) case "int": param.Default = "`0`" } @@ -80,6 +81,7 @@ func setDefaultStepParameters(stepData *config.StepData) { param.Default = fmt.Sprintf("`%v`", param.Default) case "bool": param.Default = fmt.Sprintf("`%v`", param.Default) + param.PossibleValues = append(param.PossibleValues, true, false) case "int": param.Default = fmt.Sprintf("`%v`", param.Default) } diff --git a/pkg/generator/helper/docuHelper_test.go b/pkg/generator/helper/docuHelper_test.go index 767f687ff..edd5540f8 100644 --- a/pkg/generator/helper/docuHelper_test.go +++ b/pkg/generator/helper/docuHelper_test.go @@ -20,7 +20,7 @@ var expectedResultDocument string = "# testStep\n\n\t## Description\n\nLong Test "| `param1` | No | | |\n" + "| `param2` | Yes | | |\n" + "| `script` | Yes | | |\n" + - "| `verbose` | No | `false` | |\n\n" + + "| `verbose` | No | `false` | `true`, `false` |\n\n" + " * `param0`: param0 description\n" + " * `param1`: param1 description\n" + " * `param2`: param1 description\n" +