From cf2b01b08f370ebd8042c810f4e6cf55a66a1310 Mon Sep 17 00:00:00 2001 From: Myzel394 <50424412+Myzel394@users.noreply.github.com> Date: Mon, 29 Jul 2024 21:26:35 +0200 Subject: [PATCH] fix: Improve EnumValue documentation --- common/documentation.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/common/documentation.go b/common/documentation.go index 8a7e5f2..1e98e62 100644 --- a/common/documentation.go +++ b/common/documentation.go @@ -22,6 +22,10 @@ type EnumValue struct { } func (v EnumValue) GetTypeDescription() []string { + if len(v.Values) == 1 { + return []string{fmt.Sprintf("'%s'", v.Values[0])} + } + lines := make([]string, len(v.Values)+1) lines[0] = "Enum of:" @@ -78,7 +82,7 @@ func (v ArrayValue) GetTypeDescription() []string { subValue := v.SubValue.(Value) return append( - []string{"An Array separated by " + v.Separator + " of:"}, + []string{fmt.Sprintf("An Array separated by '%s' of:", v.Separator)}, subValue.GetTypeDescription()..., ) }