Lots of OpenAPI specifications are exploded out across lots of different files. This is great for maintainability, but not so great for portability.

Many OpenAPI tools do not support exploded / multi-file OpenAPI specifications.

Loading and locating references can be tricky, particularly when they are spread across local or remote file systems, so lots of tools just give up on trying to locate references and just ask for a single monolithic file.

Local references (references inside the root document) are not bundled, They stay in place.


Bundle an OpenAPI specification

vacuum bundle expanded-openapi.yaml bundled-openapi.yaml

Circular References will be ignored when bundling.

Available Flags

bundle supports the following flags

Short Full Input Description
-q –no-style bool Disable color and style console output (useful for CI/CD)
-i –stdin bool Use stdin instead of reading OpenAPI spec from a file
-o –stdout bool Use stdout instead of writing report to a file
-p –base string Base filepath or URL to external references