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])
| 82 | /// `oneOf` variant tags, and `$ref` indirections. Returns the SchemaObject at |
| 83 | /// the target. |
| 84 | fn 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, ¤t, 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. |