refactor: decision graph; move validation logic to core; (#78)

This commit is contained in:
stefan-gorules
2023-08-29 15:38:49 +02:00
committed by GitHub
parent a03978fbe7
commit f8dc07536f
14 changed files with 491 additions and 169 deletions
+9
View File
@@ -43,4 +43,13 @@ impl PyZenDecision {
let value = serde_json::to_value(&result).context("Fail")?;
Ok(PyValue(value).to_object(py))
}
pub fn validate(&self) -> PyResult<()> {
let decision = self.0.clone();
decision
.validate()
.map_err(|e| anyhow!(serde_json::to_string(&e).unwrap_or_else(|_| e.to_string())))?;
Ok(())
}
}