Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

json-schema-diff

Package Overview
Dependencies
Maintainers
4
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-schema-diff

A language agnostic CLI tool and nodejs api to identify differences between two json schema files.

  • 0.17.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
72K
decreased by-41.27%
Maintainers
4
Weekly downloads
 
Created

What is json-schema-diff?

The json-schema-diff npm package is a tool for comparing JSON schemas. It helps identify differences between two JSON schemas, which can be useful for versioning, migration, and ensuring compatibility between different versions of APIs or data structures.

What are json-schema-diff's main functionalities?

Compare JSON Schemas

This feature allows you to compare two JSON schemas and identify the differences between them. The code sample demonstrates how to use the json-schema-diff package to compare two schemas and print the differences.

const jsonSchemaDiff = require('json-schema-diff');

const schema1 = {
  type: 'object',
  properties: {
    name: { type: 'string' },
    age: { type: 'number' }
  },
  required: ['name']
};

const schema2 = {
  type: 'object',
  properties: {
    name: { type: 'string' },
    age: { type: 'number' },
    email: { type: 'string' }
  },
  required: ['name', 'email']
};

jsonSchemaDiff.diffSchemas({
  sourceSchema: schema1,
  destinationSchema: schema2
}).then((diff) => {
  console.log(JSON.stringify(diff, null, 2));
}).catch((error) => {
  console.error(error);
});

Other packages similar to json-schema-diff

Keywords

FAQs

Package last updated on 11 Oct 2021

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