Skip to content

Commit be94f5a

Browse files
authored
update to latest JSON schema test suite (#44)
* update_to_latest_JSON_schema_test_suite * adjust tests that must pass to be in benchmark
1 parent 6afaefb commit be94f5a

27 files changed

+18515
-5741
lines changed

README.md

Lines changed: 30 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -8,31 +8,21 @@ for validators that cause side-effects on schema or data.
88

99
# Performance
1010

11-
![performance](https://chart.googleapis.com/chart?chxt=x,y&cht=bhs&chco=76A4FB&chls=2.0&chbh=26,4,1&chs=600x410&chxl=-1:|djv|ajv|json-schema-validator-generator|jsen|is-my-json-valid|themis|jsck|z-schema|@cfworker/json-schema|json-schema-library|jsonschema|skeemas|tv4&chd=t:100,88.7,67.7,54.5,32.7,13.8,4.9,3.8,3.7,1.3,0.7,0.6,0.1)
11+
![performance](https://chart.googleapis.com/chart?chxt=x,y&cht=bhs&chco=76A4FB&chls=2.0&chbh=129,4,1&chs=600x419&chxl=-1:|ajv|is-my-json-valid|@cfworker/json-schema&chd=t:100,44.3,3.8)
1212

1313
|Validator|Relative speed|Number of test runs per second|
1414
|---------|:------------:|:----------------------------:|
15-
|[`djv`](https://github.com/korzio/djv#readme)|100%|96034 (± 0.98%)|
16-
|[`ajv`](https://github.com/epoberezkin/ajv)|88.7%|85154 (± 0.48%)|
17-
|[`json-schema-validator-generator`](https://github.com/danwang/json-schema-validator-generator)|67.7%|64985 (± 0.44%)|
18-
|[`jsen`](https://github.com/bugventure/jsen)|54.5%|52384 (± 1%)|
19-
|[`is-my-json-valid`](https://github.com/mafintosh/is-my-json-valid)|32.7%|31403 (± 0.52%)|
20-
|[`themis`](https://github.com/playlyfe/themis)|13.8%|13227 (± 6.17%)|
21-
|[`jsck`](https://github.com/pandastrike/jsck#readme)|4.9%|4718 (± 0.61%)|
22-
|[`z-schema`](https://github.com/zaggino/z-schema)|3.8%|3657 (± 0.47%)|
23-
|[`@cfworker/json-schema`](https://github.com/cfworker/cfworker/tree/master/packages/json-schema/README.md)|3.7%|3573 (± 0.6%)|
24-
|[`json-schema-library`](https://github.com/sagold/json-schema-library)|1.3%|1218 (± 0.54%)|
25-
|[`jsonschema`](https://github.com/tdegrunt/jsonschema#readme)|0.7%|703 (± 0.93%)|
26-
|[`skeemas`](https://github.com/Prestaul/skeemas#readme)|0.6%|569 (± 0.55%)|
27-
|[`tv4`](https://github.com/geraintluff/tv4)|0.1%|106 (± 0.67%)|
15+
|[`ajv`](https://github.com/epoberezkin/ajv)|100%|35960 (± 0.28%)|
16+
|[`is-my-json-valid`](https://github.com/mafintosh/is-my-json-valid)|44.3%|15947 (± 0.67%)|
17+
|[`@cfworker/json-schema`](https://github.com/cfworker/cfworker/tree/master/packages/json-schema/README.md)|3.8%|1362 (± 0.83%)|
2818

2919
235 tests are run in each test run.
3020

3121
Validators tested: [`json-schema-validator-generator (1.1.9)`](https://github.com/danwang/json-schema-validator-generator), [`is-my-json-valid (2.9.4)`](https://github.com/mafintosh/is-my-json-valid), [`jsen (0.6.6)`](https://github.com/bugventure/jsen), [`ajv (6.9.2)`](https://github.com/epoberezkin/ajv), [`themis (1.1.6)`](https://github.com/playlyfe/themis), [`z-schema (4.2.3)`](https://github.com/zaggino/z-schema), [`jjv (1.0.2)`](https://github.com/acornejo/jjv), [`djv (2.1.2)`](https://github.com/korzio/djv#readme), [`skeemas (1.2.5)`](https://github.com/Prestaul/skeemas#readme), [`schemasaurus (0.7.8)`](https://github.com/AlexeyGrishin/schemasaurus), [`jsck (0.3.2)`](https://github.com/pandastrike/jsck#readme), [`jassi (0.1.2)`](https://github.com/iclanzan/jassi), [`JSV (4.0.2)`](http://github.com/garycourt/JSV), [`request-validator (0.3.3)`](https://github.com/bugventure/request-validator), [`json-gate (0.8.9)`](https://github.com/oferei/json-gate#readme), [`json-model (0.2.9)`](https://github.com/geraintluff/json-model), [`tv4 (1.3.0)`](https://github.com/geraintluff/tv4), [`jsonschema (1.2.6)`](https://github.com/tdegrunt/jsonschema#readme), [`revalidator (0.3.1)`](https://github.com/flatiron/revalidator), [`json-schema-library (4.1.2)`](https://github.com/sagold/json-schema-library), [`@cfworker/json-schema (1.1.4)`](https://github.com/cfworker/cfworker/tree/master/packages/json-schema/README.md),
3222

3323
(validators not in the results above where excluded because of failing tests - see below for details)
3424

35-
[`djv`](https://github.com/korzio/djv#readme) is currently the fastest JSON-schema validator out there.
25+
[`ajv`](https://github.com/epoberezkin/ajv) is currently the fastest JSON-schema validator out there.
3626

3727
The fastest validator has 100%, the rest a lower score relative to the fastest.
3828
If a validator has a score of 5% that means that it's speed is 5% of the fastest,
@@ -44,31 +34,31 @@ This test suite uses the [official JSON-schema test suite](https://github.com/js
4434

4535
If a validator does not pass a test in the official test suite, it will show up in these results.
4636

47-
![failing tests](https://chart.googleapis.com/chart?chxt=x,y&cht=bhs&chco=76A4FB&chls=2.0&chbh=15,4,1&chs=600x419&chxl=-1:|djv|json-schema-library|@cfworker/json-schema|skeemas|jsonschema|ajv|jsen|z-schema|is-my-json-valid|jjv|schemasaurus|jsck|themis|tv4|json-schema-validator-generator|request-validator|jassi|json-model|JSV|json-gate|revalidator&chd=t:1,1,1,6,6,7,9,13,14,26,29,29,30,33,34,39,42,54,72,97,152&chxr=0,0,152&chds=0,152)
37+
![failing tests](https://chart.googleapis.com/chart?chxt=x,y&cht=bhs&chco=76A4FB&chls=2.0&chbh=15,4,1&chs=600x419&chxl=-1:|@cfworker/json-schema|ajv|z-schema|is-my-json-valid|jsonschema|json-schema-library|jsen|tv4|request-validator|jsck|jassi|themis|json-schema-validator-generator|skeemas|schemasaurus|jjv|djv|json-model|JSV|json-gate|revalidator&chd=t:6,16,20,22,25,27,28,42,50,52,56,57,63,63,67,84,88,90,103,179,243&chxr=0,0,243&chds=0,243)
4838

4939
|Validator|Number of failing tests (click for details)|
5040
|---------|-----------------------|
51-
|[`djv`](https://github.com/korzio/djv#readme)|[1](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/djv.md)|
52-
|[`json-schema-library`](https://github.com/sagold/json-schema-library)|[1](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/json-schema-library.md)|
53-
|[`@cfworker/json-schema`](https://github.com/cfworker/cfworker/tree/master/packages/json-schema/README.md)|[1](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/@cfworker/json-schema.md)|
54-
|[`skeemas`](https://github.com/Prestaul/skeemas#readme)|[6](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/skeemas.md)|
55-
|[`jsonschema`](https://github.com/tdegrunt/jsonschema#readme)|[6](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/jsonschema.md)|
56-
|[`ajv`](https://github.com/epoberezkin/ajv)|[7](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/ajv.md)|
57-
|[`jsen`](https://github.com/bugventure/jsen)|[9](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/jsen.md)|
58-
|[`z-schema`](https://github.com/zaggino/z-schema)|[13](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/z-schema.md)|
59-
|[`is-my-json-valid`](https://github.com/mafintosh/is-my-json-valid)|[14](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/is-my-json-valid.md)|
60-
|[`jjv`](https://github.com/acornejo/jjv)|[26](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/jjv.md)|
61-
|[`schemasaurus`](https://github.com/AlexeyGrishin/schemasaurus)|[29](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/schemasaurus.md)|
62-
|[`jsck`](https://github.com/pandastrike/jsck#readme)|[29](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/jsck.md)|
63-
|[`themis`](https://github.com/playlyfe/themis)|[30](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/themis.md)|
64-
|[`tv4`](https://github.com/geraintluff/tv4)|[33](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/tv4.md)|
65-
|[`json-schema-validator-generator`](https://github.com/danwang/json-schema-validator-generator)|[34](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/json-schema-validator-generator.md)|
66-
|[`request-validator`](https://github.com/bugventure/request-validator)|[39](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/request-validator.md)|
67-
|[`jassi`](https://github.com/iclanzan/jassi)|[42](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/jassi.md)|
68-
|[`json-model`](https://github.com/geraintluff/json-model)|[54](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/json-model.md)|
69-
|[`JSV`](http://github.com/garycourt/JSV)|[72](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/JSV.md)|
70-
|[`json-gate`](https://github.com/oferei/json-gate#readme)|[97](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/json-gate.md)|
71-
|[`revalidator`](https://github.com/flatiron/revalidator)|[152](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/revalidator.md)|
41+
|[`@cfworker/json-schema`](https://github.com/cfworker/cfworker/tree/master/packages/json-schema/README.md)|[6](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/@cfworker/json-schema.md)|
42+
|[`ajv`](https://github.com/epoberezkin/ajv)|[16](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/ajv.md)|
43+
|[`z-schema`](https://github.com/zaggino/z-schema)|[20](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/z-schema.md)|
44+
|[`is-my-json-valid`](https://github.com/mafintosh/is-my-json-valid)|[22](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/is-my-json-valid.md)|
45+
|[`jsonschema`](https://github.com/tdegrunt/jsonschema#readme)|[25](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/jsonschema.md)|
46+
|[`json-schema-library`](https://github.com/sagold/json-schema-library)|[27](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/json-schema-library.md)|
47+
|[`jsen`](https://github.com/bugventure/jsen)|[28](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/jsen.md)|
48+
|[`tv4`](https://github.com/geraintluff/tv4)|[42](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/tv4.md)|
49+
|[`request-validator`](https://github.com/bugventure/request-validator)|[50](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/request-validator.md)|
50+
|[`jsck`](https://github.com/pandastrike/jsck#readme)|[52](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/jsck.md)|
51+
|[`jassi`](https://github.com/iclanzan/jassi)|[56](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/jassi.md)|
52+
|[`themis`](https://github.com/playlyfe/themis)|[57](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/themis.md)|
53+
|[`json-schema-validator-generator`](https://github.com/danwang/json-schema-validator-generator)|[63](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/json-schema-validator-generator.md)|
54+
|[`skeemas`](https://github.com/Prestaul/skeemas#readme)|[63](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/skeemas.md)|
55+
|[`schemasaurus`](https://github.com/AlexeyGrishin/schemasaurus)|[67](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/schemasaurus.md)|
56+
|[`jjv`](https://github.com/acornejo/jjv)|[84](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/jjv.md)|
57+
|[`djv`](https://github.com/korzio/djv#readme)|[88](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/djv.md)|
58+
|[`json-model`](https://github.com/geraintluff/json-model)|[90](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/json-model.md)|
59+
|[`JSV`](http://github.com/garycourt/JSV)|[103](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/JSV.md)|
60+
|[`json-gate`](https://github.com/oferei/json-gate#readme)|[179](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/json-gate.md)|
61+
|[`revalidator`](https://github.com/flatiron/revalidator)|[243](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/revalidator.md)|
7262

7363
Some validators have deliberately chosen not to support parts of the spec. Go to the homepage of the validator to learn if
7464
that is the case for these tests.
@@ -79,9 +69,9 @@ Number of tests that caused side-effects. The schema or data was altered by the
7969

8070
|Validator|Number of side-effects (BAD)|
8171
|---------|----------------------------|
82-
|[`tv4`](https://github.com/geraintluff/tv4)|[11](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/tv4-side-effects.md)|
83-
|[`revalidator`](https://github.com/flatiron/revalidator)|[320](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/revalidator-side-effects.md)|
84-
|[`json-model`](https://github.com/geraintluff/json-model)|[338](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/json-model-side-effects.md)|
72+
|[`tv4`](https://github.com/geraintluff/tv4)|[13](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/tv4-side-effects.md)|
73+
|[`revalidator`](https://github.com/flatiron/revalidator)|[551](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/revalidator-side-effects.md)|
74+
|[`json-model`](https://github.com/geraintluff/json-model)|[578](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/json-model-side-effects.md)|
8575

8676
Validators not in the list have no side-effects on data or schemas.
8777

reports/@cfworker/json-schema.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,22 @@
22

33
# All validators fail this test
44

5+
`ECMA 262 \s matches ascii whitespace only, latin-1 non-breaking-space does not match (unlike e.g. Python)`
6+
7+
`Proper UTF-16 surrogate pair handling: patternProperties, doesn't match two`
8+
59
`some languages do not distinguish between different types of numeric value, a float is not an integer even without fractional part`
610

11+
# [`@cfworker/json-schema`](https://github.com/cfworker/cfworker/tree/master/packages/json-schema/README.md) failed tests
12+
13+
Some validators have deliberately chosen not to support parts of the spec. Go to the [`@cfworker/json-schema`](https://github.com/cfworker/cfworker/tree/master/packages/json-schema/README.md) homepage to learn if
14+
that is the case for these tests.
15+
16+
|test failed|reason
17+
|-----------|------
18+
`ECMA 262 \S matches everything but ascii whitespace, latin-1 non-breaking-space matches (unlike e.g. Python)`|Expected result: `true` but validator returned: `false`
19+
`Proper UTF-16 surrogate pair handling: pattern, matches empty`|Expected result: `true` but validator returned: `false`
20+
`Proper UTF-16 surrogate pair handling: pattern, matches two`|Expected result: `true` but validator returned: `false`
721

822
**All other tests passed**.
923

0 commit comments

Comments
 (0)