Mirror of https://github.com/modelcontextprotocol/go-sdk — The official Go SDK for Model Context Protocol servers and clients. Maintained in collaboration with Google.
  • Go 99.7%
  • Shell 0.3%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Jonathan Amsterdam c99ff4897b jsonschema: validate some keywords
This CL implements validation for the "type", "enum" and "const"
keywords.

Validation in its full generality requires that references in the schema
be resolved. We put that off for now; it isn't needed for most simple
keywords.

The JSON Schema folks provide an extensive test suite for validation at
https://github.com/json-schema-org/JSON-Schema-Test-Suite. We use it for
our tests, copying the necessary files into testdata. The files aren't
perfectly independent; for example, one test in enum.json requires the
"properties" keyword, which we haven't done yet. We will excise those
tests via calls to t.Skip as they arise.

Change-Id: I568b5c87802a39aecbc58f342931308fc8fb211c
Reviewed-on: https://go-review.googlesource.com/c/tools/+/667875
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
2025-04-25 08:34:02 -07:00
examples/hello internal/mcp: implement ping, and test request interleaving 2025-04-23 19:15:29 -07:00
internal jsonschema: validate some keywords 2025-04-25 08:34:02 -07:00
mcp internal/mcp/internal/jsonschema: schema definition 2025-04-25 08:33:53 -07:00