json-schema-diff-validator ==========================
Homepage Repository npm JavaScript Download
npm install json-schema-diff-validator@0.4.2
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
npm install json-schema-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"}]
const difftool = require('json-schema-diff-validator')
#to validate files
difftool.validateSchemaFiles(file1,file2);
#to validate json objects
difftool.validateSchemaCompatibility(oldjson , newjson)
Supported options:
false
by default)false
by default)anyOf
items are considered a backwards compatible change (false
by default)