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
Open
fix: upgrade jsonschema-generator to 5.0.0 for Spring AI 2.0.0-M4 compatibility#1355xseruer wants to merge 4 commits into
xseruer wants to merge 4 commits into
Conversation
…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
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
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 usesjsonschema-generator:4.38.0(Jackson 2.x /com.fasterxml.jackson). When both coexist, Maven resolves to v5.0.0, causingNoSuchMethodErrorbecause theSchemaGenerator.generateSchema()return type changed fromcom.fasterxml.jackson.databind.node.ObjectNodetotools.jackson.databind.node.ObjectNode.Fix approach:
jsonschema-generatorfrom 4.38.0 → 5.0.0tools.jackson.core:jackson-databind:3.0.4as a dependencygenerateSchema().toString()→fromJson()tools.jackson.databind.JsonNodeChanges
agentscope-dependencies-bom/pom.xmlagentscope-core/pom.xmltools.jackson.core:jackson-databindagentscope-distribution/agentscope-all/pom.xmltools.jackson.core:jackson-databindJsonSchemaUtils.java.toString()+fromJson()instead of Jackson 2.xconvertValue()for schema generationToolSchemaModuleTest.javacom.fasterxml.jackson.databind.JsonNode→tools.jackson.databind.JsonNodeTest Plan
JsonSchemaUtilsTest— all 7 tests passToolSchemaModuleTest— all 8 tests passagentscope-coremodule compilation succeedsCloses #1271