{"_id":"easy-json-schema","_rev":"431697","name":"easy-json-schema","description":"A succinct json-schema language, Convert json into json-schema.","dist-tags":{"latest":"0.0.2-beta"},"maintainers":[{"name":"suxiaoxin","email":"susky369@gmail.com"}],"time":{"modified":"2021-08-05T03:49:46.000Z","created":"2017-12-13T11:57:41.191Z","0.0.2-beta":"2017-12-15T01:50:55.551Z","0.0.1-beta":"2017-12-13T11:57:41.191Z"},"users":{},"author":{"name":"suxiaoxin"},"repository":{"type":"git","url":"git+https://github.com/suxiaoxin/easy-json-schema.git"},"versions":{"0.0.2-beta":{"name":"easy-json-schema","version":"0.0.2-beta","description":"A succinct json-schema language, Convert json into json-schema.","main":"index.js","scripts":{"test":"ava"},"repository":{"type":"git","url":"git+https://github.com/suxiaoxin/easy-json-schema.git"},"keywords":["json","to","schema","json","schema","generator"],"author":{"name":"suxiaoxin"},"license":"MIT","bugs":{"url":"https://github.com/suxiaoxin/easy-json-schema/issues"},"homepage":"https://github.com/suxiaoxin/easy-json-schema#readme","devDependencies":{"ava":"^0.24.0"},"gitHead":"81fdfbe1bf63173f299e7b98b2725e99381cf729","_id":"easy-json-schema@0.0.2-beta","_npmVersion":"5.5.1","_nodeVersion":"7.6.0","_npmUser":{"name":"suxiaoxin","email":"hellosean1025@163.com"},"dist":{"shasum":"0613f9c6bee3b9512be072de4cdd7c0f036e44a5","size":3868,"noattachment":false,"key":"/easy-json-schema/-/easy-json-schema-0.0.2-beta.tgz","tarball":"http://registry.cnpm.dingdandao.com/easy-json-schema/download/easy-json-schema-0.0.2-beta.tgz"},"maintainers":[{"name":"suxiaoxin","email":"susky369@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/easy-json-schema-0.0.2-beta.tgz_1513302655488_0.6963027939200401"},"directories":{},"publish_time":1513302655551,"_hasShrinkwrap":false,"_cnpm_publish_time":1513302655551},"0.0.1-beta":{"name":"easy-json-schema","version":"0.0.1-beta","description":"A succinct json-schema language, Convert json into json-schema.","main":"index.js","scripts":{"test":"ava"},"repository":{"type":"git","url":"git+https://github.com/suxiaoxin/easy-json-schema.git"},"keywords":["json","to","schema","json","schema","generator"],"author":{"name":"suxiaoxin"},"license":"MIT","bugs":{"url":"https://github.com/suxiaoxin/easy-json-schema/issues"},"homepage":"https://github.com/suxiaoxin/easy-json-schema#readme","devDependencies":{"ava":"^0.24.0"},"gitHead":"902db5647604a21876106049dda2f48a0c188c59","_id":"easy-json-schema@0.0.1-beta","_npmVersion":"5.5.1","_nodeVersion":"7.6.0","_npmUser":{"name":"suxiaoxin","email":"hellosean1025@163.com"},"dist":{"shasum":"176d17b0141c9776bf9fbbfe3de9d588e0d8a4a0","size":3714,"noattachment":false,"key":"/easy-json-schema/-/easy-json-schema-0.0.1-beta.tgz","tarball":"http://registry.cnpm.dingdandao.com/easy-json-schema/download/easy-json-schema-0.0.1-beta.tgz"},"maintainers":[{"name":"suxiaoxin","email":"susky369@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/easy-json-schema-0.0.1-beta.tgz_1513166261015_0.6964177547488362"},"directories":{},"publish_time":1513166261191,"_hasShrinkwrap":false,"_cnpm_publish_time":1513166261191}},"readme":"# easy-json-schema\nA succinct json-schema language, simplify the json-schema definition.\n\n## install\nnpm install easy-json-schema\n\n## Usage\n```\nconst ejs = require('easy-json-schema');\nconst jsonSchema = ejs(json);\nconsole.log(jsonSchema);\n```\n## example\n\n### Base \nInput:\n\n```\n{\n  \"id\": \"string\",\n  \"*name\": \"string\",\n  \"*email\": \"string\",\n  \"arr\": [{\n    \"site\": \"string\",\n    \"url\": \"string\"\n  }]\n}\n\n```\n\nOutput:\n\n```\n{\n  \"type\": \"object\",\n  \"required\": [\n    \"name\",\n    \"email\"\n  ],\n  \"properties\": {\n    \"id\": {\n      \"type\": \"string\"\n    },\n    \"name\": {\n      \"type\": \"string\"\n    },\n    \"email\": {\n      \"type\": \"string\"\n    },\n    \"arr\": {\n      \"type\": \"array\",\n      \"items\": {\n        \"type\": \"object\",\n        \"required\": [],\n        \"properties\": {\n          \"site\": {\n            \"type\": \"string\"\n          },\n          \"url\": {\n            \"type\": \"string\"\n          }\n        }\n      }\n    }\n  }\n}\n```\n\n### Advance\nInput:\n\n```\n{\n  \"*id\": \"string\",\n  \"*name\": {\n    \"type\": \"string\",\n    \"enum\": [\n      \"tom\",\n      \"jay\"\n    ],\n    \"minLength\": 1,\n    \"maxLength\": 10\n  },\n  \"*images\": [\n    {\n      \"*id\": \"number\",\n      \"names\": {\n        \"type\": \"array\",\n        \"title\": \"Images Collections.\",\n        \"items\": {\n          \"*id\": \"string\",\n          \"*name\": \"string\"\n        }\n      }\n    }\n  ],\n  \"abc\": {\n    \"a\": {\n      \"x\": \"string\",\n      \"y\": {\n        \"type\": \"number\",\n        \"minimum\": 400000,\n        \"maximum\": 900000\n      }\n    }\n  }\n}\n```\n\nOutput:\n```\n{\n  \"type\": \"object\",\n  \"required\": [\n    \"id\",\n    \"name\",\n    \"images\"\n  ],\n  \"properties\": {\n    \"id\": {\n      \"type\": \"string\"\n    },\n    \"name\": {\n      \"type\": \"string\",\n      \"enum\": [\n        \"tom\",\n        \"jay\"\n      ],\n      \"minLength\": 1,\n      \"maxLength\": 10\n    },\n    \"images\": {\n      \"type\": \"array\",\n      \"items\": {\n        \"type\": \"object\",\n        \"required\": [\n          \"id\"\n        ],\n        \"properties\": {\n          \"id\": {\n            \"type\": \"number\"\n          },\n          \"names\": {\n            \"type\": \"array\",\n            \"title\": \"Images Collections.\",\n            \"items\": {\n              \"type\": \"object\",\n              \"required\": [\n                \"id\",\n                \"name\"\n              ],\n              \"properties\": {\n                \"id\": {\n                  \"type\": \"string\"\n                },\n                \"name\": {\n                  \"type\": \"string\"\n                }\n              }\n            }\n          }\n        }\n      }\n    },\n    \"abc\": {\n      \"type\": \"object\",\n      \"required\": [],\n      \"properties\": {\n        \"a\": {\n          \"type\": \"object\",\n          \"required\": [],\n          \"properties\": {\n            \"x\": {\n              \"type\": \"string\"\n            },\n            \"y\": {\n              \"type\": \"number\",\n              \"minimum\": 400000,\n              \"maximum\": 900000\n            }\n          }\n        }\n      }\n    }\n  }\n}\n```\n","_attachments":{},"homepage":"https://github.com/suxiaoxin/easy-json-schema#readme","bugs":{"url":"https://github.com/suxiaoxin/easy-json-schema/issues"},"license":"MIT"}