@knot0/validator
v2.0.34
Published
Lightweight JSON Schema validator for Knot0 v2 manifests using AJV.
Readme
@knot0/validator
Lightweight JSON Schema validator for Knot0 v2 manifests using AJV.
Usage
# Build schemas first
node knot0-src/schemas-v2/scripts/build.mjs
# Run quick test
node knot0-src/packages-v2/validator-js/src/test.mjsProgrammatic
import { createValidator } from '@knot0/validator';
const { validate } = createValidator();
const res = validate('Component', manifestObject);
if (!res.ok) console.error(res.errors);Notes
- Looks up schemas at
knot0-src/schemas-v2/jsonand uses$id=https://knot0.com/schema/v2/<Kind>.json. - Schemas must be built before validation.
