Creating a JSON Schema for existing YAML values
We can infer a schema from existing YAML values and use it as a starting point when writing a new schema. The steps are:
var JSV = require("./jsv").JSV;
var json = {};
var schema = {"type" : "object"};
var env = JSV.createEnvironment();
var report = env.validate(json, schema);
if (report.errors.length === 0) {
//JSON is valid against the schema
}