Two docstrings in openapi_tool document parameters the signatures do not accept

オープン 初心者向け
#8,024 コメント 1 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 3 日以内に返信

@surajksharma07 がすでに取り組んでいます。

2026年11月9日 から。

  • #8026 @Anoshor による — オープン

評価

難易度
1/5
見積もり時間
1時間未満
初心者へのやさしさ
88/100
issue の種類
ドキュメント
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python
領域
documentation

調査の方向性

src/google/adk/tools/openapi_tool/openapi_spec_parser/rest_api_tool.py:352 と src/google/adk/tools/openapi_tool/auth/credential_exchangers/oauth2_exchanger.py:69 のdocstringを、それぞれのメソッドシグネチャと照らし合わせて読む。1つ目を更新し、parsed_operation_str がJSON文字列であると説明し、2つ目から存在しない引数 auth_scheme を削除する。両方のArgsセクションがシグネチャと型に一致したら完了。

索引モデルが issue の本文から書いたものです。

説明

Two docstrings in google/adk document parameters that the signatures do not accept

Both are in the OpenAPI tooling under src/google/adk/tools/openapi_tool/. Neither affects behaviour; both mislead anyone reading the reference for the tool-building path.

1. RestApiTool.from_parsed_operation_str — wrong name and wrong type

src/google/adk/tools/openapi_tool/openapi_spec_parser/rest_api_tool.py:352

    @classmethod
    def from_parsed_operation_str(
        cls, parsed_operation_str: str
    ) -> "RestApiTool":
        """Initializes the RestApiTool from a dict.

        Args:
            parsed: A dict representation of a ParsedOperation object.
        ...
        operation = ParsedOperation.model_validate_json(parsed_operation_str)

The parameter is parsed_operation_str, and it is a JSON string (model_validate_json), not a dict. Both halves of the sentence are stale: the name and the type.

2. OAuth2CredentialExchanger.generate_auth_token — documents a parameter that is not there

src/google/adk/tools/openapi_tool/auth/credential_exchangers/oauth2_exchanger.py:69

    def generate_auth_token(
        self,
        auth_credential: Optional[AuthCredential] = None,
    ) -> AuthCredential:
        """Generates an auth token from the authorization response.

        Args:
            auth_scheme: The OpenID Connect or OAuth2 auth scheme.
            auth_credential: The auth credential.

auth_scheme is not a parameter of this method (the scheme was consumed by AuthCredential earlier in the flow). auth_credential is.

Suggested diff

--- a/src/google/adk/tools/openapi_tool/openapi_spec_parser/rest_api_tool.py
+++ b/src/google/adk/tools/openapi_tool/openapi_spec_parser/rest_api_tool.py
@@
-        """Initializes the RestApiTool from a dict.
+        """Initializes the RestApiTool from a serialized ParsedOperation.
 
         Args:
-            parsed: A dict representation of a ParsedOperation object.
+            parsed_operation_str: A JSON string representation of a ParsedOperation object.
--- a/src/google/adk/tools/openapi_tool/auth/credential_exchangers/oauth2_exchanger.py
+++ b/src/google/adk/tools/openapi_tool/auth/credential_exchangers/oauth2_exchanger.py
@@
         Args:
-            auth_scheme: The OpenID Connect or OAuth2 auth scheme.
             auth_credential: The auth credential.

How this was found

A static check over Google-style Args: blocks that reports entries whose name is not an argument of the enclosing function; the two rows above were then read against the signatures by hand. A repo-wide run also flagged application_integration_toolset.py and the _execute_sql_* helpers in the BigQuery integration, but those are **kwargs forwarding and a nested-section parse, i.e. not defects, so they are excluded here.

Why an issue and not a PR

CONTRIBUTING.md requires a signed Google CLA before a PR, and the google-cla check fails for this account (confirmed on a separate Google repository — google/XNNPACK#11910 shows cla/google failing until the agreement is signed). If you would rather have the patch directly, I can open the PR as soon as the CLA is signed on my side; otherwise this report is everything needed for the two-line fix.

主要言語
Python
スター
22.3k
フォーク
4.4k
平均マージ
1日 2時間
マージ済み PR(30日)
6

環境構築

はじめの一歩

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

google/adk-python のほかの issue

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

似ている issue

Python の issue をもっと見る

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

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