diff --git a/go.mod b/go.mod index 5285ea20..f6f755cc 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( require ( github.com/itchyny/gojq v0.12.19 - github.com/santhosh-tekuri/jsonschema/v6 v6.0.2 + github.com/santhosh-tekuri/jsonschema/v6 v6.0.3 github.com/stretchr/testify v1.11.1 github.com/tetratelabs/wazero v1.12.0 go.opentelemetry.io/otel v1.44.0 diff --git a/go.sum b/go.sum index f6c954e3..4b532ff7 100644 --- a/go.sum +++ b/go.sum @@ -43,8 +43,8 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/santhosh-tekuri/jsonschema/v6 v6.0.2 h1:KRzFb2m7YtdldCEkzs6KqmJw4nqEVZGK7IN2kJkjTuQ= -github.com/santhosh-tekuri/jsonschema/v6 v6.0.2/go.mod h1:JXeL+ps8p7/KNMjDQk3TCwPpBy0wYklyWTfbkIzdIFU= +github.com/santhosh-tekuri/jsonschema/v6 v6.0.3 h1:1EYB5IzjZawrrnELUi78f9fPu57HuXjmddZPjrls/28= +github.com/santhosh-tekuri/jsonschema/v6 v6.0.3/go.mod h1:JXeL+ps8p7/KNMjDQk3TCwPpBy0wYklyWTfbkIzdIFU= github.com/segmentio/asm v1.1.3 h1:WM03sfUOENvvKexOLp+pCqgb/WDjsi7EK8gIsICtzhc= github.com/segmentio/asm v1.1.3/go.mod h1:Ld3L4ZXGNcSLRg4JBsZ3//1+f/TjYl0Mzen/DQy1EJg= github.com/segmentio/encoding v0.5.4 h1:OW1VRern8Nw6ITAtwSZ7Idrl3MXCFwXHPgqESYfvNt0= diff --git a/internal/config/validation_schema_test.go b/internal/config/validation_schema_test.go index 66be316a..1fdb6ece 100644 --- a/internal/config/validation_schema_test.go +++ b/internal/config/validation_schema_test.go @@ -890,3 +890,27 @@ func TestSchema_OpenTelemetryConfig(t *testing.T) { }) } } + +// TestValidateJSONSchema_CustomSchemasPropertyNamesLocation verifies that invalid +// customSchemas key names are reported with the propertyNames instance path. +func TestValidateJSONSchema_CustomSchemasPropertyNamesLocation(t *testing.T) { + config := `{ + "mcpServers": { + "github": { + "container": "ghcr.io/github/github-mcp-server:latest" + } + }, + "gateway": { + "port": 8080, + "domain": "localhost", + "agentId": "test-key" + }, + "customSchemas": { + "Bad_Name": "https://example.com/schema.json" + } + }` + + err := validateJSONSchema([]byte(config)) + require.Error(t, err) + assert.ErrorContains(t, err, "Location: /customSchemas\n Error: invalid propertyName 'Bad_Name'") +}