Skip to content
CAI
Software that uses CAICheck a score

voxpupuli/json-schema

65.4

Adequate · 19 September 2026

2.7k

lines of production code

Ruby

primary language

1

measurement over time

CAI band scale
CAI lens gauges

What this system is

This system is a Ruby library for validating JSON data against JSON Schema specifications. It supports multiple schema drafts (1 through 6) and provides modular validation for structural constraints, data types, formats, and custom rules. The library includes features for schema caching, fragment resolution, and structured error reporting to facilitate robust data validation in Ruby applications.

How it got here

2010 — JSON Schema v6.2.0 refactoring

6 changes.

The project upgraded to version 6.2.0, raising the Ruby requirement to 2.7 and replacing custom URI handling with the Addressable gem. A major architectural refactor introduced support for multiple JSON Schema drafts, schema caching, and namespaced validators to improve performance and flexibility. Comprehensive test coverage was added to validate these new features and ensure compatibility across drafts 1 through 6.

2011–2014 — JSON Schema modularization and draft support

7 changes.

The project refactored the JSON Schema validation library into a modular architecture, extracting specific attribute and format validators into dedicated classes. It expanded support to include JSON Schema drafts 1 through 6, with drafts 4 and 6 set as defaults, while introducing structured error reporting and improved URI handling. Comprehensive test suites were added to verify correctness across various schema constraints and drafts.

Features

Added JSON Schema draft-01 through draft-06 validators

The library now supports validation against JSON Schema drafts 1, 2, 3, 4, and 6, including their respective hyper-schema variants. This introduces support for draft-specific features such as \multipleOf\ (replacing \divisibleBy\ in draft 4), \const\, \propertyNames\, and structural keywords like \allOf\, \anyOf\, \oneOf\, and \not\. Draft 4 and Draft 6 are registered as default validators, meaning validation will use these stricter standards by default unless a specific draft is requested.

lib/json-schema/validators · high confidence

Repository initialization with RuboCop configuration and submodule setup

The repository is initialized with a new RuboCop configuration (\.rubocop.yml\) inheriting from \voxpupuli-rubocop\ and targeting Ruby 2.7, along with an auto-generated \.rubocop\_todo.yml\ to manage existing style violations. A \.gitmodules\ file is added to include the \JSON-Schema-Test-Suite\ as a submodule at \test/test-suite\. The \Rakefile\ is rewritten to replace the legacy \rake/gempackagetask\ with tasks for updating the common test suite and meta-schemas, and the \VERSION.yml\ file is removed in favor of versioning via the gemspec.

(repo-wide) · 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 new validator architecture. Key changes include the introduction of schema caching for improved performance in long-running applications, support for fragment-based schema resolution, and the addition of options like \insert\_defaults\ and \strict\ validation. The core validation logic has been restructured into individual attribute validators, and the library now uses \JSON::Util::URI\ for consistent URI handling, replacing the previous \URI2\ implementation.

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

Update json-schema gem to version 6.2.0 with Ruby 2.7+ requirement

The json-schema gem has been updated to version 6.2.0, raising the minimum required Ruby version to 2.7 (dropping support for older versions). The primary runtime dependency on 'addressable' is now constrained to version 2.8, and a new dependency on 'bigdecimal' (versions 3.1 to \< 5) has been added to address deprecation warnings in newer Ruby versions. Development dependencies have also been updated, including 'minitest' (\>= 5.0, \< 7), 'multi\_json' (\~\> 1.15), 'rake' (\~\> 13.0), 'voxpupuli-rubocop' (\~\> 5.1.0 for Ruby 3.2+), and 'webmock' (\~\> 3.23).

(dependencies) · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Baseline

  • First survey — no prior run to compare against. CAI 65.

Lenses

  • Code Health 95
  • Architecture 100
  • Maturity 55
  • Readiness 67
  • Security 69

Changes since last survey

  • 300 commits — 235 feature/other, 65 fixes

By area

  • (root) — 97 commits
  • (repo) — 95 commits
  • lib/json-schema — 55 commits
  • .github/workflows — 30 commits
  • test/support — 6 commits
  • test/uri_util_test.rb — 3 commits
  • .github/dependabot.yml — 2 commits
  • test/custom_format_test.rb — 2 commits
  • test/draft6_test.rb — 2 commits
  • test/no_additional_properties_all_of_test.rb — 2 commits
  • .github/release.yml — 1 commit
  • test/draft3_test.rb — 1 commit
  • test/draft4_test.rb — 1 commit
  • test/initialize_data_test.rb — 1 commit
  • test/schema_validation_test.rb — 1 commit
  • test/test-suite — 1 commit

Notable commits

  • fix: Add bigdecimal dependency to fix deprecation warning for Ruby 3.4
  • fix: Merge pull request #515 from bolshakov/fix-normalize_ref
  • fix: Merge pull request #533 from jamiecobbett/fix-bigdecimal-deprecation-warning
  • fix: Merge pull request #542 from beechtom/bug/require-delegate
  • fix: Revert "Reproduce caching issue with the JSON::Util::URI.normalize_ref method"
  • fix: fix fragment when used with extended schema
  • fix: fix tests, add tests
  • fix: rubocop: Fix Bundler/OrderedGems
  • fix: rubocop: Fix Gemspec/OrderedDependencies
  • fix: rubocop: Fix Layout/ArgumentAlignment
  • fix: rubocop: Fix Layout/CommentIndentation
  • fix: rubocop: Fix Layout/DotPosition
  • fix: rubocop: Fix Layout/EmptyLineAfterGuardClause
  • fix: rubocop: Fix Layout/EmptyLineAfterMagicComment
  • fix: rubocop: Fix Layout/EmptyLineBetweenDefs
  • fix: rubocop: Fix Layout/EmptyLines
  • fix: rubocop: Fix Layout/EmptyLinesAroundAccessModifier
  • fix: rubocop: Fix Layout/EmptyLinesAroundClassBody
  • fix: rubocop: Fix Layout/EmptyLinesAroundMethodBody
  • fix: rubocop: Fix Layout/EmptyLinesAroundModuleBody
  • …and 280 more

Written by watchdog.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 19 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 634af4ca26dba550ccbb2b2d6bd234ee890e1e37 — the exact code this score is about.
  • Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-13a154b7f5d1.