JSON-SCHEMA 是一种基于 JSON 格式定义 JSON 数据结构的规范,有以下特性:git
{ "type": "object", "properties": { "id": { "type": "integer" }, "name": { "type": "string" }, "price": { "type": "number", "minimum": 0, "exclusiveMinimum": true } }, "required": ["id", "name"] }
做者为何开发一个 easy-Json-schema 工具呢,就是为了简化 json-schema 定义,你们看看上面的 json 定义,一个很简单结构的 json 用了很是多的字段定义,书写起来很是麻烦。github
若是用 easy-json-schema 定义上面的 json结构,是很是清晰和易用的。json
{ "*id": "integer", "*type": "string", "price":{ "type": "number", "minimum": 0, "exclusiveMinimum": true } }
感兴趣的朋友能够关注下数据结构
github: github.com/easy-json-schema工具
在线演示: easy-json-schema.github.io测试