-
Notifications
You must be signed in to change notification settings - Fork 325
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
Support Draft 2020-12 and refactor schema retrieval #931
Support Draft 2020-12 and refactor schema retrieval #931
Conversation
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #931 +/- ##
============================================
+ Coverage 78.66% 79.04% +0.37%
- Complexity 1432 1504 +72
============================================
Files 136 143 +7
Lines 4692 4915 +223
Branches 896 932 +36
============================================
+ Hits 3691 3885 +194
- Misses 644 670 +26
- Partials 357 360 +3 ☔ View full report in Codecov by Sentry. |
Closes #920, closes #884, closes #877, closes #855, closes #854, closes #840, closes #742
This PR includes breaking changes.
This adds support for the following required for Draft 2020-12 support
$dynamicRef
$dynamicAnchor
$vocabulary
This refactors the schema retrieval codes as the ID is based on IRI and not URI.
Note that Java does not support IRIs. See https://cr.openjdk.org/%7Edfuchs/writeups/updating-uri/ for details.
The following are removed and replaced by
SchemaLoader
andSchemaMapper
.URIFactory
- No replacement. The resolve logic is inAbsoluteIRI
.URISchemeFactory
- No replacement asURIFactory
isn't required anymore.URISchemeFetcher
- No replacement. TheSchemaLoaders
are iterated and called.URITranslator
- Replaced bySchemaMapper
.URLFactory
- No replacement asURIFactory
isn't required anymore.URLFetcher
- Replaced byUriSchemaLoader
.URNURIFactory
- No replacement asURIFactory
isn't required anymore.The
SchemaLoader
andSchemaMapper
are configured in theJsonSchemaFactory.Builder
.As per the specification. The
format
keyword since Draft 2019-09 no longer generates assertions by default.This can be changed by using a custom meta schema with the relevant
$vocabulary
or by setting the execution configuration to enable format assertions.This PR also updates the documentation and includes a section on migrating to newer versions. This also includes miscellaneous fixes.
Functional Comparison
With Changes
fail: r:9 (0.2%) o:1 (0.0%)
fail: r:0 (0.0%) o:0 (0.0%)
fail: r:0 (0.0%) o:0 (0.0%)
fail: r:0 (0.0%) o:0 (0.0%)
fail: r:3 (0.2%) o:0 (0.0%)
fail: r:6 (0.5%) o:1 (0.2%)
Performance Comparison
With Changes