Skip to content

Commit d3e8ab4

Browse files
committed
Merge branch 'sagold-add-validator/json-schema-library'
2 parents c490327 + bfa4c9a commit d3e8ab4

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

index.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ var schemasaurus = require('schemasaurus');
2020
var ajv = require('ajv')();
2121
var djv = require('djv')();
2222
var jsvg = require('json-schema-validator-generator').default;
23+
var jlib = require("json-schema-library");
2324

2425
var refs = {
2526
'http://json-schema.org/draft-04/schema': require('./refs/json-schema-draft-04.json'),
@@ -32,6 +33,7 @@ var refs = {
3233
Object.keys(refs).forEach(function (uri) {
3334
ajv.addSchema(refs[uri], uri);
3435
djv.addSchema(uri, refs[uri]);
36+
jlib.addSchema(uri, refs[uri]);
3537
});
3638

3739
testRunner([
@@ -264,5 +266,14 @@ testRunner([
264266
test: function (instance, json, schema) {
265267
return instance.validate(json, schema).valid;
266268
}
269+
},
270+
{
271+
name: 'json-schema-library',
272+
setup: function (schema) {
273+
return new jlib.cores.Draft04(schema);
274+
},
275+
test: function (instance, json, schema) {
276+
return instance.isValid(schema, json);
277+
}
267278
}
268279
]);

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"jsen": "latest",
1919
"json-gate": "latest",
2020
"json-model": "latest",
21+
"json-schema-library": "latest",
2122
"json-schema-validator-generator": "latest",
2223
"json-stringify-safe": "^5.0.1",
2324
"jsonschema": "latest",

0 commit comments

Comments
 (0)