项目作者: mkorneev

项目描述 :
A command line tool to test if one JSON file is backwards compatible with another
高级语言: Haskell
项目地址: git://github.com/mkorneev/json_compatibility_test.git
创建时间: 2018-02-04T23:13:27Z
项目社区:https://github.com/mkorneev/json_compatibility_test

开源协议:MIT License

下载


JSON Backwards Compatibility Test Tool

A command line tool to test if one JSON file is backwards compatible with another.

By default new names in objects are allowed, arrays should be of the same length and values should match exactly.

This can be overridden by providing a specification file.

Specification format

Specification resembles structure of the original JSON file.

  1. [
  2. { // describes the array itself
  3. "@allow_adding_items": true | false, // false by default
  4. "@allow_removing_items": true | false, // false by default
  5. "@index_by": "id", // sort array items by this field (null by default)
  6. "@compare_by": "name", // deem two object equal if their "name" fields are equal
  7. },
  8. { // describes array items
  9. "@allow_adding_names": true | false, // true by default
  10. "@allow_removing_names": true | false, // false by default
  11. "name1": "@ignore_name", // this name can be absent in the new version
  12. "name2": "@ignore_value", // do not check this value for equality
  13. "name3": { "@abs": 10 }, // value must be a number and must not differ for more than 10 from the original value
  14. "name4": { "@rel": 0.1 }, // value must be a number and must not differ for more than 10% of the original value
  15. "name5": { "@time": "10 sec" }, // value must be an ISO 8601 timestamp and must not differ for more than 10 seconds from the original value
  16. "name6": { "@time": "5 min" }, // value must be an ISO 8601 timestamp and must not differ for more than 5 minutes from the original value
  17. }
  18. ]

Usage example

TBD