10BC0 ADK in general and FunctionTool must allow injecting one's custom ObjectMapper instead of hard-coding it · Issue #473 · google/adk-java · GitHub
[go: up one dir, main page]

Skip to content

ADK in general and FunctionTool must allow injecting one's custom ObjectMapper instead of hard-coding it #473

@vorburger

Description

@vorburger

Describe the bug

ADK currently hard-codes new ObjectMapper().registerModule(new Jdk8Module()) in places like here.

This is well intended ("it works out of the box"), but it's not extensible, and blocks one from using a custom ObjectMapper; e.g. in my project I would like (have) to use this one instead; notably for:

mapper.registerModule(new JavaTimeModule());

But this (the JavaTimeModule) is really just one case - the point is that users should be able to inject their own.

The specific issue I've faced is that my ToDoTool here used a domain class ToDo with Instant fields, and that made choke.

I'm temporarily working around it with enola-dev/enola#1855 - but I shouldn't have to.

To Reproduce
Steps to reproduce the behavior:

  1. git clone https://github.com/enola-dev/enola.git
  2. Revert fix: Work around https://github.com/enola-dev/enola/issues/1854 enola-dev/enola#1855
  3. Run b test //java/dev/enola/todo/...
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Additional context

@Poggecci @Doris26 @shukladivyansh @Jacksunwei @glaforge agreed that this makes sense?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0