Skip to content

Commit

Permalink
Switch to json_schemer from json-schema
Browse files Browse the repository at this point in the history
json-schema is unmaintained and only supports up to draft-06 of JSON
Schema. That is three versions older than the latest specification.
json_schemer is supported and supports all versions of JSON Schema,
including 2020-12, which is the latest one.

This change swaps one dependency for another in order to support newer
versions.
  • Loading branch information
michaelherold authored and flash-gordon committed Feb 5, 2025
1 parent 26668cb commit 56a2883
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ group :test do
gem "dry-monads"
gem "dry-struct"
gem "i18n", require: false
gem "json-schema"
gem "json_schemer"
gem "ostruct"
gem "super_diff"
gem "transproc"
Expand Down
5 changes: 2 additions & 3 deletions spec/extensions/json_schema/schema_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

require "json-schema"
require "json_schemer"

RSpec.describe Dry::Schema::JSON, "#json_schema" do
before do
Expand All @@ -10,10 +10,9 @@
shared_examples "metaschema validation" do
describe "validating against the metaschema" do
it "produces a valid json schema document for draft6" do
metaschema = JSON::Validator.validator_for_name("draft6").metaschema
input = schema.respond_to?(:json_schema) ? schema.json_schema : schema

JSON::Validator.validate!(metaschema, input)
expect(JSONSchemer.validate_schema(input).to_a).to be_empty
end
end
end
Expand Down

0 comments on commit 56a2883

Please sign in to comment.