Skip to main content

validate

Function validate 

Source
pub fn validate(
    value: &Value,
    ty: &str,
    types: &BTreeMap<String, RecordType>,
) -> Result<(), String>
Expand description

Check a value against an Ingot type. Returns the first mismatch found.

Deliberately shallow-but-strict rather than a general JSON Schema validator: it only has to cover the types Ingot can express, and it produces messages naming the Ingot type rather than a schema path.