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

Function navigate

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

Walk a dotted path through a schema, following `properties`, items, `oneOf` variant tags, and `$ref` indirections. Returns the SchemaObject at the target.

(root: &'a RootSchema, start: &'a SchemaObject, rest: &[&str])

Source from the content-addressed store, hash-verified

82/// `oneOf` variant tags, and `$ref` indirections. Returns the SchemaObject at
83/// the target.
84fn navigate<'a>(root: &'a RootSchema, start: &'a SchemaObject, rest: &[&str]) -> Result<SchemaObject> {
85 let mut current: SchemaObject = resolve(root, start).clone();
86 for seg in rest {
87 current = step_into(root, &current, seg)
88 .with_context(|| format!("could not descend into `{}`", seg))?;
89 }
90 Ok(current)
91}
92
93/// Follow `$ref` references through the root's definitions to land on a
94/// concrete SchemaObject. Returns the input unchanged if no ref.

Callers 1

explainFunction · 0.85

Calls 2

step_intoFunction · 0.85
resolveFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…