-
Notifications
You must be signed in to change notification settings - Fork 958
fix: upgrade jsonschema-generator to 5.0.0 for Spring AI 2.0.0-M4 compatibility #1355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
09ea0be
29033c8
50dfcc4
9260fc2
4eb829c
cf18979
fdc270f
d4c4fe4
fc59c0d
2faa29e
de98de5
9c87fde
ac19490
f86904b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,14 +20,14 @@ | |
| import static org.junit.jupiter.api.Assertions.assertNull; | ||
| import static org.junit.jupiter.api.Assertions.assertTrue; | ||
|
|
||
| import com.fasterxml.jackson.databind.JsonNode; | ||
| import com.github.victools.jsonschema.generator.OptionPreset; | ||
| import com.github.victools.jsonschema.generator.SchemaGenerator; | ||
| import com.github.victools.jsonschema.generator.SchemaGeneratorConfigBuilder; | ||
| import com.github.victools.jsonschema.generator.SchemaVersion; | ||
| import java.util.List; | ||
| import java.util.stream.StreamSupport; | ||
| import org.junit.jupiter.api.Test; | ||
| import tools.jackson.databind.JsonNode; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [nit] While migrating this test to the Jackson 3 |
||
|
|
||
| /** | ||
| * Tests for {@link ToolSchemaModule}. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -105,8 +105,9 @@ | |
| <spring.version>7.0.7</spring.version> | ||
| <spring-boot.version>4.0.4</spring-boot.version> | ||
| <nacos-client.version>3.2.1-2026.03.30</nacos-client.version> | ||
| <json-schema-validator.version>2.0.0</json-schema-validator.version> | ||
| <jsonschema-generator.version>4.38.0</jsonschema-generator.version> | ||
| <json-schema-validator.version>3.0.0</json-schema-validator.version> | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [minor] This PR also bumps |
||
| <jsonschema-generator.version>5.0.0</jsonschema-generator.version> | ||
| <jackson3.version>3.0.4</jackson3.version> | ||
| <snakeyaml.version>2.6</snakeyaml.version> | ||
| <tree-sitter.version>0.24.4</tree-sitter.version> | ||
| <tree-sitter-bash.version>0.23.3</tree-sitter-bash.version> | ||
|
|
@@ -476,12 +477,6 @@ | |
| <groupId>com.github.victools</groupId> | ||
| <artifactId>jsonschema-generator</artifactId> | ||
| <version>${jsonschema-generator.version}</version> | ||
| <exclusions> | ||
| <exclusion> | ||
| <groupId>com.fasterxml.jackson.core</groupId> | ||
| <artifactId>jackson-core</artifactId> | ||
| </exclusion> | ||
| </exclusions> | ||
| </dependency> | ||
|
|
||
| <!-- Victools JSON Schema Module for Jackson annotations support --> | ||
|
|
@@ -491,6 +486,13 @@ | |
| <version>${jsonschema-generator.version}</version> | ||
| </dependency> | ||
|
|
||
| <!-- Jackson 3.x (tools.jackson) required by jsonschema-generator 5.x --> | ||
| <dependency> | ||
| <groupId>tools.jackson.core</groupId> | ||
| <artifactId>jackson-databind</artifactId> | ||
| <version>${jackson3.version}</version> | ||
| </dependency> | ||
|
|
||
| <!-- Apache Commons Lang3 --> | ||
| <dependency> | ||
| <groupId>org.apache.commons</groupId> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nit] Minor observation (not blocking):
schemaGenerator.generateSchema(clazz).toString()+fromJson(...)round-trips the entire schema through a JSON string. For one-shot schema generation perClass/Type(called fromToolSchemaGeneratorandStructuredOutputCapableAgent) this overhead is negligible, and the chosen approach is the cleanest way to keep Jackson 2 dominant elsewhere — so this is fine as-is. The alternative would be a dedicated Jackson 3ObjectMapperdoingconvertValue(node, Map.class)directly, but that would coupleJsonSchemaUtilsto Jackson 3 internals, which is arguably worse. Recommended to keep the current bridge but add a brief inline comment explaining the rationale so future maintainers don't try to 'optimize' it back.