mcp: update to jsonschema that does not validate structs (#511)

Update to the latest jsonschema commit, which removes the ability to
validate structs and changes the type of ForOptions.TypeSchemas.
This commit is contained in:
Jonathan Amsterdam 2025-09-22 15:28:04 -04:00 • committed by GitHub
commit 33ff851ef3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -0,0 +1,31 @@
// Copyright 2025 The Go MCP SDK Authors. All rights reserved.
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file.
package main
import (
"context"
"encoding/json"
"testing"
"github.com/modelcontextprotocol/go-sdk/mcp"
)
func TestGreet(t *testing.T) {
manual, err := newManualGreeter()
if err != nil {
t.Fatal(err)
}
res, err := manual.greet(context.Background(), &mcp.CallToolRequest{
Params: &mcp.CallToolParamsRaw{
Arguments: json.RawMessage(`{"name": "Bob"}`),
},
})
if err != nil {
t.Fatal(err)
}
if res.IsError {
t.Fatalf("tool error: %q", res.Content[0].(*mcp.TextContent).Text)
}
}