-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use json schemer #46
Merged
Merged
Use json schemer #46
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8a31664
to
e38f5fd
Compare
json_schemer supports more current drafts 4, 6, and 7 compared to json-schema which is limited to draft 4 or earlier.
Major version jump because this version drops support of schema drafts 1, 2 and 3 in favor of supporting versions 6 and 7.
e38f5fd
to
d31b7f7
Compare
Looks good to me! Thank you very much @amygurski! 👌🙂 |
nTraum
added a commit
to CitizenLabDotCo/citizenlab
that referenced
this pull request
Mar 3, 2022
The gem provides no changelog unfortunately, but looking at the commits https://github.com/mirego/activerecord_json_validator/commits/master the most prominent thing here is Rails 7 upgrades, which is what I'm looking for. :) It also replaces json-schema with json-schemer. The former is not maintained anymore and only supports up to draft 4. The new gem supports draft 4, 6 and 7. See mirego/activerecord_json_validator#46 for details.
4 tasks
ConnerMan
added a commit
to ConnerMan/activerecord_json_validator
that referenced
this pull request
Mar 16, 2022
After migrating to json schemer in mirego#46, passing a string path as the schema will raise JSON::ParserError. JSON Schemer supports Pathname, so simply removing to_s from the Rails.root.join call works.
ConnerMan
added a commit
to ConnerMan/activerecord_json_validator
that referenced
this pull request
Mar 16, 2022
After migrating to json schemer in mirego#46, passing a string path as the schema will raise JSON::ParserError. JSON Schemer supports Pathname, so simply removing to_s from the Rails.root.join call works.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Replace json-schema gem with json_schemer. json-schema is no longer maintained (voxpupuli/json-schema/issues/423) and only supports up to draft 4. Replace with json_schemer which supports draft 4, 6 and 7.
Major version bump because this change fully drops support of drafts 1, 2 and 3.
Closes issue #45 .
Caveats
Testing
Schema not found: http://json-schema.org/draft-06/schema#
because json-schema didn't recognize the schema. With these changes, it's able to validate both the draft 4 schema as previous and also the draft 6.