Skip to main content

get_component_references

Function get_component_references 

Source
pub fn get_component_references(
    component: &Value,
    spec: &RefFieldSpec,
) -> Vec<(String, String)>
Expand description

Extract every (ref_id, field_name) pair from a single v0.9-flat component object.

For single_refs keys: if the value is a string, yield (string, key). For list_refs keys:

  • if the value is an array, yield each string item as (item, "key[i]");
  • if the value is an object containing componentId (the v0.9 Template shape), yield (obj["componentId"], "key.componentId").

Non-matching shapes are silently ignored (graceful).