Documentation
¶
Overview ¶
Package jsonschema compiles native MCP JSON schemas from canonical type and resource owners. It never inspects invocation values or executes user code.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ScalarWireSchema ¶ added in v0.19.1
ScalarWireSchema reads an owner-authored wireSchema tag for a custom JSON scalar. It never invokes serialization methods or changes runtime binding. Callers must apply their ordinary field visibility policy first. Supported declarations contain type (a scalar name or union) and optional format. Object graphs, references and arbitrary schema overrides are excluded.
Types ¶
type Reflector ¶
type Reflector struct {
// WireTypes declares owner-authored canonical wire representations for custom
// JSON types. It never infers a contract or invokes custom marshal methods.
WireTypes map[reflect.Type]reflect.Type
// ExcludeInternal removes internal-tagged JSON winners from public input schemas.
// The zero value retains ordinary encoding/json schema semantics.
ExcludeInternal bool
// ExcludeField applies owner-defined visibility to canonical JSON winners
// and their embedding owners before compiling child schemas or annotations.
// Nil preserves ordinary JSON field visibility.
ExcludeField func(reflect.StructField) bool
Annotate func(string, reflect.StructField) (string, any)
}
Reflector uses X's encoding/json field projection; annotations cannot change selection, Go identity, JSON names, or source types.
type ResourceCompiler ¶
ResourceCompiler validates and bundles authored JSON Schema documents. All external references pass through FS; there is no HTTP or OS fallback loader.
func (ResourceCompiler) Compile ¶
func (c ResourceCompiler) Compile(request ResourceRequest) (*Bundle, error)