schema

package
v0.6.17 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package schema provides typed JSON Schema structures for type coercion and defaults.

This package wraps raw JSON Schema maps (map[string]any) into typed structures that provide type-safe operations like coercion and default value application.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TypeCoercer

type TypeCoercer interface {
	TryCoerce(value any) any
}

TypeCoercer coerces values to their expected types. Implementations return the coerced value, or the original if coercion fails.

func MakeSchema

func MakeSchema(raw map[string]any) TypeCoercer

MakeSchema parses a raw JSON Schema map into typed Schema structures. Always returns a valid TypeCoercer; callers do not need to nil-check. For nil, empty, or unknown schema types, returns a passthrough coercer that returns values unchanged.

Jump to

Keyboard shortcuts

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