Combines multiple Swagger/OpenAPI 2.0 schemas into a single dereferenced schema. Version 1.4.0 is the latest stable release, with no recent updates; the package is in maintenance mode. Key differentiators: supports merging APIs from local files, URLs, and objects; provides both Promise and callback APIs; includes Express middleware for serving the combined schema; and offers a CLI for quick merging. Unlike alternatives like swagger-merger or api-spec-converter, it focuses purely on combining Swagger 2.0 specs without transformation to OpenAPI 3.
npm install swagger-combineNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates basic usage: loading a config file, combining APIs, and handling the result or error.
Always use .then()/catch() or async/await, or pass a callback as second argument.
Avoid circular $ref chains; consider using JSON Schema $Ref Parser options if needed.
Use a leading slash only (e.g., "/api") and avoid trailing slash in base.
For OpenAPI 3.0, consider using api-spec-converter or swagger-merger.
Ensure the config file exists at the path passed to swaggerCombine(), or create one.
Use const swaggerCombine = require('swagger-combine');Validate that all API definitions in the 'apis' array have valid Swagger/OpenAPI 2.0 structure.