https://github.com/1999/json-schema-comparison
JSON Schema semver comparison tool
https://github.com/1999/json-schema-comparison
Last synced: 9 days ago
JSON representation
JSON Schema semver comparison tool
- Host: GitHub
- URL: https://github.com/1999/json-schema-comparison
- Owner: 1999
- Created: 2017-09-04T02:44:56.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-09-04T04:09:22.000Z (over 7 years ago)
- Last Synced: 2025-02-17T03:44:14.264Z (3 months ago)
- Language: TypeScript
- Size: 7.81 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# JSON Schema comparison tool
[](https://greenkeeper.io/)
[](https://travis-ci.org/1999/json-schema-comparison)
[](https://david-dm.org/1999/json-schema-comparison#info=devDependencies)This projected started as internal tool used to compare JSON schemas. it doesn't have support for all of JSON schema types and attributes. However you're more than welcome to create a PR for it and add/fix whatever part of standard you're missing.
Comparison is based on SnowPlow SchemaVer data model. Read why semver cannot be applied to schema comparison [here]([Snowplow](https://snowplowanalytics.com/blog/2014/05/13/introducing-schemaver-for-semantic-versioning-of-schemas/)).
## Install
```
npm install json-schema-comparison --save
```# Usage
## Javascript
```javascript
const compare = require('json-schema-comparison');
const compat = compare(oldSchema, newSchema); // can be "model", "revision", "addition" and "equal"
```## Typescript
```typescript
import { default as compare, CompareResult } from 'json-schema-comparison';
const compat: CompareResult = compare(oldSchema, newSchema);
```