MCPcopy Create free account
hub / github.com/github/gh-aw / normalizeAdditionalPropertyList

Function normalizeAdditionalPropertyList

pkg/parser/schema_errors.go:471–483  ·  view source on GitHub ↗

normalizeAdditionalPropertyList strips quotes, trims whitespace, and sorts the comma-separated property names so that diagnostics are deterministic regardless of the order in which the schema validator emits them.

(raw string)

Source from the content-addressed store, hash-verified

469// comma-separated property names so that diagnostics are deterministic regardless
470// of the order in which the schema validator emits them.
471func normalizeAdditionalPropertyList(raw string) string {
472 raw = strings.ReplaceAll(raw, "'", "")
473 parts := strings.Split(raw, ",")
474 cleaned := make([]string, 0, len(parts))
475 for _, part := range parts {
476 trimmed := strings.TrimSpace(part)
477 if trimmed != "" {
478 cleaned = append(cleaned, trimmed)
479 }
480 }
481 sort.Strings(cleaned)
482 return strings.Join(cleaned, ", ")
483}

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected