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:
parent
ef2fc60b5c
commit
33ff851ef3
1 changed files with 107 additions and 45 deletions
31
examples/server/toolschemas/main_test.go
Normal file
31
examples/server/toolschemas/main_test.go
Normal 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)
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue