spring-ai icon indicating copy to clipboard operation
spring-ai copied to clipboard

Inject jackson `ObjectMapper` configured via DI in `ToolCallResultConverter`

Open Fristi opened this issue 1 week ago • 0 comments
trafficstars

Expected Behavior

When a method tool (annotated via @Tool) returns an object it's serialized with DefaultToolCallResultConverter. This however uses JsonParser which has a hardcoded ObjectMapper in it.

Would have expected that it would use the ObjectMapper via Spring DI

Current Behavior

Like mentioned it uses a hardcoded ToolCallResultConverter which does not allow to override it's configuration

Context

This one is not configurable which we would like to (to drop fields which have null fields to save tokens towards the LLM)

Fristi avatar Nov 10 '25 11:11 Fristi