Files
huskies/server/src/validation/mod.rs
T

23 lines
958 B
Rust
Raw Normal View History

2026-05-14 12:53:14 +00:00
//! Transport-agnostic validated input layer for MCP write tools.
//!
//! This module houses all input validation primitives shared across MCP, HTTP,
//! and future WebSocket callers. It is intentionally decoupled from any
//! specific transport — callers parse their raw input into the request types
//! here and receive either a validated struct or a `Vec<ValidationError>`.
//!
//! # Structure
//!
//! - [`error`] — [`ValidationError`] typed enum + JSON serialisation helpers.
//! - [`sanitize`] — HTML sanitisation via `ammonia`.
//! - [`newtypes`] — field-level newtypes (`StoryName`, `AcceptanceCriterion`, …).
//! - [`requests`] — top-level request structs with cross-field `garde` rules.
mod error;
mod newtypes;
mod requests;
mod sanitize;
pub use error::{ValidationError, format_errors_as_json};
pub use newtypes::{AcceptanceCriterion, DependsOnId, Description, StoryName};
pub use requests::{CreateEpicRequest, CreateStoryRequest};