JsonSchema Delphi is a JSON Schema validation library written in Delphi. It is built around a compiled-schema execution model, a draft-aware parser layer, a central schema registry, and localized validation output.
- Validates JSON documents against JSON Schema documents.
- Supports Draft 6, Draft 7, Draft 2019-09, and Draft 2020-12 at runtime.
- Compiles schemas before validation.
- Keeps keyword behavior isolated in keyword units.
- Produces localized validation messages in enUS and ptBR.
- Resolves references and schema resources through a registry.
- Includes auxiliary developer tools under
tools/: SchemaMockGen (data mock generator), Schema2Delphi (Delphi DTO class generator), SchemaValidator (JSON Schema validator), Delphi2Schema (JSON Schema generator from Delphi classes/records using RTTI), Schema2DDL (Relational DDL generator), Schema2REST (Horse/DMVC route and controller generator), JSON2Schema (JSON Schema generator from JSON instance documents), Schema2Doc (Markdown/HTML documentation generator), SchemaLinter (JSON Schema static quality and security analyzer), SchemaBundler (JSON Schema packaging utility), SchemaMigrator (JSON Schema draft version migration utility), SchemaOptimizer (JSON Schema simplification and optimization utility), and VisualTestSuiteRunner (JSON Schema Test Suite compliance visual runner). Each tool provides both a Command-Line Interface (CLI) and a Desktop VCL GUI application.
- Runtime confirmed: Draft 6, Draft 7, Draft 2019-09, and Draft 2020-12.
- Draft 6 and Draft 7 have strong compliance coverage in the repository history.
- Historical test fixtures for Draft 3, Draft 4, and draft-next are present, but they are not confirmed runtime support.
The main public entry point is TJsonSchemaValidator.
- Parse the schema and instance as
TJSONValuevalues. - Create
TJsonSchemaValidator. - Call
Validatewith the schema, instance, and optional draft. - Inspect
IsValid,Errors,Message, andResolution.
- The validator overload without an explicit draft uses Draft 6.
- The draft-specific overload routes to the selected draft parser.
- Validation occurs against compiled keyword validators, not raw schema JSON.
src: library source.test: DUnit projects and schema fixtures.tools: auxiliary tools.docs: architecture, product, development, API, decisions, and operations documentation.
- Prefer small, focused changes.
- Update or add tests when validation, URI handling, translation, or draft compatibility changes.
- Keep docs in sync with observable runtime behavior.
- Do not describe fixture-only support as runtime support.
MIT. See LICENSE.