Skip to main content

resolve_field_path

Function resolve_field_path 

Source
pub fn resolve_field_path(known_paths: &[String], raw: &str) -> String
Expand description

Resolve a CLI-typed config path to its canonical form.

Field segments derived from the schema are kebab-case; aliases are snake-only per validate_alias_key. For each known canonical path, segments are compared pairwise: equal verbatim, equal after swapping -_ when the canonical segment contains -, or equal after swapping _- for the final field segment. The final-segment rule lets older CLI spelling like api-key resolve to schema-canonical api_key without rewriting map aliases such as my_bot. Returns raw unchanged when no canonical path matches.