Skip to content
This repository has been archived by the owner on Aug 13, 2021. It is now read-only.
/ swagger-combine Public archive

Opinionated tool to shallow-merge two or more swagger 2.0 specs into one

Notifications You must be signed in to change notification settings

Rebilly/swagger-combine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@rebilly/swagger-combine

Opinionated tool to shallow-merge two or more swagger 2.0 specs into one.

Install

Using npm:

 npm install @rebilly/swagger-combine

or yarn:

yarn add @rebilly/swagger-combine

Usage

const { combineSpecs } = require('@rebilly/swagger-combine');

const merged = combineSpecs([
  'https://rebilly.github.io/RebillyAPI/openapi.json',
  'https://rebilly.github.io/RebillyUserAPI/openapi.json',
  'https://rebilly.github.io/RebillyReportsAPI/openapi.json',
]);

Usage as a CLI tool

Install globally:

npm install -g @rebilly/swagger-combine

or

yarn global add @rebilly/swagger-combine

or use npx

swagger-combine <baseSpec> [specs...]

Positionals:
  baseSpec  Base spec URL                                               [string]
  specs     List of spec URLs to merge                                  [string]

Options:
  --help        Show help                                              [boolean]
  --version     Show version number                                    [boolean]
  --output, -o  Output filename, by default stdout will be used         [string]

Examples:
  [combine 3 specs]
    
    swagger-combine -o merged.json https://rebilly.github.io/RebillyAPI/openapi.json https://rebilly.github.io/RebillyUserAPI/openapi.json https://rebilly.github.io/RebillyReportsAPI/openapi.json

About

Opinionated tool to shallow-merge two or more swagger 2.0 specs into one

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published