Skip to content

fix: upgrade jsonschema-generator to 5.0.0 for Spring AI 2.0.0-M4 compatibility#1355

Open
xseruer wants to merge 4 commits into
agentscope-ai:mainfrom
xseruer:fix/jsonschema-generator-v5-compatibility
Open

fix: upgrade jsonschema-generator to 5.0.0 for Spring AI 2.0.0-M4 compatibility#1355
xseruer wants to merge 4 commits into
agentscope-ai:mainfrom
xseruer:fix/jsonschema-generator-v5-compatibility

Conversation

@xseruer
Copy link
Copy Markdown
Contributor

@xseruer xseruer commented May 8, 2026

Summary

Resolves the dependency conflict between AgentScope and Spring AI 2.0.0-M4 caused by incompatible versions of com.github.victools:jsonschema-generator.

Root Cause: Spring AI 2.0.0-M4 depends on jsonschema-generator:5.0.0 (which uses Jackson 3.x / tools.jackson.core), while AgentScope uses jsonschema-generator:4.38.0 (Jackson 2.x / com.fasterxml.jackson). When both coexist, Maven resolves to v5.0.0, causing NoSuchMethodError because the SchemaGenerator.generateSchema() return type changed from com.fasterxml.jackson.databind.node.ObjectNode to tools.jackson.databind.node.ObjectNode.

Fix approach:

  • Upgrade jsonschema-generator from 4.38.0 → 5.0.0
  • Add tools.jackson.core:jackson-databind:3.0.4 as a dependency
  • Bridge between Jackson 3.x (schema generator output) and Jackson 2.x (AgentScope internals) via JSON string serialization — generateSchema().toString()fromJson()
  • Update test imports to use tools.jackson.databind.JsonNode

Changes

File Change
agentscope-dependencies-bom/pom.xml Version bump 4.38.0 → 5.0.0, add Jackson 3.x dependency, remove stale exclusion
agentscope-core/pom.xml Add tools.jackson.core:jackson-databind
agentscope-distribution/agentscope-all/pom.xml Add tools.jackson.core:jackson-databind
JsonSchemaUtils.java Use .toString() + fromJson() instead of Jackson 2.x convertValue() for schema generation
ToolSchemaModuleTest.java Update import from com.fasterxml.jackson.databind.JsonNodetools.jackson.databind.JsonNode

Test Plan

  • JsonSchemaUtilsTest — all 7 tests pass
  • ToolSchemaModuleTest — all 8 tests pass
  • Full agentscope-core module compilation succeeds

Closes #1271

…patibility

Resolves the dependency conflict between AgentScope and Spring AI 2.0.0-M4
caused by incompatible versions of com.github.victools:jsonschema-generator.

Spring AI 2.0.0-M4 requires jsonschema-generator 5.0.0 which uses Jackson 3.x
(tools.jackson.core). When both libraries coexist on the classpath, Maven
resolves to v5.0.0, causing NoSuchMethodError in AgentScope's schema generation
code that was compiled against v4.38.0 (Jackson 2.x).

Changes:
- Upgrade jsonschema-generator from 4.38.0 to 5.0.0
- Add tools.jackson.core:jackson-databind dependency (Jackson 3.x)
- Adapt JsonSchemaUtils to bridge between Jackson 3.x (used by schema
  generator) and Jackson 2.x (used by the rest of AgentScope) via JSON
  string serialization
- Update ToolSchemaModuleTest to use tools.jackson.databind.JsonNode

Closes agentscope-ai#1271
@xseruer xseruer requested a review from a team May 8, 2026 04:04
@codecov
Copy link
Copy Markdown

codecov Bot commented May 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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.

[Bug]: Dependency conflict with org.springframework.ai 2.0.0-M4 due to com.github.victools version mismatch

1 participant