Using the JSON Schema Test Suite, we test each library against the official JSON Schema specification. The test suite contains a large number of test cases that cover various aspects of JSON Schema validation, including different data types, formats, and validation rules.
Libraries that can be converted from and to JSON Schema. The JSON schema is decoded to the library's internal representation, then re-encoded to JSON Schema. The result is fed to typebox for final validation (as it scores highest on validation benchmarks, so introduces the smallest amount of margin of error).
Copy to clipboardconst zodSchema = z.fromJSONSchema(schema); const roundtripSchema = z.toJSONSchema(zodSchema, { target: "draft-07" }); const receivedValid = Schema.Check(roundtripSchema, data); assert(receivedValid === expectedValid);
Failed tests indicate either lossy translation or a serialization error.
| Library | Version | Source | /wk | Compliance | ||||
|---|---|---|---|---|---|---|---|---|
zod | Code snippet | 4.4.3 | Native | n/a | 60.4% (1.04K / 1.72K) | Open details | ||
sury | Code snippet | 11.0.0-rc.1 | Native | n/a | 50.7% (872 / 1.72K) | Open details | ||
arktype | Code snippet | 2.2.3 | Package | Package required@ark/json-schema | n/a | 13.8% (238 / 1.72K) | Open details | |