Skip to content

Upgrade com.github.victools:jsonschema-generator to 5.x to resolve conflict with Spring AI 2.x #624

Description

@iranna-m-31

Currently, the Restate Java SDK (dev.restate:sdk-serde-jackson) relies on the 4.x branch (specifically 4.38.0) of com.github.victools:jsonschema-generator.

When attempting to use Restate alongside Spring AI 2.0.0 (which relies on the 5.0.0 branch of the same victools libraries), it creates a strict classpath conflict. Because version 5.0.0 introduced breaking changes to the SchemaGeneratorConfigBuilder constructors, the application crashes on startup depending on which version Gradle resolves.

The Error

If Gradle defaults to version 5.0.0, the Restate SDK crashes during initialization with the following NoSuchMethodError:

***************************
APPLICATION FAILED TO START
***************************

Description:
An attempt was made to call a method that does not exist. The attempt was made from the following location:
    dev.restate.serde.jackson.JacksonSerdes.<clinit>(JacksonSerdes.java:56)

The following method did not exist:
    'void com.github.victools.jsonschema.generator.SchemaGeneratorConfigBuilder.<init>(com.fasterxml.jackson.databind.ObjectMapper, com.github.victools.jsonschema.generator.SchemaVersion, com.github.victools.jsonschema.generator.OptionPreset)'

If I attempt to resolve the conflict by forcing Gradle to downgrade jsonschema-generator to 4.38.0, it breaks Spring AI's companion module (jsonschema-module-jackson at 5.0.0), resulting in:

***************************
APPLICATION FAILED TO START
***************************

Description:
An attempt was made to call a method that does not exist. The attempt was made from the following location:
    com.github.victools.jsonschema.module.jackson.JacksonSchemaModule.applyToConfigBuilder(JacksonSchemaModule.java:91)

The following method did not exist:
    'tools.jackson.databind.ObjectMapper com.github.victools.jsonschema.generator.SchemaGeneratorConfigBuilder.getObjectMapper()'

Proposed Solution

Upgrade the com.github.victools:jsonschema-generator dependency in sdk-serde-jackson to version 5.0.0 (or the latest 5.x).

This will align the Restate SDK with the modern Spring Boot 3 / Spring AI 2.x ecosystem and prevent binary incompatibilities for users building AI-driven Restate applications.

Steps to Reproduce

  1. Create a Spring Boot project.
  2. Add dependencies for dev.restate:sdk-spring-boot-starter:2.8.0 and org.springframework.ai:spring-ai-starter-model-openai:2.0.0.
  3. Start the application.
  4. Observe the NoSuchMethodError during startup.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions