Skip to main content

scan_forbidden_keys

Function scan_forbidden_keys 

Source
pub fn scan_forbidden_keys(
    spec: &Value,
    root_path: &[String],
) -> Result<(), ComposeLoadError>
Expand description

Recursively scan a composed single spec for any forbidden meta key at any depth. Returns Err(ComposeLoadError { code: FORBIDDEN_META_KEY }) on the first hit, with the dotted path to the offending key in message and trace.

The scan descends into every object value AND every array element (a forbidden key nested inside an array of sub-specs is caught too). Map keys are checked before descending into their values, so the reported path points at the shallowest offending key.

root_path is the path prefix for the error trace; the load path seeds it with ["properties"] so a hit reports properties.<field>.… (4-language path convention).