validate

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 24, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package validate checks JSON values against a JSON Schema.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JSON

func JSON(schemaBytes, data []byte) error

JSON returns nil if data conforms to schemaBytes, or a non-nil error describing the failures. The error message is suitable for sending back to a model as retry feedback.

Types

type Schema

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

Schema is a compiled, reusable validator.

func Compile

func Compile(schemaBytes []byte) (*Schema, error)

Compile parses and compiles a JSON Schema once for repeated validation.

func (*Schema) Validate

func (s *Schema) Validate(data []byte) error

Validate checks data against the compiled schema.

Jump to

Keyboard shortcuts

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