Skip to main content

find_undefined_variables

Function find_undefined_variables 

Source
pub fn find_undefined_variables(
    content: &str,
    data: &HashMap<String, Value>,
) -> Vec<String>
Expand description

Find template variables referenced in content that are not defined in data. Returns the list of undefined variable names (with nested attribute access like "pkgg.version"). This uses minijinja’s static analysis to detect undeclared variables, so it does not depend on runtime control flow.

Returns an empty Vec when data is empty (no data configured means template rendering is a no-op) or when the content has no template syntax.