Skip to content

Commit bb4f07a

Browse files
committed
Plus json-gate
1 parent 84d43a6 commit bb4f07a

File tree

8 files changed

+1321
-71
lines changed

8 files changed

+1321
-71
lines changed

README.md

+13-11
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ for validators that cause side-effects on schema or data.
1212

1313
|Validator|Relative speed|Number of test runs per second|
1414
|---------|:------------:|:----------------------------:|
15-
|[`@exodus/schemasafe`](https://github.com/ExodusMovement/schemasafe)|100%|383641.31%)|
15+
|[`@exodus/schemasafe`](https://github.com/ExodusMovement/schemasafe)|100%|371030.41%)|
1616

1717
235 tests are run in each test run.
1818

19-
Validators tested: [`json-schema-validator-generator (1.1.11)`](https://github.com/danwang/json-schema-validator-generator), [`is-my-json-valid (2.20.4)`](https://github.com/mafintosh/is-my-json-valid#readme), [`jsen (0.6.6)`](https://github.com/bugventure/jsen), [`ajv (6.12.3)`](https://github.com/ajv-validator/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.3-alpha.0)`](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-model (0.2.24)`](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), [`@exodus/schemasafe (1.0.0-beta.2)`](https://github.com/ExodusMovement/schemasafe), [`@cfworker/json-schema (1.2.18)`](https://github.com/cfworker/cfworker/tree/master/packages/json-schema/README.md),
19+
Validators tested: [`json-schema-validator-generator (1.1.11)`](https://github.com/danwang/json-schema-validator-generator), [`is-my-json-valid (2.20.4)`](https://github.com/mafintosh/is-my-json-valid#readme), [`jsen (0.6.6)`](https://github.com/bugventure/jsen), [`ajv (6.12.3)`](https://github.com/ajv-validator/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.3-alpha.0)`](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.23)`](https://github.com/oferei/json-gate#readme), [`json-model (0.2.24)`](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), [`@exodus/schemasafe (1.0.0-beta.2)`](https://github.com/ExodusMovement/schemasafe), [`@cfworker/json-schema (1.2.18)`](https://github.com/cfworker/cfworker/tree/master/packages/json-schema/README.md),
2020

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

@@ -32,31 +32,32 @@ This test suite uses the [official JSON-schema test suite](https://github.com/js
3232

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

35-
![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:|@exodus/schemasafe|@cfworker/json-schema|jsonschema|jsen|json-schema-library|is-my-json-valid|z-schema|ajv|tv4|jsck|jassi|skeemas|schemasaurus|json-schema-validator-generator|jjv|djv|themis|request-validator|json-model|JSV|revalidator&chd=t:1,17,27,40,40,51,52,55,57,64,69,77,87,89,94,95,96,128,167,281,307&chxr=0,0,307&chds=0,307)
35+
![failing tests](https://chart.googleapis.com/chart?chxt=x,y&cht=bhs&chco=76A4FB&chls=2.0&chbh=14,4,1&chs=600x416&chxl=-1:|@exodus/schemasafe|jsen|@cfworker/json-schema|is-my-json-valid|z-schema|ajv|jsck|jassi|json-schema-library|skeemas|schemasaurus|json-schema-validator-generator|jjv|djv|themis|request-validator|json-model|JSV|jsonschema|revalidator|json-gate|tv4&chd=t:1,40,40,51,52,55,64,69,71,77,87,89,94,95,96,128,237,281,292,319,416,696&chxr=0,0,696&chds=0,696)
3636

3737
|Validator|Number of failing tests (click for details)|
3838
|---------|-----------------------|
3939
|[`@exodus/schemasafe`](https://github.com/ExodusMovement/schemasafe)|[1](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/@exodus/schemasafe.md)|
40-
|[`@cfworker/json-schema`](https://github.com/cfworker/cfworker/tree/master/packages/json-schema/README.md)|[17](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/@cfworker/json-schema.md)|
41-
|[`jsonschema`](https://github.com/tdegrunt/jsonschema#readme)|[27](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/jsonschema.md)|
4240
|[`jsen`](https://github.com/bugventure/jsen)|[40](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/jsen.md)|
43-
|[`json-schema-library`](https://github.com/sagold/json-schema-library)|[40](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/json-schema-library.md)|
41+
|[`@cfworker/json-schema`](https://github.com/cfworker/cfworker/tree/master/packages/json-schema/README.md)|[40](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/@cfworker/json-schema.md)|
4442
|[`is-my-json-valid`](https://github.com/mafintosh/is-my-json-valid#readme)|[51](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/is-my-json-valid.md)|
4543
|[`z-schema`](https://github.com/zaggino/z-schema)|[52](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/z-schema.md)|
4644
|[`ajv`](https://github.com/ajv-validator/ajv)|[55](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/ajv.md)|
47-
|[`tv4`](https://github.com/geraintluff/tv4)|[57](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/tv4.md)|
4845
|[`jsck`](https://github.com/pandastrike/jsck#readme)|[64](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/jsck.md)|
4946
|[`jassi`](https://github.com/iclanzan/jassi)|[69](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/jassi.md)|
47+
|[`json-schema-library`](https://github.com/sagold/json-schema-library)|[71](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/json-schema-library.md)|
5048
|[`skeemas`](https://github.com/Prestaul/skeemas#readme)|[77](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/skeemas.md)|
5149
|[`schemasaurus`](https://github.com/AlexeyGrishin/schemasaurus)|[87](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/schemasaurus.md)|
5250
|[`json-schema-validator-generator`](https://github.com/danwang/json-schema-validator-generator)|[89](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/json-schema-validator-generator.md)|
5351
|[`jjv`](https://github.com/acornejo/jjv)|[94](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/jjv.md)|
5452
|[`djv`](https://github.com/korzio/djv#readme)|[95](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/djv.md)|
5553
|[`themis`](https://github.com/playlyfe/themis)|[96](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/themis.md)|
5654
|[`request-validator`](https://github.com/bugventure/request-validator)|[128](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/request-validator.md)|
57-
|[`json-model`](https://github.com/geraintluff/json-model)|[167](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/json-model.md)|
55+
|[`json-model`](https://github.com/geraintluff/json-model)|[237](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/json-model.md)|
5856
|[`JSV`](http://github.com/garycourt/JSV)|[281](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/JSV.md)|
59-
|[`revalidator`](https://github.com/flatiron/revalidator)|[307](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/revalidator.md)|
57+
|[`jsonschema`](https://github.com/tdegrunt/jsonschema#readme)|[292](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/jsonschema.md)|
58+
|[`revalidator`](https://github.com/flatiron/revalidator)|[319](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/revalidator.md)|
59+
|[`json-gate`](https://github.com/oferei/json-gate#readme)|[416](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/json-gate.md)|
60+
|[`tv4`](https://github.com/geraintluff/tv4)|[696](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/tv4.md)|
6061

6162
Some validators have deliberately chosen not to support parts of the spec. Go to the homepage of the validator to learn if
6263
that is the case for these tests.
@@ -67,10 +68,11 @@ Number of tests that caused side-effects. The schema or data was altered by the
6768

6869
|Validator|Number of side-effects (BAD)|
6970
|---------|----------------------------|
70-
|[`jsonschema`](https://github.com/tdegrunt/jsonschema#readme)|[4](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/jsonschema-side-effects.md)|
71+
|[`json-gate`](https://github.com/oferei/json-gate#readme)|[3](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/json-gate-side-effects.md)|
7172
|[`tv4`](https://github.com/geraintluff/tv4)|[13](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/tv4-side-effects.md)|
73+
|[`jsonschema`](https://github.com/tdegrunt/jsonschema#readme)|[23](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/jsonschema-side-effects.md)|
74+
|[`json-model`](https://github.com/geraintluff/json-model)|[957](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/json-model-side-effects.md)|
7275
|[`revalidator`](https://github.com/flatiron/revalidator)|[968](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/revalidator-side-effects.md)|
73-
|[`json-model`](https://github.com/geraintluff/json-model)|[995](https://github.com/ebdrup/json-schema-benchmark/blob/master/reports/json-model-side-effects.md)|
7476

7577
Validators not in the list have no side-effects on data or schemas.
7678

reports/@cfworker/json-schema.md

+23
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,30 @@ that is the case for these tests.
1111

1212
|test failed|reason
1313
|-----------|------
14+
`allOf, mismatch first`|Expected result: `false` but validator returned: `true`. **This excludes this validator from performance tests**
15+
`allOf with base schema, mismatch first allOf`|Expected result: `false` but validator returned: `true`. **This excludes this validator from performance tests**
16+
`invalid type for default, still valid when the invalid default is used`|Expected result: `true` but validator returned: `false`. **This excludes this validator from performance tests**
17+
`dependencies, missing dependency`|Expected result: `false` but validator returned: `true`. **This excludes this validator from performance tests**
18+
`multiple dependencies, missing other dependency`|Expected result: `false` but validator returned: `true`. **This excludes this validator from performance tests**
19+
`items and subitems, wrong sub-item`|Expected result: `false` but validator returned: `true`. **This excludes this validator from performance tests**
20+
`forbidden property, property absent`|Expected result: `true` but validator returned: `false`. **This excludes this validator from performance tests**
21+
`oneOf complex types, first oneOf valid (complex)`|Expected result: `true` but validator returned: `false`. **This excludes this validator from performance tests**
22+
`oneOf with required, both invalid - invalid`|Expected result: `false` but validator returned: `true`. **This excludes this validator from performance tests**
23+
`oneOf with missing optional property, first oneOf valid`|Expected result: `true` but validator returned: `false`. **This excludes this validator from performance tests**
24+
`oneOf with missing optional property, neither oneOf valid`|Expected result: `false` but validator returned: `true`. **This excludes this validator from performance tests**
1425
`validation of e-mail addresses, dot before local part is not valid`|Expected result: `false` but validator returned: `true`
1526
`validation of e-mail addresses, dot after local part is not valid`|Expected result: `false` but validator returned: `true`
1627
`validation of e-mail addresses, two subsequent dots inside local part are not valid`|Expected result: `false` but validator returned: `true`
1728
`Proper UTF-16 surrogate pair handling: pattern, matches empty`|Expected result: `true` but validator returned: `false`
1829
`Proper UTF-16 surrogate pair handling: pattern, matches two`|Expected result: `true` but validator returned: `false`
1930
`Proper UTF-16 surrogate pair handling: patternProperties, doesn't match two`|Expected result: `false` but validator returned: `true`
31+
`multiple simultaneous patternProperties are validated, a single valid match is valid`|Expected result: `true` but validator returned: `false`. **This excludes this validator from performance tests**
32+
`multiple simultaneous patternProperties are validated, a simultaneous match is valid`|Expected result: `true` but validator returned: `false`. **This excludes this validator from performance tests**
33+
`multiple simultaneous patternProperties are validated, multiple matches is valid`|Expected result: `true` but validator returned: `false`. **This excludes this validator from performance tests**
34+
`object properties validation, doesn't invalidate other properties`|Expected result: `true` but validator returned: `false`. **This excludes this validator from performance tests**
35+
`properties, patternProperties, additionalProperties interaction, patternProperty validates nonproperty`|Expected result: `true` but validator returned: `false`. **This excludes this validator from performance tests**
36+
`properties, patternProperties, additionalProperties interaction, additionalProperty ignores property`|Expected result: `true` but validator returned: `false`. **This excludes this validator from performance tests**
37+
`properties, patternProperties, additionalProperties interaction, additionalProperty validates others`|Expected result: `true` but validator returned: `false`. **This excludes this validator from performance tests**
2038
`Does not see elements non existing on the object: 'toString' as number, Valid if not present`|Expected result: `true` but validator returned: `"Instances of \"function\" type are not supported."`. **This excludes this validator from performance tests**
2139
`Does not see elements non existing on the object: 'toString' as object, Valid if not present`|Expected result: `true` but validator returned: `"Instances of \"function\" type are not supported."`. **This excludes this validator from performance tests**
2240
`Does not see elements non existing on the object: 'toString' via required, Invalid if not present`|Expected result: `false` but validator returned: `true`. **This excludes this validator from performance tests**
@@ -25,8 +43,13 @@ that is the case for these tests.
2543
`Does not see elements non existing on the object: 'constructor' via required, Invalid if not present`|Expected result: `false` but validator returned: `true`. **This excludes this validator from performance tests**
2644
`Does not see elements non existing on the object: '__proto__' as number, Valid if not present`|Expected result: `true` but validator returned: `false`. **This excludes this validator from performance tests**
2745
`Does not see elements non existing on the object: '__proto__' via required, Invalid if not present`|Expected result: `false` but validator returned: `true`. **This excludes this validator from performance tests**
46+
`Does not see inexisting elements on new objects: 'foo' via required, Invalid if not present`|Expected result: `false` but validator returned: `true`. **This excludes this validator from performance tests**
47+
`Does not see inexisting elements on new objects: 'foo' via required, Valid if not present`|Expected result: `true` but validator returned: `false`. **This excludes this validator from performance tests**
48+
`Does not see inexisting elements on new objects: 'foo' via required, Valid if not present`|Expected result: `true` but validator returned: `false`. **This excludes this validator from performance tests**
2849
`Does not see inexisting elements on new objects: '__proto__' via required, Invalid if not present`|Expected result: `false` but validator returned: `true`. **This excludes this validator from performance tests**
2950
`Does not see inexisting elements on new objects: '__proto__' via required, Valid if not present`|Expected result: `true` but validator returned: `false`. **This excludes this validator from performance tests**
51+
`relative pointer ref to object, match`|Expected result: `true` but validator returned: `false`. **This excludes this validator from performance tests**
52+
`required validation, non-present required property is invalid`|Expected result: `false` but validator returned: `true`. **This excludes this validator from performance tests**
3053

3154
**All other tests passed**.
3255

0 commit comments

Comments
 (0)