Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Support @Schema annotation for Object parameters in FunctionTool

オープン
#611 コメント 2 件 リアクション 1 件 担当者 1 名 GitHub で見る

@hemasekhar-p がすでに取り組んでいます。

2026年1月14日 から。

評価

この issue はまだ評価されていません。

説明

needs review

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:

  1. 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.
  2. Missing Metadata: Standard Jackson annotations do not support a description field, which is critical for FunctionTool schemas.
  3. 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:

  1. Name: @Schema(name="...") should control the property name in the generated schema and during deserialization of the LLM response.
  2. Description: @Schema(description="...") should populate the schema description.
  3. 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

  1. 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.
  2. Custom Annotations: I considered creating a new set of annotations, but extending the existing @Schema annotation 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.

主要言語
Java
スター
1.7k
フォーク
421
平均マージ
3日 15時間
マージ済み PR(30日)
32

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

google/adk-java のほかの issue

google/adk-java の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。