jsonschema

jsonschema — a complete JSON Schema 2020-12 implementation for D.

Validator: compile a schema once (compileSchema) into a reusable Validator, then validate any number of instances of std.json.JSONValue, vibe.data.json.Json (via the jsonschema:vibe subpackage), or any other JSON type adapted through the trait in jsonschema.adapter.

Generator: derive a 2020-12 schema from a D type at compile time (jsonSchemaOf!T) with constraint UDAs from jsonschema.attributes.

Modules

adapter
module jsonschema.adapter

The JSON-type adapter trait.

attributes
module jsonschema.attributes

Schema-constraint UDAs for the compile-time generator (jsonSchemaOf). Attach these to struct fields to emit the matching JSON Schema keywords onto the field's property schema.

compiler
module jsonschema.compiler

Schema compilation: JSON document → IR.

formats
module jsonschema.formats

Implementations of the JSON Schema 2020-12 defined formats, used when format assertion is enabled (FormatMode.assertion or a dialect declaring the format-assertion vocabulary). Formats apply only to strings; unknown format names always pass (they are annotations for some other consumer).

generate
module jsonschema.generate

Compile-time D-type → JSON Schema generator.

ir
module jsonschema.ir

The compiled internal representation of a JSON Schema document.

node
module jsonschema.node

Internal JSON document representation.

pointer
module jsonschema.pointer

RFC 6901 JSON Pointer: parsing, escaping, and evaluation against the internal document representation. Used for $ref fragment resolution.

store
module jsonschema.store

Pre-registered schema document store.

uri
module jsonschema.uri

RFC 3986 URI handling: parsing into components, reference resolution against a base URI (§5.2), and fragment splitting. Used for $id, $ref, $anchor, and $dynamicRef base-URI resolution.

validator
module jsonschema.validator

Instance validation: evaluating a compiled schema against a JSON value of any adapted type. Implements full 2020-12 evaluation semantics including annotation collection for unevaluatedProperties / unevaluatedItems and dynamic-scope resolution for $dynamicRef.

vibejson
module jsonschema.vibejson

vibe.data.json adapter for jsonschema (subpackage jsonschema:vibe).

Public Imports

jsonschema.attributes
public import jsonschema.attributes;
Undocumented in source.

Members

Imports

