Skip to content
Shapemetry

Model - Validate

API reference for src/schema/validate, src/validate on @huukhanhnguyen/model, reachable from ..

See the Guide for the ModelJSON / evaluate pipeline.

API reference

Signatures are generated from the live package .d.ts - not hand-written.

ExpressionError

type

type ExpressionError
// = {
    path: string;
    expression: string;
    message: string;
}

ModelDiagnostic

type

type ModelDiagnostic
// = {
    /** Which root array the node sits in ("parameters" | "scene"), or "" for model-level errors. */
    section: string;
    index: number;
    key: string | undefined;
    typeName: string;
    errors: string[];
}

RegistryError

type

type RegistryError
// = {
    path: string;
    message: string;
}

SafeParseModel

type

type SafeParseModel
// = {
    success: true;
    data: ModelJSON;
}

validateModelJSON

function

Structural (Zod) + registry pass: method validity + lane placement, per-method arg keys, numeric-constraint placement, reserved/builtin keys. Throws on the first collected batch of errors.

validateModelJSON(json: ModelJSON, registry?: Registry): void
Last updated: 📖 1 min readEdit on GitHub