networknt / json-schema-validator

A fast Java JSON schema validator that supports draft V4, V6, V7, V2019-09 and V2020-12
Apache License 2.0
822 stars 323 forks source link

Support custom vocabularies and unknown keyword and meta-schema handling #980

Closed justin-tay closed 6 months ago

justin-tay commented 6 months ago

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

JsonMetaSchema

ValidatorTypeCode

Vocabulary

codecov-commenter commented 6 months ago

Codecov Report

Attention: Patch coverage is 85.71429% with 48 lines in your changes are missing coverage. Please review.

Project coverage is 78.51%. Comparing base (fed46cf) to head (42cbbe5).

Files Patch % Lines
...main/java/com/networknt/schema/JsonMetaSchema.java 72.97% 17 Missing and 3 partials :warning:
...n/java/com/networknt/schema/JsonSchemaFactory.java 73.33% 5 Missing and 7 partials :warning:
...ain/java/com/networknt/schema/AbstractKeyword.java 18.18% 9 Missing :warning:
...networknt/schema/DefaultJsonMetaSchemaFactory.java 88.88% 0 Missing and 3 partials :warning:
src/main/java/com/networknt/schema/Vocabulary.java 57.14% 3 Missing :warning:
...tworknt/schema/format/BaseFormatJsonValidator.java 66.66% 0 Missing and 1 partial :warning:

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ 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 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

rishabh413 commented 6 months ago

Hi @justin-tay

Will this also fix https://github.com/networknt/json-schema-validator/issues/475#issuecomment-1618381541 ?

justin-tay commented 6 months ago

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 $dynamicRef which was fixed in

rishabh413 commented 5 months ago

It did, thanks!!