FormatMode (from jsonschema.ir)
public import jsonschema.ir : dialect202012, FormatMode, OutputFormat, SchemaCompileException, SchemaException, SchemaResolver, UnsupportedDialectException, ValidationError, ValidationException, ValidationResult, ValidatorSettings;
Undocumented in source.
GeneratorSettings (from jsonschema.generate)
public import jsonschema.generate : applyUdaFacets, GeneratorSettings, jsonSchemaOf;
Undocumented in source.
JsonKind (from jsonschema.adapter)
public import jsonschema.adapter : isJsonAdapter, JsonKind, JsonNumber, JsonNodeAdapter, StdJsonAdapter;
Undocumented in source.
JsonNode (from jsonschema.node)
public import jsonschema.node : fromStdJson, JsonNode, jsonEquals, JsonParseException, parseJson, toStdJson;
Undocumented in source.
JsonNodeAdapter (from jsonschema.adapter)
public import jsonschema.adapter : isJsonAdapter, JsonKind, JsonNumber, JsonNodeAdapter, StdJsonAdapter;
Undocumented in source.
JsonNumber (from jsonschema.adapter)
public import jsonschema.adapter : isJsonAdapter, JsonKind, JsonNumber, JsonNodeAdapter, StdJsonAdapter;
Undocumented in source.
JsonParseException (from jsonschema.node)
public import jsonschema.node : fromStdJson, JsonNode, jsonEquals, JsonParseException, parseJson, toStdJson;
Undocumented in source.
OutputFormat (from jsonschema.ir)
public import jsonschema.ir : dialect202012, FormatMode, OutputFormat, SchemaCompileException, SchemaException, SchemaResolver, UnsupportedDialectException, ValidationError, ValidationException, ValidationResult, ValidatorSettings;
Undocumented in source.
SchemaCompileException (from jsonschema.ir)
public import jsonschema.ir : dialect202012, FormatMode, OutputFormat, SchemaCompileException, SchemaException, SchemaResolver, UnsupportedDialectException, ValidationError, ValidationException, ValidationResult, ValidatorSettings;
Undocumented in source.
SchemaException (from jsonschema.ir)
public import jsonschema.ir : dialect202012, FormatMode, OutputFormat, SchemaCompileException, SchemaException, SchemaResolver, UnsupportedDialectException, ValidationError, ValidationException, ValidationResult, ValidatorSettings;
Undocumented in source.
SchemaResolver (from jsonschema.ir)
public import jsonschema.ir : dialect202012, FormatMode, OutputFormat, SchemaCompileException, SchemaException, SchemaResolver, UnsupportedDialectException, ValidationError, ValidationException, ValidationResult, ValidatorSettings;
Undocumented in source.
SchemaStore (from jsonschema.store)
public import jsonschema.store : SchemaStore;
Undocumented in source.
StdJsonAdapter (from jsonschema.adapter)
public import jsonschema.adapter : isJsonAdapter, JsonKind, JsonNumber, JsonNodeAdapter, StdJsonAdapter;
Undocumented in source.
UnsupportedDialectException (from jsonschema.ir)
public import jsonschema.ir : dialect202012, FormatMode, OutputFormat, SchemaCompileException, SchemaException, SchemaResolver, UnsupportedDialectException, ValidationError, ValidationException, ValidationResult, ValidatorSettings;
Undocumented in source.
ValidationError (from jsonschema.ir)
public import jsonschema.ir : dialect202012, FormatMode, OutputFormat, SchemaCompileException, SchemaException, SchemaResolver, UnsupportedDialectException, ValidationError, ValidationException, ValidationResult, ValidatorSettings;
Undocumented in source.
ValidationException (from jsonschema.ir)
public import jsonschema.ir : dialect202012, FormatMode, OutputFormat, SchemaCompileException, SchemaException, SchemaResolver, UnsupportedDialectException, ValidationError, ValidationException, ValidationResult, ValidatorSettings;
Undocumented in source.
ValidationResult (from jsonschema.ir)
public import jsonschema.ir : dialect202012, FormatMode, OutputFormat, SchemaCompileException, SchemaException, SchemaResolver, UnsupportedDialectException, ValidationError, ValidationException, ValidationResult, ValidatorSettings;
Undocumented in source.
Validator (from jsonschema.validator)
public import jsonschema.validator : Validator;
Undocumented in source.
ValidatorSettings (from jsonschema.ir)
public import jsonschema.ir : dialect202012, FormatMode, OutputFormat, SchemaCompileException, SchemaException, SchemaResolver, UnsupportedDialectException, ValidationError, ValidationException, ValidationResult, ValidatorSettings;
Undocumented in source.
applyUdaFacets (from jsonschema.generate)
public import jsonschema.generate : applyUdaFacets, GeneratorSettings, jsonSchemaOf;
Undocumented in source.
compileSchema (from jsonschema.compiler)
public import jsonschema.compiler : compileSchema;
Undocumented in source.
dialect202012 (from jsonschema.ir)
public import jsonschema.ir : dialect202012, FormatMode, OutputFormat, SchemaCompileException, SchemaException, SchemaResolver, UnsupportedDialectException, ValidationError, ValidationException, ValidationResult, ValidatorSettings;
Undocumented in source.
fromStdJson (from jsonschema.node)
public import jsonschema.node : fromStdJson, JsonNode, jsonEquals, JsonParseException, parseJson, toStdJson;
Undocumented in source.
isJsonAdapter (from jsonschema.adapter)
public import jsonschema.adapter : isJsonAdapter, JsonKind, JsonNumber, JsonNodeAdapter, StdJsonAdapter;
Undocumented in source.
jsonEquals (from jsonschema.node)
public import jsonschema.node : fromStdJson, JsonNode, jsonEquals, JsonParseException, parseJson, toStdJson;
Undocumented in source.
jsonSchemaOf (from jsonschema.generate)
public import jsonschema.generate : applyUdaFacets, GeneratorSettings, jsonSchemaOf;
Undocumented in source.
parseJson (from jsonschema.node)
public import jsonschema.node : fromStdJson, JsonNode, jsonEquals, JsonParseException, parseJson, toStdJson;
Undocumented in source.
toStdJson (from jsonschema.node)
public import jsonschema.node : fromStdJson, JsonNode, jsonEquals, JsonParseException, parseJson, toStdJson;
Undocumented in source.