From bdfbb190d65d9b2bbeb78474911ae5182bc00dbf Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 25 Jun 2026 16:09:18 +0000 Subject: [PATCH 1/2] Initial plan From db102cb875050cac4c95017a45b0878e95decee4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 25 Jun 2026 16:19:29 +0000 Subject: [PATCH 2/2] fix: make UnsupportedField an alias for InvalidValue to eliminate duplicate body --- internal/config/validation_errors.go | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/internal/config/validation_errors.go b/internal/config/validation_errors.go index e7b8cd8f0..30eb2e79a 100644 --- a/internal/config/validation_errors.go +++ b/internal/config/validation_errors.go @@ -66,14 +66,11 @@ func MissingRequired(fieldName, serverType, jsonPath, suggestion string) *Valida } } -// UnsupportedField creates a ValidationError for unsupported fields +// UnsupportedField creates a ValidationError for unsupported or unrecognized fields. +// Alias for InvalidValue; retained for semantic clarity at call sites where the +// error is about an unexpected field rather than a constraint violation. func UnsupportedField(fieldName, message, jsonPath, suggestion string) *ValidationError { - return &ValidationError{ - Field: fieldName, - Message: message, - JSONPath: jsonPath, - Suggestion: suggestion, - } + return InvalidValue(fieldName, message, jsonPath, suggestion) } // AppendConfigDocsFooter appends standard documentation links to an error message