lexval

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2026 License: Apache-2.0, MIT Imports: 8 Imported by: 1

Documentation

Overview

Package lexval validates data against ATProto Lexicon schemas.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateObject

func ValidateObject(cat *lexicon.Catalog, contextNSID string, obj *lexicon.Object, data map[string]any) error

ValidateObject validates a map against an Object schema.

func ValidateRecord

func ValidateRecord(cat *lexicon.Catalog, collection string, data map[string]any) error

ValidateRecord validates a record against the schema identified by collection NSID. data is typically from cbor.Unmarshal or encoding/json.

func ValidateValue

func ValidateValue(cat *lexicon.Catalog, contextNSID string, field *lexicon.Field, val any) error

ValidateValue validates a single value against a Field schema.

Types

type ValidationError

type ValidationError struct {
	Path    string // e.g. "embed.images[0].alt"
	Message string // e.g. "string exceeds maxLength 1000"
}

ValidationError is a single validation failure at a specific field path.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Jump to

Keyboard shortcuts

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