voxpupuli/json-schema
57.8
Adequate · 6 November 2026
2.7k
lines of production code
Ruby
primary language
4
measurements over time
What this system is
This system is a Ruby library that validates JSON documents against JSON Schema specifications. It supports multiple schema drafts (1 through 6) and provides modular validation for attributes, formats, and structural constraints. The library handles schema loading from files or URIs, manages validation caching, and returns structured error details for debugging.
How it got here
2010 — JSON Schema v6.2.1 release and refactoring
6 changes.
This period focused on releasing version 6.2.1 of the json-schema gem, which involved a major architectural refactoring to support multiple JSON Schema drafts and introduce schema caching. The work included modernizing the codebase by adopting the Addressable gem for URI handling, migrating to multi\_json, and establishing formal gem packaging with Ruby 2.7+ requirements. Comprehensive test coverage was added to validate the new modular validation engine and draft-specific features.
2011–2014 — JSON Schema modularization and draft support
7 changes.
The project refactored its JSON Schema validation engine into a modular architecture, extracting specific attribute and format validators into dedicated classes. This restructuring enabled comprehensive support for JSON Schema drafts 1 through 6, with drafts 4 and 6 set as defaults, while introducing structured error reporting and improved URI handling.
Features
Add support for JSON Schema drafts 1, 2, 3, 4, and 6
The library now includes validators for JSON Schema drafts 1, 2, 3, 4, and 6, along with their corresponding hyper-schema variants. Users can now validate JSON documents against these specific schema versions. Draft 4 and Draft 6 are registered as default validators, with Draft 6 being the most recent supported version. The validators support various attributes defined in each draft, such as 'const' and 'propertyNames' in Draft 6, 'multipleOf' in Draft 4 and 6, and 'divisibleBy' in Draft 2 and 3. Format validation is also updated for each draft, with Draft 4 and 6 using 'ipv4' instead of 'ip-address'.
lib/json-schema/validators · high confidence
Behavioural changes
Improved enum validation and URI handling in JSON Schema
The library now correctly validates enum values containing numeric types (Float and Fixnum) by using a specialized ArraySet that normalizes numeric comparisons, preventing validation failures for equivalent numbers. Additionally, URI resolution and reference handling have been refactored into a dedicated utility module with improved caching and support for special characters in URIs, ensuring more robust schema resolution.
lib/json-schema/util · high confidence
JSON Schema validation refactored with draft support and caching
The library has been significantly refactored to support multiple JSON Schema drafts (1, 2, 3, and 4) via a versioned validator system. Key changes include the introduction of schema caching for improved performance in long-running applications, the addition of options to insert default values into data, strict validation modes, and the ability to validate against specific schema fragments. The validation engine now uses a modular attribute-based approach, allowing for better extensibility and more accurate error reporting that references JSON Schema types rather than Ruby types.
lib/json-schema · high confidence
Refactored JSON Schema validation into modular attribute classes
The validation logic for JSON Schema attributes has been extracted from the main validator into individual, dedicated classes within the \lib/json-schema/attributes\ directory. This change introduces specific validators for standard keywords such as \additionalItems\, \additionalProperties\, \allOf\, \anyOf\, \const\, \dependencies\, \disallow\, \divisibleBy\, \enum\, \extends\, \format\, \items\, \limit\ (including \maxItems\, \maxLength\, \maxProperties\, \maximum\, \minItems\, \minLength\, \minProperties\, \minimum\), \multipleOf\, \not\, \oneOf\, \pattern\, \patternProperties\, \properties\, \propertyNames\, \$ref\, \required\, \type\, and \uniqueItems\. By organizing these rules into separate files, the library now supports a more maintainable structure for handling validation errors and schema compliance across different JSON Schema drafts.
lib/json-schema/attributes · high confidence
Refactored format validation into dedicated attribute classes
The format validation logic for URI, date, date-time, time, IP, and custom formats has been extracted from the general validator into specific, standalone classes (e.g., UriFormat, DateFormat, IPFormat). This change improves error handling by providing more precise validation errors for each format type and allows for custom format validation via a dedicated CustomFormat class that accepts a validation procedure.
lib/json-schema/attributes/formats · high confidence
Refactored library structure and JSON backend handling
The library's internal structure has been reorganized to use namespaced locations for attributes and validators, resolving potential naming conflicts. The JSON parsing backend is now handled via the multi\_json gem when available, replacing the previous direct dependency on the JSON gem with a more flexible, swappable approach. Additionally, the schema loading component has been renamed from Loader to Reader, and URI handling utilities have been consolidated.
lib · high confidence
Removed custom File URI handler in favor of Addressable gem
The custom URI::File class, which previously provided built-in support for filesystem URIs and open-uri integration, has been removed from the codebase. This change aligns with the adoption of the Addressable gem for URI handling, shifting responsibility for file URI resolution away from the library's internal implementation.
lib/json-schema/uri · high confidence
Schema reading and validation logic restructured into dedicated Reader and Validator classes
The schema loading and validation mechanisms have been refactored into two new classes: \JSON::Schema::Reader\ and \JSON::Schema::Validator\. The \Reader\ class now handles fetching schema content from both local files and URIs, introducing configurable callbacks (\accept\_uri\ and \accept\_file\) to control which external references are permitted, thereby enhancing security and flexibility. The \Validator\ class manages attribute validation and format handling, with a new \metaschema\ method that resolves resource paths relative to the source file. This change also deprecates the \\#extend\_schema\_definition\ method in favor of subclassing.
lib/json-schema/schema · high confidence
Structured JSON Schema validation errors with sub-error tracking
The library now provides a structured ValidationError class that tracks the schema, fragments, and failed attributes, and supports nested sub-errors for detailed reporting. Users can now access a hierarchical error representation via the to\_hash method, which includes specific details for each subschema, and a formatted string representation via to\_string, improving debugging and error handling for schema validation failures.
lib/json-schema/errors · high confidence
Test coverage
Added comprehensive test coverage for JSON Schema validation features; Added comprehensive test suite for JSON Schema validation keywords.
Dependencies
Initial gem packaging with Ruby 2.7+ requirement and addressable/bigdecimal dependencies
The project introduces its first Gemfile and gemspec, establishing the json-schema gem (version 6.2.1) with a mandatory Ruby version of 2.7 or higher. The gem declares runtime dependencies on the addressable (\~\> 2.8) and bigdecimal (\>= 3.1, \< 5) libraries. Development tooling is configured via the Gemfile to include minitest, webmock, and voxpupuli-rubocop, while release-time tools like github\_changelog\_generator are marked as optional.
(dependencies) · high confidence
Housekeeping
Project maintenance and infrastructure overhaul
This change introduces significant project maintenance updates: it adds a submodule for the official JSON Schema Test Suite to improve test coverage, migrates the README from Textile to Markdown, and enforces code quality by integrating voxpupuli-rubocop with a generated configuration file. It also removes the legacy VERSION.yml file in favor of gemspec-based versioning, updates the Rakefile to include tasks for updating meta-schemas and the test suite, and refreshes the .gitignore to exclude modern build artifacts.
(repo-wide) · high confidence
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 57 → 58 (+0.7)
- Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.
Lenses
- Code Health 74 → 74 (+0.0)
- Architecture 100 → 100 (+0.0)
- Maturity 49 → 54 (+5.3)
- Readiness 50 → 50 (+0.0)
- Security 77 → 69 (-7.4)
Resolved (4)
- Duplicate error recording logic across Attribute and ErrorRecorder. Attribute.validation_error seems to be a low-level helper that might duplicate the work of ErrorRecorder.validation_error. The existence of both suggests a split in responsibility that is not clearly defined.
- Inconsistent method naming for URI operations. Some methods use the object as the first argument (parse(uri)), while others appear to be instance methods or have ambiguous signatures in the list (e.g., URI.unescaped_path() listed without args in the instance context). The distinction between normalized_uri, normalize_ref, and absolutize_ref is unclear without documentation, suggesting potential overlap in intent (resolving relative URIs).
- Inconsistent serialization/naming conventions for error output. to_string is non-standard (usually to_s or to_str), to_hash is standard, but message_with_schema is a specific accessor rather than a serialization method. This mixes serialization intent with data access.
- Severe naming inconsistency and redundancy in validation entry points. There are 10 different methods for essentially the same operation (validating data against a schema), differentiated by obscure suffixes (!, 2, _json, uri) and prefixes (fully). It is unclear what the semantic difference is between validate, validate_json, validate_uri, validate!, validate2, fully_validate, etc. This creates a high cognitive load and risk of calling the wrong variant.
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
voxpupuli/json-schema was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 6 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit d4acb3a3955b82bdc911a65b24b7e5e69e228eda — the exact code this score is about.
- Scored under rubric-2026.11.2 — the same rubric and the same method as every other entry in this index.
- Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.2+preprod-5c4e66d9318b.