diff --git a/semantics/oca-bundle/src/state/validator.rs b/semantics/oca-bundle/src/state/validator.rs index 8c3a23d..b60ab5c 100644 --- a/semantics/oca-bundle/src/state/validator.rs +++ b/semantics/oca-bundle/src/state/validator.rs @@ -43,6 +43,19 @@ impl std::fmt::Display for Error { impl std::error::Error for Error {} +pub enum SemanticValidationStatus { + Valid, + Invalid(Vec), +} + +pub fn validate(oca_bundle: &OCABundle) -> Result { + let validator = Validator::new(); + match validator.validate(oca_bundle) { + Ok(_) => Ok(SemanticValidationStatus::Valid), + Err(errors) => Ok(SemanticValidationStatus::Invalid(errors)), + } +} + pub struct Validator { enforced_translations: Vec, }