MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / report_json

Function report_json

atomic-cli/src/commands/intent/validate.rs:244–258  ·  view source on GitHub ↗

Serialize a [`ValidationReport`] to the documented JSON shape: `{conforms, results: [{focus_node, shape, path, message}]}`.

(report: &ValidationReport)

Source from the content-addressed store, hash-verified

242/// Serialize a [`ValidationReport`] to the documented JSON shape:
243/// `{conforms, results: [{focus_node, shape, path, message}]}`.
244fn 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)]
261mod evidence_tests {

Callers 1

runMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected