cue

    Pure MoonBit implementation of the CUE configuration and value-lattice unification engine (parser, evaluator, validator, JSON/YAML export)

    cue
    configuration
    schema
    validation
    lattice
    unification
    json
    yaml
    Download zip
    Author
    Version
    0.1.1
    License
    Apache-2.0
    Last updated
    4 hours ago
    Downloads
    5

    No dependencies

    #TIMI0821/cue

    CI mooncakes.io License: Apache-2.0

    Pure MoonBit implementation of the CUE configuration language and Value-Lattice unification engine — parser, lazy Vertex evaluator, RE2-compatible regex engine, schema validator (vet), JSON/YAML bidirectional interop, and differential conformance verified 50/50 against official Go CUE v0.18.0.

    • Zero external dependencies: uses only moonbitlang/core, runs cleanly across wasm-gc, wasm, js, and native backends.
    • Compiler verified: moonc v0.10.22+124d61d05 (moon 0.1.20261119), moon check --deny-warn, moon fmt --check, moon test --deny-warn.
    • Repository: https://github.com/TIMI0821/cue


    #Why TIMI0821/cue for MoonBit?

    In MoonBit's mooncakes.io registry (audited 2026-11-27, 4,045 packages):
    • Configuration languages such as Jsonnet (pangbit/moonjsonnet), Dhall (Charles67676767/MoonDhall), Pkl (mizchi/pkl), HCL (lenitain/hcl), and KDL (lenitain/kdl) exist, while CUE has 0 existing packages.
    • Unlike JSON Schema (which only validates data after the fact) or imperative template overrides, CUE unifies types, constraints, defaults, and concrete values in one mathematical Value Lattice (a & b == b & a), enabling order-independent multi-layer configuration merging, closed-struct typo detection, and schema subsumption checks.


    #Installation

    Add TIMI0821/cue to your MoonBit project:

    moon add TIMI0821/cue

    Import it in your moon.pkg:

    ///|
    import {
    "TIMI0821/cue",
    }


    #Quick Start

    #1. Order-Independent Multi-Layer Config Unification & Export

    let schema_layer =
    #|#Service: {
    #| app: string & =~"^[a-z][a-z0-9-]+$"
    #| port: uint16 & >=1024 | *8080
    #| url: "https://\(app).internal:\(port)"
    #|}
    #|cfg: #Service

    let prod_layer =
    #|cfg: {
    #| app: "billing-api"
    #| port: 8443
    #|}

    // Order-independent: export_json_all([schema_layer, prod_layer]) == export_json_all([prod_layer, schema_layer])
    let json = @cue.export_json_all([schema_layer, prod_layer])
    println(@cue.format_json(json, indent=2))

    #2. JSON & YAML Schema Validation (vet_json / validate_json / vet_yaml)

    let schema = #|close({ #| order_id: string & =~"^ORD-[0-9]{6}$" #| currency: *"CNY" | "USD" | "EUR" #| amount: number & >0 & <=1000000 #|}) let payload = #"{"order_id": "ORD-202601", "amount": 199.5}"# // Throws CueError if invalid; passes silently if valid @cue.vet_json(schema, payload) // Or apply schema defaults and export validated JSON let enriched = @cue.export_unified_json(schema, payload) // => {"order_id": "ORD-202601", "currency": "CNY", "amount": 199.5} // Non-throwing multi-error diagnostics with exact field paths let errs = @cue.validate_json(schema, #"{"order_id": "BAD", "amount": -5, "extra": 1}"#) // Reports all 3 diagnostics: order_id, amount, and closed-struct violation on extra

    #3. Schema Backward-Compatibility via Lattice Subsumption (subsumes)

    let wide = @cue.eval("port: int & >=1 & <=65535")
    let narrow = @cue.eval("port: int & >=1024 & <=65535")
    assert_true(@cue.subsumes(wide, narrow)) // wide ⊒ narrow
    assert_false(@cue.subsumes(narrow, wide))


    #Runnable 3-Scenario Demo & CLI

    Run the built-in demonstration covering (1) multi-environment microservice config unification, (2) Order API JSON/YAML validation with multi-error diagnostics, and (3) AI Agent structured tool-call contract validation:

    moon run cmd/main

    Export an inline CUE expression directly to JSON:

    moon run cmd/main -- --export 'a: int & >0 & 42, msg: "ok-\(a)"'

    Expected output:

    { "a": 42, "msg": "ok-42" }


    #Specification Coverage & Boundaries (CUE v0.18 Core)

    CapabilityImplementationVerification
    Lexer (ASI auto-comma, SI multipliers K/Ki/1.5K, hex/oct/bin, raw #"..."#, multiline """...""", interpolation \(expr))lexer.mbt, token.mbtlexer_parser_wbtest.mbt, diff_test.py
    Parser & AST (package, imports, #Definitions, _hidden, optional ?, required !, dynamic (expr):, patterns [pat]:, comprehensions)parser.mbt, ast.mbtlexer_parser_wbtest.mbt, diff_test.py
    Pure MoonBit Thompson NFA RE2 Regex Engine (=~, !~)regex.mbtregex_wbtest.mbt, diff_test.py
    Value Lattice & Unification (_, _|_, &, |, *default, bounds, integer gap contradiction int & >1 & <2, closed structs, open lists, subsumes)value.mbt, unify.mbtlattice_wbtest.mbt, diff_test.py
    Lazy Vertex Evaluator (structural merging before sibling ref resolution, forward refs, cycle detection, for/if/let comprehensions, close(), ...)eval.mbteval_wbtest.mbt, edge_cases_test.mbt, diff_test.py
    Builtins & Core Stdlib (uint8..uint64, int8..int64, len, close, and, or, div/mod/quo/rem, strings.*, list.*, math.*)builtins.mbteval_wbtest.mbt, diff_test.py
    Bidirectional JSON & YAML Interop (export_json, export_yaml_string, vet_json, validate_json, vet_yaml, validate_yaml)export.mbt, yaml.mbt, cue.mbtcue_test.mbt, edge_cases_test.mbt, diff_test.py

    #Explicit Scope Boundaries

    • Covers CUE Language Specification v0.18 Core single- and multi-file unification, schema validation, and JSON/YAML export.
    • Intentionally out of scope for v0.1.0: Go/CUE registry module fetching (cue.mod/pkg), tool/ external OS command workflows, and full Go stdlib packages beyond strings, list, and math.


    #Verification & Differential Conformance vs Official CUE v0.18.0

    Run the full local verification suite:

    moon version --all moon check --deny-warn moon fmt --check moon build --target wasm-gc --release --deny-warn moon build --target wasm --release --deny-warn moon build --target js --release --deny-warn moon test --target wasm-gc --deny-warn moon test --target wasm --deny-warn moon test --target js --deny-warn moon run cmd/main

    Run the 50-case differential conformance harness directly against the official Go cue v0.18.0 binary (requires cue on PATH or --cue-bin and Node.js):

    python3 scripts/diff_test.py --cue-bin /path/to/cue

    Latest verified result:
    • Unit, White-box, Black-box & Edge Tests: 30/30 passed across wasm-gc, wasm, js, and native (in GitHub Actions CI).
    • Differential Conformance vs Official Go cue v0.18.0: 50/50 (42/42 export cases + 8/8 vet JSON interop cases).
    • Real discrepancies caught and fixed by the differential harness during development:
      1. Nested closed-definition override (#App & { db: port: 6432 }) falsely closing the open override conjunct;
      2. Tight numeric bounds (>=5 & <=5) remaining non-concrete until supplied a concrete value per CUE v0.18;
      3. Open-list export ([1, ...int] -> [1]) and CUE v0.11+ removal of infix mod/div and list +/* in favor of list.Concat/list.Repeat.


    #Architecture

    CUE Source(s) ──▶ Lexer (ASI, SI units, interp) ──▶ Parser (Pratt + Recursive Descent) │ ▼ JSON / YAML ───▶ Bidirectional Codec ◀──▶ Lazy Vertex Evaluator (Scopes, #Defs, Comprehensions) │ ▼ Value Lattice Unifier (&, |, Bounds, RE2 NFA, Closedness) │ ▼ Concrete Export (JSON/YAML) & Multi-Path Diagnostics (`vet`)


    #License & Provenance

    • License: Apache-2.0
    • Authorship: 100% original pure-MoonBit implementation by TIMI0821, designed against the public CUE Language Specification and verified via differential testing against the official Go cue v0.18.0 CLI. No third-party source code was ported or vendored.

    CueError

    pub(all) suberror CueError {
    CueError(kind~ : ErrorKind, message~ : String, path~ : Array[String], span~ : Span?)
    } derive(Eq,
    Debug
    )

    Structured CUE diagnostic carrying kind, message, field path, and optional source span.
    impl Show for CueError

    CueError::format_path

    fn CueError::format_path(path : Array[String]) -> String

    CueError::new

    fn CueError::new(kind : ErrorKind, message : String, path? : Array[String], span? : Span?) -> CueError

    CueError::to_string

    fn CueError::to_string(self : CueError) -> String

    CueError::with_path_prefix

    fn CueError::with_path_prefix(self : CueError, segment : String) -> CueError

    BasicKind

    pub(all) enum BasicKind {
    NullKind
    BoolKind
    IntKind
    FloatKind
    NumberKind
    StringKind
    BytesKind
    } derive(Eq,
    Debug
    )

    impl Show for BasicKind

    BinOp

    pub(all) enum BinOp {
    Or
    And
    Lor
    Land
    Eq
    Neq
    Lt
    Lte
    Gt
    Gte
    Match
    NotMatch
    Add
    Sub
    Mul
    Quo
    IntDiv
    IntMod
    IntQuo
    IntRem
    } derive(Eq,
    Debug
    )

    BoundOp

    pub(all) enum BoundOp {
    BLt
    BLte
    BGt
    BGte
    BNeq
    BMatch
    BNotMatch
    } derive(Eq,
    Debug
    )

    impl Show for BoundOp

    BoundVal

    pub(all) struct BoundVal {
    op : BoundOp
    scalar : Scalar
    } derive(Eq,
    Debug
    )

    impl Show for BoundVal

    Clause

    pub(all) enum Clause {
    ForClause(key~ : String?, val~ : String, source~ : Expr, span~ : Span)
    IfClause(cond~ : Expr, span~ : Span)
    LetClause(name~ : String, expr~ : Expr, span~ : Span)
    } derive(Eq,
    Debug
    )

    CompiledRegex

    pub struct CompiledRegex {
    pattern : String
    // private fields
    }

    Compiled regular expression for CUE =~ / !~.

    CompiledRegex::is_match

    fn CompiledRegex::is_match(self : CompiledRegex, text : String) -> Bool

    Matches text using Go RE2 MatchString semantics (unanchored search unless ^ / $ anchors are present in the pattern).

    Decl

    pub(all) enum Decl {
    FieldDecl(Field)
    LetDecl(String, Expr, Span)
    EmbedDecl(Expr, Span)
    ComprehensionDecl(Array[Clause], Array[Decl], Span)
    EllipsisDecl(Span)
    } derive(Eq,
    Debug
    )

    Disjunct

    pub(all) struct Disjunct {
    value : Value
    is_default : Bool
    } derive(Eq,
    Debug
    )

    ErrorKind

    pub(all) enum ErrorKind {
    LexError
    ParseError
    EvalError
    ConflictError
    ClosedStructError
    IncompleteError
    CycleError
    BoundError
    RegexError
    JsonError
    YamlError
    ExplicitBottom
    } derive(Eq,
    Debug
    )

    Category of a CUE diagnostic error.
    impl Show for ErrorKind

    Expr

    pub(all) enum Expr {
    TopLit(Span)
    BottomLit(Span)
    NullLit(Span)
    BoolLit(Bool, Span)
    IntLit(Int64, Span)
    FloatLit(Double, Span)
    StringLit(String, Span)
    BytesLit(Bytes, Span)
    InterpStringExpr(Array[InterpPart], Span)
    IdentExpr(String, Span)
    StructExpr(Array[Decl], Span)
    ListExpr(Array[ListElem], Span)
    UnaryExpr(UnaryOp, Expr, Span)
    BinaryExpr(BinOp, Expr, Expr, Span)
    SelectorExpr(Expr, String, Span)
    IndexExpr(Expr, Expr, Span)
    SliceExpr(Expr, Expr?, Expr?, Span)
    CallExpr(Expr, Array[Expr], Span)
    } derive(Eq,
    Debug
    )

    Expr::span

    fn Expr::span(self : Expr) -> Span

    Field

    pub(all) struct Field {
    label : Label
    constraint : FieldConstraint
    value : Expr
    span : Span
    } derive(Eq,
    Debug
    )

    FieldConstraint

    pub(all) enum FieldConstraint {
    Regular
    Optional
    Required
    } derive(Eq,
    Debug
    )

    File

    pub(all) struct File {
    package_name : String?
    imports : Array[ImportSpec]
    decls : Array[Decl]
    span : Span
    } derive(Eq,
    Debug
    )

    ImportSpec

    pub(all) struct ImportSpec {
    alias_name : String?
    path : String
    span : Span
    } derive(Eq,
    Debug
    )

    InterpPart

    pub(all) enum InterpPart {
    StrText(String)
    StrExpr(Expr)
    } derive(Eq,
    Debug
    )

    Label

    pub(all) enum Label {
    IdentLabel(String)
    StringLabel(String)
    DynamicLabel(Expr)
    PatternLabel(Expr)
    } derive(Eq,
    Debug
    )

    ListElem

    pub(all) enum ListElem {
    ListItem(Expr)
    ListEllipsis(Expr?, Span)
    ListComp(Array[Clause], Expr, Span)
    } derive(Eq,
    Debug
    )

    ListVal

    pub(all) struct ListVal {
    elems : Array[Value]
    open_tail : Value?
    } derive(Eq,
    Debug
    )

    PatternConstraint

    pub(all) struct PatternConstraint {
    label_pattern : Value
    value : Value
    } derive(Eq,
    Debug
    )

    Position

    pub(all) struct Position {
    offset : Int
    line : Int
    column : Int
    } derive(Eq,
    Debug
    )

    Source location in a CUE document (1-based line and column, 0-based char offset).
    impl Show for Position

    Position::new

    fn Position::new(offset : Int, line : Int, column : Int) -> Position

    Position::zero

    fn Position::zero() -> Position

    RawStringPart

    pub(all) enum RawStringPart {
    Text(String)
    ExprSource(String, Span)
    } derive(Eq,
    Debug
    )

    Interpolation piece inside a string or bytes literal.

    Scalar

    pub(all) enum Scalar {
    SNull
    SBool(Bool)
    SInt(Int64)
    SFloat(Double)
    SString(String)
    SBytes(Bytes)
    } derive(Eq,
    Debug
    )

    impl Show for Scalar

    Scalar::as_double

    fn Scalar::as_double(self : Scalar) -> Double?

    Scalar::is_numeric

    fn Scalar::is_numeric(self : Scalar) -> Bool

    Scalar::kind

    fn Scalar::kind(self : Scalar) -> BasicKind

    Scalar::to_value

    fn Scalar::to_value(self : Scalar) -> Value

    Span

    pub(all) struct Span {
    start : Position
    end : Position
    } derive(Eq,
    Debug
    )

    Half-open source span [start, end).
    impl Show for Span

    Span::merge

    fn Span::merge(self : Span, other : Span) -> Span

    Span::new

    fn Span::new(start : Position, end : Position) -> Span

    Span::zero

    fn Span::zero() -> Span

    StructField

    pub(all) struct StructField {
    name : String
    value : Value
    constraint : FieldConstraint
    is_definition : Bool
    is_hidden : Bool
    } derive(Eq,
    Debug
    )

    StructVal

    pub(all) struct StructVal {
    fields : Array[StructField]
    patterns : Array[PatternConstraint]
    is_closed : Bool
    embed : Value?
    } derive(Eq,
    Debug
    )

    StructVal::empty

    fn StructVal::empty(is_closed? : Bool) -> StructVal

    StructVal::get_field

    fn StructVal::get_field(self : StructVal, name : String) -> StructField?

    Token

    pub(all) struct Token {
    kind : TokenKind
    span : Span
    } derive(Eq,
    Debug
    )

    Token with its source span.

    Token::new

    fn Token::new(kind : TokenKind, span : Span) -> Token

    TokenKind

    pub(all) enum TokenKind {
    Eof
    Ident(String)
    IntLit(Int64, String)
    FloatLit(Double, String)
    StringLit(String)
    BytesLit(Bytes)
    InterpString(Array[RawStringPart])
    InterpBytes(Array[RawStringPart])
    Package
    Import
    For
    In
    If
    Let
    Null
    True
    False
    Bottom
    Ellipsis
    Add
    Sub
    Mul
    Quo
    And
    Or
    Land
    Lor
    Eq
    Neq
    Lt
    Lte
    Gt
    Gte
    Match
    NotMatch
    Not
    Bind
    Assign
    Arrow
    Colon
    Comma
    Dot
    Question
    LParen
    RParen
    LBrace
    RBrace
    LBrack
    RBrack
    } derive(Eq,
    Debug
    )

    All lexical tokens in the CUE language specification (Core).
    impl Show for TokenKind

    TokenKind::triggers_auto_comma

    fn TokenKind::triggers_auto_comma(self : TokenKind) -> Bool

    Returns true if a newline following this token triggers automatic comma insertion per the CUE Language Specification.

    UnaryOp

    pub(all) enum UnaryOp {
    Pos
    Neg
    Not
    Default
    Lt
    Lte
    Gt
    Gte
    Neq
    Match
    NotMatch
    } derive(Eq,
    Debug
    )

    Value

    pub(all) enum Value {
    VTop
    VBottom(Array[CueError])
    VNull
    VBool(Bool)
    VInt(Int64)
    VFloat(Double)
    VString(String)
    VBytes(Bytes)
    VBasic(BasicKind)
    VBound(BoundVal)
    VConjunction(Array[Value])
    VDisjunction(Array[Disjunct])
    VStruct(StructVal)
    VList(ListVal)
    } derive(Eq,
    Debug
    )

    A node in the CUE Value Lattice.

    Value::as_scalar

    fn Value::as_scalar(self : Value) -> Scalar?

    Value::bottom

    fn Value::bottom(kind : ErrorKind, message : String, path? : Array[String], span? : Span?) -> Value

    Value::errors

    fn Value::errors(self : Value) -> Array[CueError]

    Value::has_error

    fn Value::has_error(self : Value) -> Bool

    Returns true if val contains any bottom error (directly or nested in regular fields/elements).

    Value::is_bottom

    fn Value::is_bottom(self : Value) -> Bool

    Value::is_concrete

    fn Value::is_concrete(self : Value) -> Bool

    Value::is_top

    fn Value::is_top(self : Value) -> Bool

    close_value

    fn close_value(v : Value) -> Value

    Recursively mark a struct (and its nested structs) as closed (close(...)).

    collect_validation_errors

    fn collect_validation_errors(val : Value, require_concrete? : Bool) -> Array[CueError]

    Validate a CUE Value and collect all concrete & constraint diagnostics. Checks: bottom errors, unsatisfied required fields (foo!: T), and optionally enforces full concreteness when require_concrete is true.

    compile_regex

    fn compile_regex(pattern : String) -> CompiledRegex raise CueError

    cue_int_div

    fn cue_int_div(a : Int64, b : Int64) -> (Int64, Int64) raise CueError

    Euclidean integer division (div) and modulo (mod) per CUE spec: b > 0 => 0 <= a mod b < b, b < 0 => 0 <= a mod b < |b|.

    cue_int_quo

    fn cue_int_quo(a : Int64, b : Int64) -> (Int64, Int64) raise CueError

    Truncated integer division (quo) and remainder (rem) per CUE spec.

    eval

    fn eval(src : String) -> Value raise CueError

    Parse and evaluate a CUE source string into a Value.

    eval_all

    fn eval_all(sources : Array[String]) -> Value raise CueError

    Parse, merge, and evaluate multiple CUE source documents in a unified root vertex. Order-independent: eval_all([a, b]) produces the same lattice result as eval_all([b, a]).

    eval_file

    fn eval_file(file : File) -> Value

    Evaluate a single parsed CUE File into a Value.

    eval_files

    fn eval_files(files : Array[File]) -> Value

    Evaluate and unify multiple parsed CUE Files in a shared root vertex.

    eval_global_builtin

    fn eval_global_builtin(name : String, args : Array[Value], span : Span) -> Value

    Evaluate global CUE builtin calls: len, close, and, or, div, mod, quo, rem.

    eval_stdlib_call

    fn eval_stdlib_call(pkg_path : String, func_name : String, args : Array[Value], span : Span) -> Value

    Evaluate CUE standard library package calls (strings.*, list.*, math.*).

    export_json

    fn export_json(src : String) ->
    Json
    raise CueError

    Evaluate a CUE source string and export the concrete result as @json.Json.

    export_json_all

    fn export_json_all(sources : Array[String]) ->
    Json
    raise CueError

    Evaluate and unify multiple CUE sources, exporting the concrete result as @json.Json.

    export_json_string

    fn export_json_string(src : String, indent? : Int) -> String raise CueError

    Evaluate a CUE source string and export as a formatted JSON string.

    export_unified_json

    fn export_unified_json(schema_src : String, json_src : String, indent? : Int) -> String raise CueError

    Unify a CUE schema with a JSON payload, apply defaults & computed fields, and export JSON.

    export_yaml_string

    fn export_yaml_string(src : String) -> String raise CueError

    Evaluate a CUE source string and export as a YAML 1.2 string.

    format_json

    fn format_json(j :
    Json
    , indent? : Int) -> String

    Render @json.Json as deterministic formatted JSON string (indent=0 for compact).

    format_value

    fn format_value(val : Value) -> String

    Format any CUE Value into readable CUE syntax (matching cue eval).

    format_yaml

    fn format_yaml(j :
    Json
    ) -> String

    Format a @json.Json value into clean YAML 1.2 output.

    is_definition_name

    fn is_definition_name(name : String) -> Bool

    is_hidden_name

    fn is_hidden_name(name : String) -> Bool

    json_to_value

    fn json_to_value(j :
    Json
    ) -> Value

    Convert a @json.Json document into a CUE Value, preserving integer vs float distinction.

    lookup_predeclared_type

    fn lookup_predeclared_type(name : String) -> Value?

    Resolve a predeclared CUE type identifier (including bounded integer types like uint16).

    make_disjunction

    fn make_disjunction(branches : Array[Disjunct]) -> Value

    Construct a normalized disjunction from raw disjunct branches.

    parse

    fn parse(src : String) -> File raise CueError

    Parse a CUE source string into a File AST.

    parse_expr_str

    fn parse_expr_str(src : String) -> Expr raise CueError

    Parse a single CUE expression string (used for interpolations and REPL-style queries).

    parse_json_value

    fn parse_json_value(json_src : String) -> Value raise CueError

    Parse a JSON string into a CUE Value (preserving exact integer vs float representations).

    parse_yaml_value

    fn parse_yaml_value(src : String) -> Value raise CueError

    Parse a YAML Core configuration string directly into a CUE Value.

    regex_match

    fn regex_match(pattern : String, text : String) -> Bool raise CueError

    Convenience helper: compile and match regex against text.

    resolve_default_shallow

    fn resolve_default_shallow(val : Value) -> Value

    Resolve a single default choice from a disjunction (used by concrete ops and export).

    resolve_defaults

    fn resolve_defaults(val : Value) -> Value

    Recursively resolve *default choices in a CUE Value. Ambiguous defaults (2+ distinct marked defaults in a disjunction) become IncompleteError.

    subsumes

    fn subsumes(a : Value, b : Value) -> Bool

    Returns true iff a subsumes b in the CUE value lattice (a ⊒ b), meaning every concrete instance of b is also a valid instance of a.

    tokenize

    fn tokenize(src : String) -> Array[Token] raise CueError

    Tokenize a CUE source string into a flat token stream ending with Eof.

    unify

    fn unify(a : Value, b : Value) -> Value

    Unify two CUE lattice values a & b.

    unify_json

    fn unify_json(schema_src : String, json_src : String) -> Value raise CueError

    Unify a CUE schema with a JSON payload (schema & data). Supports both top-level schema constraints and #Schema definitions when the schema is a plain root struct or embeds a #Definition.

    validate_json

    fn validate_json(schema_src : String, json_src : String) -> Array[CueError]

    Validate a JSON payload against a CUE schema (cue vet schema.cue data.json), returning all structured field-path diagnostics (empty array means valid).

    validate_yaml

    fn validate_yaml(schema_src : String, yaml_src : String) -> Array[CueError]

    Validate a YAML payload against a CUE schema, returning all structured diagnostics.

    value_to_json

    fn value_to_json(val : Value) ->
    Json
    raise CueError

    Convert a concrete CUE Value to @json.Json, matching cue export semantics.

    vet

    fn vet(src : String) -> Unit raise CueError

    Validate a CUE source document (cue vet): raises the first CueError if any constraint conflict, closed-struct violation, or unsatisfied required field exists.

    vet_json

    fn vet_json(schema_src : String, json_src : String) -> Unit raise CueError

    Validate a JSON payload against a CUE schema, raising the first CueError on failure.

    vet_yaml

    fn vet_yaml(schema_src : String, yaml_src : String) -> Unit raise CueError

    Validate a YAML payload against a CUE schema, raising the first CueError on failure.