Documentation
¶
Overview ¶
Package schema provides utilities for JSON Schema embedding and validation in structured document projects.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractSchemaRef ¶
ExtractSchemaRef extracts the $schema field from JSON data.
func ValidateSchemaRef ¶
ValidateSchemaRef checks if the document's $schema matches the expected schema ID.
Types ¶
type Registry ¶
type Registry struct {
// ID is the schema identifier URL (e.g., "https://github.com/grokify/structured-goals/schema/v2mom.schema.json").
ID string
// Version is the schema version (e.g., "1.0.0").
Version string
// Data is the raw JSON schema bytes.
Data []byte
}
Registry holds embedded JSON schemas for a document type.
func NewRegistry ¶
NewRegistry creates a new schema registry.
func (*Registry) JSONString ¶
JSONString returns the schema as a string.
Click to show internal directories.
Click to hide internal directories.