OptionalsharedOptionalsharedThe allOf array of each intersection encountered during traversal, innermost first. finalize folds every emitted object holding one; see foldIntersection.
Rewrites a processor deferred to finalize, where the flatten has resolved every ref and the union branches are in place.
Optionalexternal
Registry conversions share one
seenmap across every emitted schema. These hold theexternalthe whole-map passes below last ran for, so the passes are not repeated once per schema — and still re-run if the map grows orexternalis swapped.sharedEmitDoneForcovers both passes infinalize: the ref flattening and the$defsbuild.The passes are valid only while nothing they read has changed, so both are cleared in
processSchema()when the map grows, and inJSONSchemaGenerator.emit(), which can also change thecyclesandreusedthey branch on.One case is deliberately not covered: an
overridecallback that writes tometadataRegistrymid-conversion. It runs insidefinalize, 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.