Skip to content

Validation

json-tology validates data against registered JSON Schemas via a compiled graph engine. All validation methods accept either a schema $id string or a schema object with $id.

Methods

MethodReturnsUse when
instantiatethe schema's inferred type (ParseOutputType<TRefs[K], TRefs>)You want a typed, defaults-applied value or a typed exception
validateValidationErrorsYou want structured error data (paths, keywords, params)
isboolean type guardYou need a boolean with TypeScript narrowing
subschemaAtsub-schema objectYou need to validate a sub-schema by JSON Pointer

Error views on ValidationErrors: see Error Views for aggregate, report, and iteration.

All examples use the bookstore domain. See Getting Started for installation.

See also

Released under the MIT License.