mantra_schema/
requirements.rs

1#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, schemars::JsonSchema)]
2pub struct RequirementSchema {
3    #[serde(serialize_with = "crate::serialize_schema_version")]
4    pub version: Option<String>,
5    pub requirements: Vec<Requirement>,
6}
7
8/// Type alias for a requirement ID.
9pub type ReqId = String;
10
11#[derive(
12    Debug, Clone, PartialEq, Eq, serde::Serialize, serde::Deserialize, schemars::JsonSchema,
13)]
14pub struct Requirement {
15    /// ID of the requirement.
16    pub id: ReqId,
17    /// Optional list of parent requirements.
18    pub parents: Option<Vec<ReqId>>,
19    /// Title of the requirement.
20    pub title: String,
21    /// Link to the origin the requirement is defined.
22    pub origin: String,
23    /// true: Marks the requirement to require manual verification.
24    pub manual: bool,
25    /// true: Marks the requirement to be deprecated.
26    pub deprecated: bool,
27    /// Field to store custom information per requirement.
28    pub data: Option<serde_json::Value>,
29}