Skip to content

Split format.json, fix relative-json-pointer test #209

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 2, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@ const refs = {

const SKIP = {
4: ['optional/zeroTerminatedFloats'],
7: ['optional/content', 'optional/format']
7: [
'format/idn-email',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should these be 'optional/format/idn-email' etc., or is it just doing a suffix match? It's mildly confusing for them not to match 'optional/content' etc. but I don't feel strongly about it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's how the library names the test groups - it uses the two last segments of the path... Just fixed it to match the names with "-".

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, cool, I had not realized that. That's totally fine then, thanks!

'format/idn-hostname',
'format/iri',
'format/iri-reference',
'optional/content'
]
};

[4, 6, 7].forEach((draft) => {
let opts = {
format: 'full',
unknownFormats: ['iri', 'iri-reference', 'idn-hostname', 'idn-email']
};

let ajv;
if (draft == 7) {
ajv = new Ajv(opts);
ajv = new Ajv({format: 'full'});
} else {
opts.meta = false;
ajv = new Ajv(opts);
ajv = new Ajv({format: 'full', meta: false});
ajv.addMetaSchema(require(`ajv/lib/refs/json-schema-draft-0${draft}.json`));
ajv._opts.defaultMeta = `http://json-schema.org/draft-0${draft}/schema#`;
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"homepage": "https://github.com/json-schema-org/JSON-Schema-Test-Suite#readme",
"devDependencies": {
"ajv": "^6.0.0-rc.0",
"json-schema-test": "^1.3.0",
"json-schema-test": "^2.0.0",
"mocha": "^3.2.0"
}
}
Loading