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
836 stars 324 forks source link

Walk items schema instead of walking instance data #993

Closed justin-tay closed 6 months ago

justin-tay commented 6 months ago

Closes #989

This changes the behavior of the walk for the item walk listener to walk the schema instead of walking the instance data. All the relevant item schemas will be called at least once with null as the instance node (This is not the same as NullNode which is a node with a value of null while null is the absence of the node) when there is no applicable instance data.

This also fixes the incorrect schemaLocation and evaluationPath used for the tuple schemas for prefixItems.

codecov-commenter commented 6 months ago

Codecov Report

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

Project coverage is 78.73%. Comparing base (3416e28) to head (05e5fd0).

Files Patch % Lines
...main/java/com/networknt/schema/ItemsValidator.java 66.26% 22 Missing and 6 partials :warning:
...ava/com/networknt/schema/PrefixItemsValidator.java 48.14% 11 Missing and 3 partials :warning:
...java/com/networknt/schema/DynamicRefValidator.java 0.00% 11 Missing :warning:
...ava/com/networknt/schema/ItemsValidator202012.java 30.00% 4 Missing and 3 partials :warning:
...va/com/networknt/schema/RecursiveRefValidator.java 81.81% 0 Missing and 2 partials :warning:
...java/com/networknt/schema/PropertiesValidator.java 80.00% 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 #993 +/- ## ============================================ - Coverage 78.81% 78.73% -0.09% - Complexity 1927 1955 +28 ============================================ Files 172 172 Lines 6213 6334 +121 Branches 1205 1247 +42 ============================================ + Hits 4897 4987 +90 - Misses 861 881 +20 - Partials 455 466 +11 ```

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