From b0b89e7e65d8f178ff3eba90e2cf9ca9e320c8d5 Mon Sep 17 00:00:00 2001 From: Jordan Liggitt Date: Fri, 6 Jan 2023 00:58:23 -0500 Subject: [PATCH] Prune trailing newlines when enums are disabled Kubernetes-commit: d0967bbe5e78dbcdd5bc189d5fc2becafc4be0f2 --- pkg/util/openapi/enablement.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/util/openapi/enablement.go b/pkg/util/openapi/enablement.go index 693821ac0..b1db3c42b 100644 --- a/pkg/util/openapi/enablement.go +++ b/pkg/util/openapi/enablement.go @@ -68,7 +68,7 @@ func pruneEnums(schema *spec.Schema) *spec.Schema { // note that the new lines before the header should be removed too, // thus the slice range. clone() - schema.Description = schema.Description[:headerIndex] + schema.Description = strings.TrimSpace(schema.Description[:headerIndex]) } if len(schema.Enum) != 0 { // remove the enum field