-
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 custom vocabularies and unknown keyword and meta-schema handling #980
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 #980 +/- ##
============================================
- Coverage 78.64% 78.51% -0.13%
- Complexity 1852 1866 +14
============================================
Files 165 169 +4
Lines 6002 6088 +86
Branches 1148 1153 +5
============================================
+ Hits 4720 4780 +60
- Misses 845 871 +26
Partials 437 437 ☔ View full report in Codecov by Sentry. |
Hi @justin-tay Will this also fix #475 (comment) ? |
That should already have been fixed as it has nothing to do with implementing custom vocabularies. That issue has to do with the lack of support for |
It did, thanks!! |
Bumps [com.networknt:json-schema-validator](https://github.com/networknt/json-schema-validator) from 1.3.3 to 1.4.0. - [Release notes](https://github.com/networknt/json-schema-validator/releases) - [Changelog](https://github.com/networknt/json-schema-validator/blob/master/CHANGELOG.md) - [Commits](networknt/json-schema-validator@1.3.3...1.4.0) --- updated-dependencies: - dependency-name: com.networknt:json-schema-validator dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> - Modified call to JsonSchemaFactory.Builder() - see networknt/json-schema-validator#980 (comment)
Bumps [com.networknt:json-schema-validator](https://github.com/networknt/json-schema-validator) from 1.3.3 to 1.4.0. - [Release notes](https://github.com/networknt/json-schema-validator/releases) - [Changelog](https://github.com/networknt/json-schema-validator/blob/master/CHANGELOG.md) - [Commits](networknt/json-schema-validator@1.3.3...1.4.0) --- updated-dependencies: - dependency-name: com.networknt:json-schema-validator dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> - Modified call to JsonSchemaFactory.Builder() - see networknt/json-schema-validator#980 (comment)
Bumps [com.networknt:json-schema-validator](https://github.com/networknt/json-schema-validator) from 1.3.3 to 1.4.0. - [Release notes](https://github.com/networknt/json-schema-validator/releases) - [Changelog](https://github.com/networknt/json-schema-validator/blob/master/CHANGELOG.md) - [Commits](networknt/json-schema-validator@1.3.3...1.4.0) --- updated-dependencies: - dependency-name: com.networknt:json-schema-validator dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> - Modified call to JsonSchemaFactory.Builder() - see networknt/json-schema-validator#980 (comment)
Bumps [com.networknt:json-schema-validator](https://github.com/networknt/json-schema-validator) from 1.3.3 to 1.4.0. - [Release notes](https://github.com/networknt/json-schema-validator/releases) - [Changelog](https://github.com/networknt/json-schema-validator/blob/master/CHANGELOG.md) - [Commits](networknt/json-schema-validator@1.3.3...1.4.0) --- updated-dependencies: - dependency-name: com.networknt:json-schema-validator dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> - Modified call to JsonSchemaFactory.Builder() - see networknt/json-schema-validator#980 (comment)
Fixes the rename from networknt/json-schema-validator#980.
Closes #977, closes #829
This adds support for customizing
This contains breaking changes in how custom meta-schemas are created and the documentation updates assume it will be released as 1.4.0.
JsonSchemaFactory
JsonSchemaFactory
builderdefaultMetaSchemaURI
->defaultMetaSchemaIri
enableUriSchemaCache
->enableSchemaCache
JsonMetaSchemaFactory
which can be used to restrict the loading of meta-schemas that aren't explicitly defined in theJsonSchemaFactory
. TheDisallowUnknownJsonMetaSchemaFactory
can be used to only allow explicitly configured meta-schemas.JsonMetaSchema
Version201909
andVersion202012
had most of the keywords moved to their respective vocabularies.getUri
->getIri
vocabularyFactory
to allow for custom vocabularies.unknownKeywordFactory
. By default this uses theUnknownKeywordFactory
implementation that logs a warning and returns aAnnotationKeyword
. TheDisallowUnknownKeywordFactory
can be used to disallow the use of unknown keywords.$vocabulary
with value oftrue
that are not known to the implementation.ValidatorTypeCode
getNonFormatKeywords
has been removed and replaced withgetKeywords
. This now includes theformat
keyword as theJsonMetaSchema.Builder
now needs to know if theformat
keyword was configured, as it might not be in meta-schemas that don't define the format vocabulary.VersionCode
for each of theValidatorTypeCode
were modified to remove the keywords that are defined in vocabularies forVersion201909
andVersion202012
.Vocabulary
Keyword
instances instead of the string keyword value as it needs to know the explicit implementation. For instance the implementation for theitems
keyword in Draft 2019-09 and Draft 2020-12 are different.getId
->getIri