Bundle an OpenAPI document by inlining all external $ref targets.
Walks every $ref in the document. For external refs (not starting with #),
calls the resolver to fetch the external document, extracts the referenced
schema, inlines it into components.schemas under a synthesised name, and
rewrites the original $ref to point at the new internal location
(#/components/schemas/<name>).
Identical external refs share a single entry — the second occurrence of
the same (uri, fragment) pair reuses the name produced for the first.
Name collisions between different refs are resolved by suffixing a counter.
The resolver is called once per unique URI and the result is cached.
Returns a deep-cloned document with all external refs replaced by internal
refs. The original document is never mutated.
Bundle an OpenAPI document by inlining all external $ref targets.
Walks every $ref in the document. For external refs (not starting with
#), calls the resolver to fetch the external document, extracts the referenced schema, inlines it intocomponents.schemasunder a synthesised name, and rewrites the original $ref to point at the new internal location (#/components/schemas/<name>).Identical external refs share a single entry — the second occurrence of the same
(uri, fragment)pair reuses the name produced for the first. Name collisions between different refs are resolved by suffixing a counter.The resolver is called once per unique URI and the result is cached.
Returns a deep-cloned document with all external refs replaced by internal refs. The original document is never mutated.