Skip to content

Conversation

justin-tay
Copy link
Contributor

This refactors the return result from a set to a list.

Instead of returning the result for validation/walk, the errors are instead aggregated in a list in the execution context. Clients calling validate from JsonSchema will get a List instead of a `Set.

This should result in better performance when there are a lot of errors in the run as it's a single arraylist that aggregates results and gets resized, and as hashCode is no longer needed to be called on all the messages as it is no longer a set.

This also changes the version in the pom to be 2.0.0-SNAPSHOT to make it clear that this is a major breaking change.

@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 90.57239% with 28 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.94%. Comparing base (48ca3c2) to head (8b71dac).
⚠️ Report is 103 commits behind head on master.

Files with missing lines Patch % Lines
...in/java/com/networknt/schema/DependentSchemas.java 33.33% 3 Missing and 1 partial ⚠️
...c/main/java/com/networknt/schema/NotValidator.java 69.23% 3 Missing and 1 partial ⚠️
...in/java/com/networknt/schema/ExecutionContext.java 66.66% 2 Missing and 1 partial ⚠️
...java/com/networknt/schema/JsonSchemaException.java 66.66% 3 Missing ⚠️
...main/java/com/networknt/schema/OneOfValidator.java 87.50% 2 Missing and 1 partial ⚠️
...java/com/networknt/schema/DynamicRefValidator.java 33.33% 2 Missing ⚠️
...m/networknt/schema/FailFastAssertionException.java 60.00% 2 Missing ⚠️
src/main/java/com/networknt/schema/JsonSchema.java 85.71% 2 Missing ⚠️
...main/java/com/networknt/schema/AnyOfValidator.java 96.87% 0 Missing and 1 partial ⚠️
...main/java/com/networknt/schema/ItemsValidator.java 93.33% 0 Missing and 1 partial ⚠️
... and 3 more
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1197      +/-   ##
============================================
- Coverage     78.90%   77.94%   -0.96%     
- Complexity     1965     2037      +72     
============================================
  Files           172      202      +30     
  Lines          6352     6943     +591     
  Branches       1255     1217      -38     
============================================
+ Hits           5012     5412     +400     
- Misses          867     1082     +215     
+ Partials        473      449      -24     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@stevehu stevehu merged commit 02a6e06 into networknt:master Sep 27, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants