Skip to content

Update json-schema-validator to 2.0.3 and migrate to its new API - #224

Merged
bigdaz merged 1 commit into
mainfrom
update-json-schema-validator-2.0.3
Jul 5, 2026
Merged

Update json-schema-validator to 2.0.3 and migrate to its new API#224
bigdaz merged 1 commit into
mainfrom
update-json-schema-validator-2.0.3

Conversation

@bigdaz

@bigdaz bigdaz commented Jul 5, 2026

Copy link
Copy Markdown
Member

What

Bumps com.networknt:json-schema-validator 1.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-validator bump was failing to compile (unable to resolve class JsonSchema and 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:

1.5.9 2.0.3
JsonSchema Schema
JsonSchemaFactory SchemaRegistry
ValidationMessage Error
JsonSchemaException SchemaException
SpecVersion.VersionFlag.V4 SpecificationVersion.DRAFT_4
JsonSchemaFactory.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.Error correctly shadows java.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

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>
@bigdaz
bigdaz merged commit bd5f2ba into main Jul 5, 2026
16 checks passed
@bigdaz
bigdaz deleted the update-json-schema-validator-2.0.3 branch July 5, 2026 01:45
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.

1 participant