Crate stac_validate

source ·
Expand description

Validate STAC objects with jsonschema.

§Examples

Validation is provided via the Validate trait:

use stac::Item;
use stac_validate::Validate;
Item::new("an-id").validate().unwrap();

stac::Collection, stac::Catalog, and stac::Item all have their schemas built into the library, so they don’t need to be fetched from the network. Any extension schemas are fetched using reqwest, and cached for later use. This means that, if you’re doing multiple validations, you should re-use the same Validator:

use stac_validate::Validator;

let mut items: Vec<_> = (0..10).map(|n| Item::new(format!("item-{}", n))).collect();
let mut validator = Validator::new();
for item in items {
    validator.validate(item).unwrap();
}

Structs§

  • A structure for validating one or more STAC objects.

Enums§

  • Crate-specific error type.

Traits§

Type Aliases§

  • Crate-specific result type.