api-smart-diff
This package provides utils to compute the diff between two API specifications.
Purpose
- Identify breaking and non-breaking changes.
- Ensure API versioning consistency.
- Generate API changelog.
Compatilibity
- OpenApi 3.0
- AsyncApi 2.1
- JsonSchema
Swagger 2.0 (Roadmap)
graphql (Roadmap)
gRPC (Roadmap)
Installation
npm install api-smart-diff
Usage
Nodejs
import { syncApiDiff } from 'api-smart-diff'
const diff = syncApiDiff(oldSpec, newSpec, "OpenApi3")
Browsers
A browser version of api-smart-diff
is also available via SDN:
<script src="https://cdn.jsdelivr.net/npm/api-smart-diff@latest/browser/api-smart-diff.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/api-smart-diff@latest/browser/api-smart-diff.js"></script>
Reference api-smart-diff.min.js
in your HTML and use the global variable ApiSmartDiff
.
<script>
var diff = ApiSmartDiff.syncApiDiff (oldSpec, newSpec, "OpenApi3")
</script>
License
MIT