Redocly CLI supports practical transformations of OpenAPI definitions when a single file becomes difficult to maintain or a deployment pipeline needs one assembled artifact. section 8.13.4 section 9.1.1
Use its documented workflow to:
- Split a large OpenAPI definition into reusable YAML or JSON fragments with configurable output-file naming. section 8.13.4
- Bundle a multifile definition into one file before publishing or passing it to later pipeline steps. section 9.1.1
- Combine bundling with filtering, removal of unused components, field sorting, and API linting in a build pipeline. section 9.1.1
Bundle an API definition in CI
Create an output directory, enter the API-definition directory, and run `npx @redocly/cli bundle openapi.yaml --output api.bundled.yaml`; then move the bundled file into `build-output` for subsequent processing.
redocly split product-catalog.oas.yaml --outDir out
Run `redocly split product-catalog.oas.yaml --outDir out` to divide a large definition; inspect the generated fragments because they contain reference objects rather than standard OpenAPI documents. section 8.13.4
