Generate JSON Schema from JSON Objects.
$ npm install -g json2schema
CLI Tool
$ json2schema -h
Usage: json2schema [options] <URL|filename>
Convert JSON Objects to JSON Schema.
Options:
-h, --help output usage information
-V, --version output the version number
-o, --out <out> Specify the path and filename you want to output your schema document to. Defaults to "./schema.json"
In your JavaScript
var Coverter = require('json2schema');
var generatedSchema = Converter.convert({
data: <JSONObject>
});
$ json2schema ./jsondocs/myObject.json --out ../../schema.json
Contributions are welcomed and encouraged. See CONTRIBUTING.md for instructions.