https://github.com/mikeralphson/openapi-diff
Mirror of Atlassian's OpenAPI Diff (from bitbucket.org)
https://github.com/mikeralphson/openapi-diff
api diff json openapi openapi3 swagger yaml
Last synced: 2 months ago
JSON representation
Mirror of Atlassian's OpenAPI Diff (from bitbucket.org)
- Host: GitHub
- URL: https://github.com/mikeralphson/openapi-diff
- Owner: MikeRalphson
- License: other
- Created: 2018-11-22T09:45:42.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-11-22T09:46:38.000Z (over 6 years ago)
- Last Synced: 2024-10-11T23:16:16.813Z (8 months ago)
- Topics: api, diff, json, openapi, openapi3, swagger, yaml
- Language: TypeScript
- Homepage: https://bitbucket.org/atlassian/openapi-diff/
- Size: 362 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# OpenAPI Diff
> A CLI tool to identify differences between Swagger/OpenAPI specs.## Requirements
- nodejs 6.x or higher (tested using 6.x, 8.x and 10.x)
- npm 3.x or higher (tested using 3.x and 5x)## Installation
Install the tool using npm and add it to the package.json
```
npm install openapi-diff --save-dev
```Avoid installing the tool globally as this will lead to problems when multiple codebases try to use different versions
of the tool on the same machine.## Usage
Invoke the tool with two paths to Swagger/OpenAPI files in order to find differences between them, these paths can
either be paths to the specs in the local filesystem or URLs to the specs, both JSON and YAML are supported.
```
./node_modules/.bin/openapi-diff /path/to/source/openapi.json /path/to/destination/openapi.json
./node_modules/.bin/openapi-diff /path/to/source/openapi.yml /path/to/destination/openapi.yml
```The tool's output will display the amount and type of changes, and then list the changes with the relevant info.
Changes are classified as follows:* Breaking: changes that would make existing consumers incompatible with the API (deletion of paths, adding required
properties...)
* Non-breaking: changes that would **not** make existing consumers incompatible with the API (addition of paths,
turning a required property into optional...)
* Unclassified: changes that have been detected by the tool but can't be classified (modifications to X-Properties and
other unforeseen changes)The command will exit with an exit code 1 if any breaking changes were found, so that you can fail builds in CI when
this happens.## Feature support
See [SPEC_SUPPORT.md](SPEC_SUPPORT.md)