Skip to content

Object-valued OpenAPI query parameters are serialized as dictionary strings#7233

Description

@benclarkeio

馃敶 Required Information

Describe the Bug:

RestApiTool passes object-valued query parameters directly to the HTTP client. For OpenAPI's default query serialization (style: form, explode: true), this produces one stringified dictionary value instead of separate query parameters.

Steps to Reproduce:

  1. Create an OpenAPI operation with a query parameter like this:

    paths:
      /items:
        get:
          operationId: listItems
          parameters:
            - name: filters
              in: query
              schema:
                type: object
                properties:
                  category:
                    type: string
                  page:
                    type: integer
  2. Build a RestApiTool for the operation.

  3. Call the tool with {"filters": {"category": "books", "page": 2}}.

  4. Inspect the outgoing query string.

Expected Behavior:

The outgoing query string is ?category=books&page=2.

Observed Behavior:

The request contains one stringified dictionary value, equivalent to ?filters=%7B%27category%27%3A+%27books%27%2C+%27page%27%3A+2%7D.

Environment Details:

  • ADK Library Version: 2.9.2
  • Desktop OS: macOS
  • Python Version: 3.13

Model Information:

  • Are you using LiteLLM: N/A
  • Which model is being used: N/A

馃煛 Optional Information

Regression:

No known working version.

Logs:

N/A

Screenshots / Video:

N/A

Additional Context:

OpenAPI defaults query parameters to style: form, with explode defaulting to true for that style. The parsed operation retains those settings, but _prepare_request_params currently forwards the dictionary unchanged.

Minimal Reproduction Code:

request_params = tool._prepare_request_params(
    tool._operation_parser.get_parameters(),
    {"filters": {"category": "books", "page": 2}},
)

assert request_params["params"] == {"category": "books", "page": 2}

How often has this issue occurred?:

  • Always (100%)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions