Serialize a [`ValidationReport`] to the documented JSON shape: `{conforms, results: [{focus_node, shape, path, message}]}`.
(report: &ValidationReport)
| 242 | /// Serialize a [`ValidationReport`] to the documented JSON shape: |
| 243 | /// `{conforms, results: [{focus_node, shape, path, message}]}`. |
| 244 | fn report_json(report: &ValidationReport) -> serde_json::Value { |
| 245 | serde_json::json!({ |
| 246 | "conforms": report.conforms, |
| 247 | "results": report |
| 248 | .results |
| 249 | .iter() |
| 250 | .map(|v| serde_json::json!({ |
| 251 | "focus_node": v.focus_node, |
| 252 | "shape": v.shape, |
| 253 | "path": v.path, |
| 254 | "message": v.message, |
| 255 | })) |
| 256 | .collect::<Vec<_>>(), |
| 257 | }) |
| 258 | } |
| 259 | |
| 260 | #[cfg(test)] |
| 261 | mod evidence_tests { |