jsonschema

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2026 License: Apache-2.0 Imports: 13 Imported by: 2

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

This section is empty.

Types

type Bundle

type Bundle struct {
	Schema      map[string]any
	Definitions map[string]map[string]any
	Resources   []string
}

type Reflector

type Reflector struct {
	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.

func (Reflector) Compile

func (r Reflector) Compile(request Request) (map[string]any, error)

type Request

type Request struct {
	Type     reflect.Type
	Path     string
	Property string
}

type ResourceCompiler

type ResourceCompiler struct{ FS fs.FS }

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)

type ResourceRequest

type ResourceRequest struct {
	Schema map[string]any
	Base   string
	Prefix string
}

Jump to

Keyboard shortcuts

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