Skip to main content

agx_cli/output/
json.rs

1//! JSON formatter for ValidationReport.
2
3use agx::preset::validate::ValidationReport;
4
5/// Serialize a [`ValidationReport`] as pretty-printed JSON.
6pub fn format_json(report: &ValidationReport) -> String {
7    let mut s = serde_json::to_string_pretty(report).expect("ValidationReport always serializes");
8    s.push('\n');
9    s
10}