Update json-schema-validator to 2.0.3 and migrate to its new API - #224
Merged
Conversation
json-schema-validator 2.x is a breaking release that renames the core
types out of the previous `com.networknt.schema.*` surface. Migrate the
schema-validation test helper accordingly:
- JsonSchema -> Schema
- JsonSchemaFactory -> SchemaRegistry
- ValidationMessage -> Error
- JsonSchemaException -> SchemaException
- SpecVersion.VersionFlag.V4 -> SpecificationVersion.DRAFT_4
- JsonSchemaFactory.builder(getInstance(...)).build()
-> SchemaRegistry.withDefaultDialect(...)
- schema.validate() now returns List<Error> instead of Set
Imports are listed explicitly rather than wildcard so that the new
`com.networknt.schema.Error` shadows `java.lang.Error`.
Stays on the 2.x line (not 3.x, which requires Jackson 3) to remain
compatible with the project's Jackson 2 dependency. Verified with the
full :plugin-test integration suite.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
What
Bumps
com.networknt:json-schema-validator1.5.9 → 2.0.3 and migrates the test schema-validation helper (BaseExtractorTest) to the new 2.x API.This unblocks the Dependabot group update in #223, whose
json-schema-validatorbump was failing to compile (unable to resolve class JsonSchemaand friends). The other four dependencies in that group are unrelated and can be handled by Dependabot as usual.Why the source changes are needed
json-schema-validator 2.x is a breaking release that renames the core types out of the old
com.networknt.schema.*surface:JsonSchemaSchemaJsonSchemaFactorySchemaRegistryValidationMessageErrorJsonSchemaExceptionSchemaExceptionSpecVersion.VersionFlag.V4SpecificationVersion.DRAFT_4JsonSchemaFactory.builder(getInstance(...)).build()SchemaRegistry.withDefaultDialect(...)schema.validate()→Set<ValidationMessage>schema.validate()→List<Error>Imports are now explicit rather than a wildcard, so that the new
com.networknt.schema.Errorcorrectly shadowsjava.lang.Error.Why 2.0.3 and not 3.x
The 3.x line requires Jackson 3; this project is on Jackson 2. Dependabot's config already ignores json-schema-validator major v3, so 2.0.3 is the correct Jackson-2-compatible target.
Verification
:plugin-test:test(full integration suite, which exercises the schema validation path) ✅🤖 Generated with Claude Code