MCPcopy Create free account
hub / github.com/concensure/Semantic / trim_empty_code_fields

Function trim_empty_code_fields

semantic_app/src/route.rs:1608–1627  ·  view source on GitHub ↗
(result: &mut serde_json::Value)

Source from the content-addressed store, hash-verified

1606}
1607
1608fn trim_empty_code_fields(result: &mut serde_json::Value) {
1609 for key in ["context", "ranked_context"] {
1610 let Some(items) = result.get_mut(key).and_then(|value| value.as_array_mut()) else {
1611 continue;
1612 };
1613 for item in items {
1614 let Some(obj) = item.as_object_mut() else {
1615 continue;
1616 };
1617 let remove_code = obj
1618 .get("code")
1619 .and_then(|value| value.as_str())
1620 .map(|code| code.trim().is_empty())
1621 .unwrap_or(false);
1622 if remove_code {
1623 obj.remove("code");
1624 }
1625 }
1626 }
1627}
1628
1629fn trim_healthy_reference_only_mutation_payload(
1630 result: &mut serde_json::Value,

Callers 1

handle_autorouteMethod · 0.85

Calls 1

getMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…