Skip to content

Conversation

@sdeleuze
Copy link
Contributor

This draft PR for Spring AI 2.0 requires for now installing locally:

JsonMapper is used instead of ObjectMapper, following Jackson 3 best practices and the same pattern used by Spring Framework and Spring Boot.

JacksonUtils#instantiateAvailableModules now leverages Jackson service loader based discovery of Jackson module.

TODO:

  • Upgrade to com.github.victools:jsonschema-generator:5.0.0
  • Upgrade to MCP Java SDK 0.18.0

cc @filiphr

It requires for now installing locally:
 - modelcontextprotocol/java-sdk#742
 - https://github.com/victools/jsonschema-generator main branch

JsonMapper is used instead of ObjectMapper, following Jackson 3 best
practices and the same pattern used by Spring Framework and Spring
Boot.

JacksonUtils#instantiateAvailableModules now leverages Jackson service
loader based discovery of Jackson module.

TODO:
 - Upgrade to com.github.victools:jsonschema-generator:5.0.0
 - Upgrade to MCP Java SDK 0.18.0

Signed-off-by: Sébastien Deleuze <[email protected]>
@sdeleuze sdeleuze requested review from chemicL and tzolov January 14, 2026 15:46
@sdeleuze sdeleuze self-assigned this Jan 14, 2026
@sdeleuze sdeleuze marked this pull request as draft January 14, 2026 15:47
Copy link
Contributor

@filiphr filiphr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pinging me @sdeleuze.

I've left some comments around using JsonMapper.shared() instead of new JsonMapper() in production code. I think it's a better approach to use the shared, since it avoids creating new instances. I tried to comment in all the production code places I saw in case it is easier for you like that.

Additionally, I left some other comments like the fact that we can use Jackson 3 with the ElasticsearchVectorStore and a small note on the hugging face chat model and the schema creation.


var webClientBuilderTemplate = webClientBuilderProvider.getIfAvailable(WebClient::builder);
var objectMapper = objectMapperProvider.getIfAvailable(ObjectMapper::new);
var jsonMapper = jsonMapperProvider.getIfAvailable(JsonMapper::new);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could use JsonMapper::shared instead of creating a new instance.

Signed-off-by: Sébastien Deleuze <[email protected]>
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.

3 participants