Skip to main content

describe_validation_error

Function describe_validation_error 

Source
fn describe_validation_error(
    error: &ValidationError<'_>,
    depth: usize,
    out: &mut Vec<String>,
)
Expand description

Describes a validation failure in terms a model can act on, into out.

The Vega-Lite schema is one union of every kind of chart, so any mistake anywhere is reported at the root as “not valid under any of the schemas listed in the ‘anyOf’ keyword”, naming neither the property nor its location. The branch that produced the fewest errors is the kind of chart the specification was trying to be, so following it – and any union nested inside it – reaches the property that is actually wrong.