Validate JSON values against JSON Schema (draft 2020-12)
jenniferdeckjsonjson-schemavalidation
[decks]
"@deckyard/jsonschema" = "^0.1.0"| Version | Status | Kind | Pin | Requires | Engines | Capabilities |
|---|---|---|---|---|---|---|
| 0.1.0 | live | git | abbd24542c85 | - | jennifer >=0.25.0 | - |
LGPL-3.0-only
0.1.0Times a client asked this registry where to find this deck. Not downloads: the registry only stores metadata, and the code is fetched from its repository directly, so we never see an install and cannot count one. Repeated builds inflate these numbers; installs from an existing lockfile do not appear at all. Counted in UTC.
Validates a json.Value against a JSON Schema draft 2020-12 schema in Jennifer, and reports every failure with a JSON Pointer to the value and to the keyword. Passes every required test in the official JSON-Schema-Test-Suite.
jvc add @deckyard/jsonschemaThis vendors the deck to vendor/deckyard/jsonschema/. Without jvc, unpack the src/ subtree of a release archive (deckyard-jsonschema-<version>.tar.gz) there.
import "@deckyard/jsonschema/" as jsonschema;
def s as jsonschema.Schema init jsonschema.compile(json.decode(fs.readString("order.schema.json")));
def r as jsonschema.Result init jsonschema.validate($s, json.decode(fs.readString("order.json")));
if (not $r.valid) {
io.printf("%s", jsonschema.describe($r));
}examples/validate.j validates a good and a bad order.
$ref, $dynamicRef, $anchor, unevaluatedProperties, unevaluatedItems, vocabularies. Draft 7's dependencies is honoured too.Registry, and to the embedded 2020-12 meta-schemas.format is checked on request for the common formats; see the formats guide.\s, ., \cX and \uXXXX translated; lookaround and backreferences are not available.Jennifer 0.25.0 or newer. Pure computation: no network, no capabilities. Not tested on jennifer-tiny.
tools/check-all.sh # the full gate, as CI runs it
jennifer test src/jsonschema_test.j # unit tests and the test suite
tools/gen-meta.sh # refresh the embedded meta-schemastestdata/suite is the vendored JSON-Schema-Test-Suite (MIT); testdata/exclusions.txt lists the cases the deck knowingly fails, and why.
LGPL-3.0-only, see LICENSE. Copyright (C) 2026 mplx <[email protected]>.
The embedded meta-schemas in src/topics/meta.j are the JSON Schema Specification Authors' work under BSD-3-Clause or AFL-3.0; the notice is in that file.