Cycle detection is performed via a visitedSet of object references, so
schemas may safely be shared across multiple branches without causing
infinite recursion.
Use-site aliases walk their canonical definition. Lazy schemas resolve their
getter; the shared visited set prevents cycles through named recursive roots.
Recursively visits every SchemaBuilder reachable from
schemaand calls SchemaRegistry.register on each node.Cycle detection is performed via a
visitedSetof object references, so schemas may safely be shared across multiple branches without causing infinite recursion.Use-site aliases walk their canonical definition. Lazy schemas resolve their getter; the shared visited set prevents cycles through named recursive roots.