JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3133
  • Score
    100M100P100Q173040F
  • License Apache-2.0

Package Exports

  • json-schema-diff-validator

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (json-schema-diff-validator) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

json-schema-diff-validator

This package allows comparision of two versions of schema file and detect any breaking change. The new version is considered as non-backward compatible when

  • a new node with minimum requirement is added.
  • when a node is removed.
  • when a node is replaced.

Usage

npm install json-schem-diff-validator -g
json-schema-diff-validator oldschema.json newschema.json

This will return with exit code 0 if there is no breaking change. Throws an exception if there is a breaking change

Error: The schema is not backward compatible. Difference include breaking change =
[{"op":"remove","path":"/definitions/code_inline_node/allOf/1/properties"},{"op":"replace","path":"/definitions/code_inline_node/allOf/1/type","value":"string"}]

To use it in code

 const difftool = require('json-schema-diff-validator')
 #to validate files
 difftool.validateSchemaFiles(file1,file2);
 #to validate json objects
 difftool.validateSchemaCompatibility(oldjson , newjson)

Supported options:

  • allowNewOneOf - new oneOf items are considered a backwards compatible change (false by default)
  • allowNewEnumValues - new enum values are considered a backwards compatible change (false by default)