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

Function map_value

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

If `s` is a "map type" (object with `additionalProperties` and no declared properties — what schemars emits for `BTreeMap `), return the value schema. Else `None`.

(s: &'a SchemaObject)

Source from the content-addressed store, hash-verified

225/// properties — what schemars emits for `BTreeMap<String, T>`), return the
226/// value schema. Else `None`.
227fn map_value<'a>(s: &'a SchemaObject) -> Option<&'a SchemaObject> {
228 let obj = s.object.as_ref()?;
229 if !obj.properties.is_empty() {
230 return None;
231 }
232 let ap = obj.additional_properties.as_deref()?;
233 match ap {
234 Schema::Object(o) => Some(o),
235 Schema::Bool(_) => None,
236 }
237}
238
239/// Find the (property-name, const-value) pair that identifies a tagged-union
240/// variant inside `vo`. schemars represents `#[serde(tag = "X")]` as a single

Callers 3

step_intoFunction · 0.85
unwrap_containerFunction · 0.85
describe_typeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…