Expand description
Validate STAC objects with json-schema.
§Examples
Validation is provided via the Validate trait:
use stac::Item;
use stac_validate::Validate;
Item::new("an-id").validate().unwrap();
All fetched schemas are cached, so if you’re 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().unwrap();
for item in items {
validator.validate(&item).unwrap();
}
Validator is cheap to clone, so you are encouraged to validate a large number of objects at the same time if that’s your use-case.
Structs§
- Validator
- A structure for validating STAC.
Enums§
Traits§
- Validate
- Validate any serializable object with json-schema
Functions§
- user_
agent - Returns a string suitable for use as a HTTP user agent.
Type Aliases§
- Result
- Public result type.