@counterfact/openapi
v0.1.1
Published
Load, bundle, dereference, and overlay OpenAPI documents without starting Counterfact.
Maintainers
Readme
@counterfact/openapi
Load, bundle, dereference, and apply ordered OpenAPI overlays without starting the Counterfact server, generator, or REPL.
import {
applyOverlays,
bundleOpenApiDocument,
loadOpenApiDocument,
} from "@counterfact/openapi";
const dereferenced = await loadOpenApiDocument("./openapi.yaml", [
"./development.overlay.yaml",
]);
const bundled = await bundleOpenApiDocument("./openapi.yaml");
await applyOverlays(dereferenced, ["./local.overlay.yaml"]);
void bundled;loadOpenApiDocument resolves references completely. Use
bundleOpenApiDocument when a consumer needs external references folded into
one document while retaining internal references. Overlay paths are applied in
the order provided.
See examples/load-local-spec.mjs for a
complete public-import example.
