Skip to main content

value_defaults_on_emptiness

Function value_defaults_on_emptiness 

Source
pub fn value_defaults_on_emptiness(value: &Value) -> bool
Expand description

Decision A: ${path:-default} yields the default on absence or emptiness, never on falsy values. Fires for a JSON null and an empty string; NOT for false, 0, an empty list [], or an empty record {} — those are present values, and Python-style truthiness leaking into a shell would be a silent-wrong factory. (Unset roots and missing keys are absence too, but they surface as PathError before a value exists — see resolve_default.)