Support @Schema annotation for Object parameters in FunctionTool
@hemasekhar-p ci sta già lavorando.
Dal 14/1/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
Is your feature request related to a problem? Please describe.
Currently, adk-java relies on Jackson's @JsonProperty for defining schema names and required fields for pojos used as FunctionTool parameters. This creates several friction points:
- Naming Conflicts: We may want the LLM-facing parameter name (e.g.,
snake_case) to differ from the Java field name (e.g.,camelCase) without affecting internal JSON serialization used for other purposes. - Missing Metadata: Standard Jackson annotations do not support a
descriptionfield, which is critical for FunctionTool schemas. - Ambiguous Optionality: Controlling whether a field is "required" or "optional" in the generated schema is difficult to decouple from Jackson's strict deserialization rules.
Describe the solution you'd like
I would like to extend the com.google.adk.tools.Annotations.Schema annotation to act as the highest source of truth for generating the FunctionTool schema in regards to pojo parameters, and deserialization. This includes:
- Name:
@Schema(name="...")should control the property name in the generated schema and during deserialization of the LLM response. - Description:
@Schema(description="...")should populate the schema description. - Optionality:
@Schema(optional=true/false)should explicitly control whether a field is marked as required, overriding Jackson's default behavior if necessary.
Describe alternatives you've considered
- Jackson Mixins: We could use Jackson Mixins to separate the LLM view from the internal view, but this adds significant boilerplate and complexity for developers.
- Custom Annotations: I considered creating a new set of annotations, but extending the existing
@Schemaannotation seems more idiomatic for the ADK.
Additional context
The Object FunctionTool parameter doesn't seem to have a direct 1-1 equivalent in adk-python, other than an issue requesting for pydantic models to be supported as FunctionTool parameters.
The precedence rules I believe align best with the rest of the library would be :
Name: @Schema(name) > @JsonProperty(value) > Field Name
Description: @Schema(description) > None
Required: @Schema(optional) > @JsonProperty(required) > Default (Optional)
These rules should not affect the way prior objects that have been passed without the @Schema annotation are treated.
- Lingua principale
- Java
- Stelle
- 1.7k
- Fork
- 421
- Merge medio
- 3g 8h
- PR unite (30g)
- 36
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di google/adk-java
-
needs review
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
-
needs review
-
needs review
-
needs review
-
needs review
Tutte le issue di google/adk-java
Issue simili
-
certification
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 80/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
[BUG] ECR GetAuthorizationToken returns a proxyEndpoint for the default region, not the request's Apertabug ecr
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Needs: Triage Type: Feature request
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
AntennaPod/AntennaPod#8794 ·
-
agentic-workflows
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
github/copilot-sdk#2760 ·