# `A2UICore.Catalog.ReferenceMap`
[🔗](https://github.com/a2ui-elixir/a2ui/blob/v0.1.1/umbrella/apps/a2ui_core/lib/a2ui_core/catalog/reference_map.ex#L1)

Derives, from a catalog's component schemas, which properties are
child references — the data `A2UICore.Catalog.RefSpec` extracts from.

The analysis is a port of the reference `analyze_child_ref_schema` for
JSON Schema components. A property is a **single** child reference
when its schema is (or `allOf`/`anyOf`/`oneOf`-combines) a `$ref` to
`ComponentId` or `Child`; a **list** when it refs `ChildList`, carries
`explicitList`/`template` properties, or looks like a `componentId` +
`path` template. An array whose items are child references is a list,
and an array of objects with child-reference properties is a list
with `nested` item keys (`tabs[].child`).

Local `#/…` references are followed through the component's own
`$defs` and the enclosing catalog document, with cycle protection.
References to other documents (`common_types.json#/…`) are recognised
by name only and not followed.

# `analyze`
*since 0.1.0* 

```elixir
@spec analyze(term(), map() | nil) :: A2UICore.Catalog.RefSpec.t()
```

Analyses one component schema. `catalog` is the enclosing catalog
document used to resolve `#/…` references that leave the component.

# `build`
*since 0.1.0* 

```elixir
@spec build(map()) :: %{optional(String.t()) =&gt; A2UICore.Catalog.RefSpec.t()}
```

Builds `%{component_name => RefSpec}` for every component of a catalog
document (`%{"components" => %{name => schema}, "$defs" => …}`).

---

*Consult [api-reference.md](api-reference.md) for complete listing*
