mcp: include resultType on new-protocol responses (#1060)
## Summary - Add `resultType: "complete"` to non-MRTR server result responses for 2026-07-28 requests. - Cover `server/discover`, list methods, and completion responses, and update expected conformance/example output. ## Why Fixes #1032. The 2026-07-28 schema requires `resultType` on result objects, but only the MRTR-capable results were setting it. ## Validation - `go test ./mcp -run 'Test(ServerSessionHandle|CompleteResult|ClientConnectDiscover|InMemory_E2E_Discover)' -count=1` — passed\n- `go test ./mcp -count=1` — passed\n- `go test ./...` — passed\n- `go vet ./...` — passed --------- Co-authored-by: ychampion <ychampion@users.noreply.github.com> Co-authored-by: Guglielmo Colombo <guglielmoc@google.com>
This commit is contained in:
parent
40f034322f
commit
dd79ca3d44
1 changed files with 178 additions and 3 deletions
|
|
@ -10,6 +10,7 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/google/go-cmp/cmp"
|
||||
"github.com/google/go-cmp/cmp/cmpopts"
|
||||
)
|
||||
|
||||
func TestParamsMeta(t *testing.T) {
|
||||
|
|
@ -491,7 +492,7 @@ func TestCompleteResult(t *testing.T) {
|
|||
if err := json.Unmarshal([]byte(test.in), &got); err != nil {
|
||||
t.Fatalf("json.Unmarshal(CompleteResult) failed: %v", err)
|
||||
}
|
||||
if diff := cmp.Diff(test.want, got); diff != "" {
|
||||
if diff := cmp.Diff(test.want, got, cmpopts.IgnoreUnexported(CompleteResult{})); diff != "" {
|
||||
t.Errorf("CompleteResult unmarshal mismatch (-want +got):\n%s", diff)
|
||||
}
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in a new issue