New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

api-smart-diff

Package Overview
Dependencies
Maintainers
1
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

api-smart-diff

Compare two api specifications, supported formats: OpenAPI, AsyncAPI, JsonSchema

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

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")
// {
//   action: "add" | "remove" | "replace",
//   after: 'value after',
//   before: 'value before',
//   path: ['path, 'in', 'array'],
//   type: "annotation" | "breaking" | "non-breaking" | "unclassified"
// }

Browsers

Browser folder contains an Ubundle allowing you to either reference api-smart-diff.min.js in your HTML or import module using Require.js.

Reference apispec-diff.min.js in your HTML and use the global variable ApiSmartDiff.

<script src="node_modules/api-smart-diff/browser/api-smart-diff.min.js"></script>
<script>
  var diff = ApiSmartDiff.syncApiDiff (oldSpec, newSpec, "OpenApi3")
</script>

License

MIT

Keywords

FAQs

Package last updated on 26 Mar 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc