MCPcopy Create free account
hub / github.com/AIScientists-Dev/Flowtrace / render_example

Function render_example

crates/flowtrace-cli/src/explain.rs:378–383  ·  view source on GitHub ↗

Render a minimal valid JSON example for the schema. Always ends with a newline so the output is line-clean when piped to a file or another command.

(rs: &RootSchema, obj: &SchemaObject)

Source from the content-addressed store, hash-verified

376/// Render a minimal valid JSON example for the schema. Always ends with a newline
377/// so the output is line-clean when piped to a file or another command.
378fn render_example(rs: &RootSchema, obj: &SchemaObject) -> String {
379 let v = example_for(rs, obj, &mut Vec::new());
380 let mut s = serde_json::to_string_pretty(&v).unwrap_or_else(|_| String::from("null"));
381 s.push('\n');
382 s
383}
384
385/// Render the raw JSON Schema for this target, pretty-printed.
386///

Callers 1

explainFunction · 0.85

Calls 1

example_forFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…