Prune trailing newlines when enums are disabled

Kubernetes-commit: d0967bbe5e78dbcdd5bc189d5fc2becafc4be0f2
This commit is contained in:
Jordan Liggitt 2023-01-06 00:58:23 -05:00 committed by Kubernetes Publisher
parent 8e211636c3
commit b0b89e7e65
1 changed files with 1 additions and 1 deletions

View File

@ -68,7 +68,7 @@ func pruneEnums(schema *spec.Schema) *spec.Schema {
// note that the new lines before the header should be removed too, // note that the new lines before the header should be removed too,
// thus the slice range. // thus the slice range.
clone() clone()
schema.Description = schema.Description[:headerIndex] schema.Description = strings.TrimSpace(schema.Description[:headerIndex])
} }
if len(schema.Enum) != 0 { if len(schema.Enum) != 0 {
// remove the enum field // remove the enum field