kdl-schema-check

Crates.iokdl-schema-check
lib.rskdl-schema-check
version0.1.0
sourcesrc
created_at2022-03-28 06:58:12.618179
updated_at2022-03-28 06:58:12.618179
descriptionschema-based document verification for KDL
homepage
repositoryhttps://nest.pijul.com/boringcactus/kdl-schema-check
max_upload_size
id557651
size59,567
Melody Horn (boringcactus)

documentation

README

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

Blue Oak Model License 1.0.0.

Commit count: 0

cargo fmt