OptionalexternalThe allOf array of each intersection encountered during traversal, innermost first. finalize folds every emitted object holding one; see foldIntersection.
OptionalsharedRegistry conversions share one seen map across every emitted schema. These hold the
external the whole-map passes below last ran for, so the passes are not repeated once per
schema — and still re-run if the map grows or external is swapped. sharedEmitDoneFor
covers both passes in finalize: the ref flattening and the $defs build.
The passes are valid only while nothing they read has changed, so both are cleared in
processSchema() when the map grows, and in JSONSchemaGenerator.emit(), which can also change
the cycles and reused they branch on.
One case is deliberately not covered: an override callback that writes to
metadataRegistry mid-conversion. It runs inside finalize, so a registry conversion has
nowhere left to clear the guards, and later schemas keep the ids the first pass saw. That
output was never coherent — before this, whether a shared subschema was inlined or extracted
depended on which registry entry happened to be emitted when the callback fired.
Optionalshared
Rewrites a processor deferred to
finalize, where the flatten has resolved every ref and the union branches are in place.