schema

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 11, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package schema compiles the published MCP JSON Schema files (mcp-schema/*.schema.json) and validates arbitrary Go values against any named $defs entry within them — the reusable round-trip validator SDK smoke tests and the mock referee both call.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

Registry compiles and caches a jsonschema.Schema per (file, $defs name) pair, on demand.

func NewRegistry

func NewRegistry() (*Registry, error)

NewRegistry loads every mcp-schema/*.schema.json file embedded in the contracts package.

func (*Registry) Validate

func (r *Registry) Validate(file, defName string, v any) error

Validate marshals v to JSON and checks it against the named $defs entry (e.g. "StateView", "SubmitOrdersResponse") in the given schema file (e.g. "getState.schema.json").

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL