Documentation
¶
Overview ¶
Package lexval validates data against ATProto Lexicon schemas.
Index ¶
- func ValidateObject(cat *lexicon.Catalog, contextNSID string, obj *lexicon.Object, ...) error
- func ValidateRecord(cat *lexicon.Catalog, collection string, data map[string]any) error
- func ValidateValue(cat *lexicon.Catalog, contextNSID string, field *lexicon.Field, val any) error
- type ValidationError
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 ¶
ValidateRecord validates a record against the schema identified by collection NSID. data is typically from cbor.Unmarshal or encoding/json.
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
Click to show internal directories.
Click to hide internal directories.