@stoplight/json-schema-generator
Version:
JSON schema generator based on draft-v4.
16 lines (12 loc) • 319 B
JavaScript
;
var Compiler = require('./compiler');
var AST = require('./ast.js');
var utils = require('./utils');
var jsonToSchema = function(json) {
var compiler = new Compiler();
var ast = new AST();
ast.build(json);
compiler.compile(ast.tree);
return compiler.schema;
};
module.exports = jsonToSchema;