Cleanup of IOException leftovers after update to jackson3#1244
Merged
stevehu merged 3 commits intoApr 20, 2026
Conversation
9a73bac to
4d26a02
Compare
There was a problem hiding this comment.
Pull request overview
This PR addresses a Jackson 3 migration regression where invalid JSON passed to SchemaRegistry.getSchema() can escape as JacksonException instead of being wrapped in the library’s SchemaException, aiming to preserve the 2.x behavior described in #1243.
Changes:
- Catch
tools.jackson.core.JacksonExceptioninSchemaRegistry.getSchema(...)and rethrow asSchemaException. - Update
Schemainput deserialization to convertJacksonExceptioninto the priorUncheckedIOExceptionshape. - Adjust
NodeReader/implementations and tests to align with the updated exception flow.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/java/com/networknt/schema/SchemaRegistry.java | Wrap JacksonException from schema parsing into SchemaException in getSchema(...). |
| src/main/java/com/networknt/schema/Schema.java | Preserve prior validate(...) exception contract by converting Jackson parse failures into UncheckedIOException. |
| src/main/java/com/networknt/schema/serialization/NodeReader.java | Changes NodeReader method signatures by removing throws IOException. |
| src/main/java/com/networknt/schema/serialization/DefaultNodeReader.java | Updates implementations to match the new NodeReader signature. |
| src/main/java/com/networknt/schema/serialization/BasicNodeReader.java | Updates implementations/imports to match the new NodeReader signature. |
| src/test/java/com/networknt/schema/SchemaRegistryTest.java | Adds regression test asserting invalid JSON schema input yields SchemaException. |
| src/test/java/com/networknt/schema/serialization/DefaultNodeReaderTest.java | Removes now-unnecessary throws IOException from tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
justin-tay
approved these changes
Apr 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
To keep backward compatiblity with version 2.x catch JacksonException and rethrow as SchemaException
This is an proposition to fix #1243