Walk one params subtree, carrying the flattened dot-path key accumulated so far. Leaf matchers are inserted into the map consumed by the runtime policy.
(
key: &str,
matcher: ParamMatcherDef,
out: &mut BTreeMap<String, QueryMatcherDef>,
)
| 401 | // Walk one params subtree, carrying the flattened dot-path key accumulated so |
| 402 | // far. Leaf matchers are inserted into the map consumed by the runtime policy. |
| 403 | fn flatten_param_matcher( |
| 404 | key: &str, |
| 405 | matcher: ParamMatcherDef, |
| 406 | out: &mut BTreeMap<String, QueryMatcherDef>, |
| 407 | ) { |
| 408 | match matcher { |
| 409 | ParamMatcherDef::Matcher(matcher) => { |
| 410 | out.insert(key.to_string(), matcher); |
| 411 | } |
| 412 | ParamMatcherDef::Object(children) => { |
| 413 | for (child_key, child) in children { |
| 414 | let nested_key = format!("{key}.{child_key}"); |
| 415 | flatten_param_matcher(&nested_key, child, out); |
| 416 | } |
| 417 | } |
| 418 | } |
| 419 | } |
| 420 | |
| 421 | // Convert flat runtime params back to YAML. MCP gets readable nested params |
| 422 | // when the flat keys can be losslessly split. Non-MCP protocols keep flat keys |
no outgoing calls
no test coverage detected