inputschema

package
v0.1.59 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const MaxDepth = 16

Variables

This section is empty.

Functions

func AllowsType

func AllowsType(schema map[string]interface{}, want string) bool

func IsJSONNumber

func IsJSONNumber(value interface{}) bool

func SchemaTypes

func SchemaTypes(raw interface{}) ([]string, error)

func StringArray

func StringArray(raw interface{}) ([]string, error)

func ValidateCapabilitySchema

func ValidateCapabilitySchema(schema map[string]interface{}, label string) error

func ValidateInput

func ValidateInput(value interface{}, schema map[string]interface{}) error

func ValidateInputSchema

func ValidateInputSchema(schema map[string]interface{}) error

func ValidateJSON

func ValidateJSON(value interface{}, schema map[string]interface{}, label string) error

func ValueMatchesJSONType

func ValueMatchesJSONType(value interface{}, want string) bool

Types

type Violation

type Violation struct {
	Path   string
	Reason string
	// contains filtered or unexported fields
}

Violation is the stable, non-sensitive shape returned when an application input does not satisfy a capability schema. Callers may expose Path and Reason, but must not echo the rejected value or full schema.

func (*Violation) Error

func (e *Violation) Error() string

Jump to

Keyboard shortcuts

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