1 unstable release
0.1.0 | Mar 28, 2022 |
---|
#15 in #kdl
24KB
535 lines
kdl-schema-check
KDL Schema document validation.
examples
Library usage:
use kdl_schema::Schema;
use kdl_schema_check::CheckExt;
let schema_kdl = r#"
document {
info {
title "Sample Schema" lang="en"
description "An example schema" lang="en"
author "boringcactus"
}
node "name" {
value {
type "string"
}
}
node "age" {
value {
type "number"
}
}
}
"#;
let schema = Schema::parse(schema_kdl).unwrap();
let document = r#"
name "Joe"
age 69
"#;
schema.check_text_matches("<sample document>", document)
.expect("document validation failed");
Binary usage:
$ cargo install kdl-schema-check
$ kdl-schema-check schema.kdl document.kdl
Validation succeeded!
conditions blocking version 1.0.0
- return more than one error
- kdl-schema is at 1.0.0
- comprehensive tests for error reporting
- no TODOs left in code
license
Dependencies
~12–21MB
~267K SLoC