Skip to main content

systemprompt_cli/commands/shared/
validation.rs

1//! Shared argument validation for CLI commands.
2//!
3//! Copyright (c) systemprompt.io — Business Source License 1.1.
4//! See <https://systemprompt.io> for licensing details.
5
6use schemars::JsonSchema;
7use serde::{Deserialize, Serialize};
8
9#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
10pub struct ValidationOutput {
11    pub valid: bool,
12    pub items_checked: usize,
13    pub errors: Vec<ValidationIssue>,
14    pub warnings: Vec<ValidationIssue>,
15}
16
17#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
18pub struct ValidationIssue {
19    pub source: String,
20    pub message: String,
21    #[serde(skip_serializing_if = "Option::is_none")]
22    pub suggestion: Option<String>,
23}