This tool lets you to merge a few swagger spec files into one.
Why? Because swagger 2.0 spec does not support sufficient modularity.
The input swagger specs must follow a convention:
- There is exactly one master
swagger.json
into which others are merged. - Any number of partials, whose elements are to be merged.
- All input files are valid swagger files alone, except for master which may have no paths.
- Only paths, definitions, parameters and responses are copied from partials.
- If element is defined only in one partial, it is copied as is.
- If element exists in more than one partial, then:
- if master already contains the element, masters version is used
- if all definitions are equal, they are copied to output
- if any definition is not equal to other, merge fails
basePath
is pre-appended to all paths in partials before mergingbasePath
is not allowed in master file