What is the fastest JSON schema validator for draft-3, draft-4, draft-6 or draft-7?
Some validators are not supporting all drafts. It would be interesting to see rankings per draft-version and also which validator is supporing which draft-version.
@christian-weiss I think it's a really good idea. I don't have time to do much else than accepting PRs and updating the test results as new versions of the testsuite and validators are released. Help would be appreciated :-)
An easy way would be to host separate branches for each draft, e.g.:
- draft-04
- draft-06
- draft-07
- draft2019-09
And add a simple menu in the README to switch between those branches.
Default could be any of those (I would vote for anything newer than 04).
#48 implements draft-06 tests.
Menu in the readme, super great idea. I guess it's also misleading that the current readme doesn't show you that it's actually testing only draft-4
I have added draft 4 and 6, draft 6 is the default, now... I'm out of touch with the developments in the standard. Would it make sense to make draft2019-09 the default, or do too few validators support that?
As drafts are drafts, i would not call them "standard". As far as i know draft-3, draft-4, draft-6 and draft-7 are somehow "stable", so i do not expect big changes here. So i vote for making "draft-7" the default.
@daniela-waranie I have added tests for draft-7: https://github.com/ebdrup/json-schema-benchmark/tree/master/draft7 But I chose to not make it the default as all validators fail a LOT of the tests - I'm not sure if I'm doing something wrong or validators are really so bad at draft-7? I think it's probably me doing something wrong, so I can't make it the default right now.
@ebdrup I think it would be good to use draft-7 as the default. It's ajv's default draft version and the most modern of the stable drafts.
The test results look correct to me- the failures here: https://github.com/ebdrup/json-schema-benchmark/blob/master/draft7/reports/@cfworker/json-schema.md Match the unsupported tests here: https://github.com/cfworker/cfworker/blob/main/packages/json-schema/test/index.spec.ts#L7