// Ensures that the schema uses draft 7, which is the only version supported by valico.
Ensures that the schema uses draft 7, which is the only version supported by valico.
Ensures that the schema uses draft 7 which is the only version supported by valico .
fn check_schema_version(schema: &Value) {
    const SCHEMA_URL: &'static str = "http://json-schema.org/draft-07/schema#";
    if let Value::Object(map) = schema {
        if let Some(Value::String(url)) = map.get("$schema") {
            if url != SCHEMA_URL {
                eprintln!(
                    "Only JSON Schema Draft 7 is supported; \"$schema\" must equal \"{}\"",
                    SCHEMA_URL
                );
                std::process::exit(1);
            }
        }
    } else {
        eprintln!("Schema must be an object.");
        std::process::exit(1);
    }
}
fn check_schema_version ( schema : & Value ) { const SCHEMA_URL : & ' static str = " " ; if let Value :: Object ( map ) = schema { if let Some ( Value :: String ( url ) ) = map . get ( " " ) { if url != SCHEMA_URL { eprintln ! ( " \" \" \" \" " SCHEMA_URL ) ; std :: process :: exit ( 1 ) ; } } } else { eprintln ! ( " " ) ; std :: process :: exit ( 1 ) ; } }
Ensures that the schema uses draft 7, which is the only version supported by valico.
Ensures that the schema uses draft 7 which is the only version supported by valico .
schema
&Value