Skip to content

Commit 1e959d1

Browse files
committed
refactor: split format.json to multiple files, fix incorrect relative-json-pointer test, closes #162, closes #208
1 parent 870b9f7 commit 1e959d1

20 files changed

+723
-691
lines changed

index.js

+9-9
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,21 @@ const refs = {
1313

1414
const SKIP = {
1515
4: ['optional/zeroTerminatedFloats'],
16-
7: ['optional/content', 'optional/format']
16+
7: [
17+
'format/idn-email',
18+
'format/idn-hostname',
19+
'format/iri',
20+
'format/iri-reference',
21+
'optional/content'
22+
]
1723
};
1824

1925
[4, 6, 7].forEach((draft) => {
20-
let opts = {
21-
format: 'full',
22-
unknownFormats: ['iri', 'iri-reference', 'idn-hostname', 'idn-email']
23-
};
24-
2526
let ajv;
2627
if (draft == 7) {
27-
ajv = new Ajv(opts);
28+
ajv = new Ajv({format: 'full'});
2829
} else {
29-
opts.meta = false;
30-
ajv = new Ajv(opts);
30+
ajv = new Ajv({format: 'full', meta: false});
3131
ajv.addMetaSchema(require(`ajv/lib/refs/json-schema-draft-0${draft}.json`));
3232
ajv._opts.defaultMeta = `http://json-schema.org/draft-0${draft}/schema#`;
3333
}

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"homepage": "https://github.com/json-schema-org/JSON-Schema-Test-Suite#readme",
2323
"devDependencies": {
2424
"ajv": "^6.0.0-rc.0",
25-
"json-schema-test": "^1.3.0",
25+
"json-schema-test": "^2.0.0",
2626
"mocha": "^3.2.0"
2727
}
2828
}

0 commit comments

Comments
 (0)