use crate::spec::Spec;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum Severity {
Info,
Warning,
}
#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
pub struct Finding {
pub rule: &'static str,
pub element_id: Option<String>,
pub severity: Severity,
pub message: String,
pub suggestion: String,
}
pub struct DesignRule {
pub id: &'static str,
pub title: &'static str,
pub rationale: &'static str,
pub intents: &'static [&'static str],
pub check: fn(&Spec, Option<&str>) -> Vec<Finding>,
}