Skip to content

OpenAPIToolset: INVALID_ARGUMENT due to oneOf keyword #2213

@joaquinperaza

Description

@joaquinperaza

Describe the bug

The agent is raising an INVALID_ARGUMENT error claiming that parameters.properties cannot be empty.
However, the actual issue appears to stem from a misunderstanding of the OpenAPI schema for the endpoint /api/logs/.

The schema defines Log as a polymorphic object with a discriminator, and supports multiple subtypes using oneOf. This should be valid according to the OpenAPI specification, but the agent fails to handle it correctly.

Full error message

{
  "error": "400 INVALID_ARGUMENT. {'error': {'code': 400, 'message': '* GenerateContentRequest.tools[0].function_declarations[52].parameters.properties[]: key cannot be empty\n*"
}

Relevant Schema

Log:
  oneOf:
    - $ref: '#/components/schemas/SowingTyped'
    - $ref: '#/components/schemas/PhenologyTyped'
    - $ref: '#/components/schemas/WaterTyped'
    - $ref: '#/components/schemas/YieldTyped'
    - $ref: '#/components/schemas/FertilizationTyped'
    - $ref: '#/components/schemas/ApplicationTyped'
    - $ref: '#/components/schemas/LabReportTyped'
    - $ref: '#/components/schemas/FieldReportTyped'
    - $ref: '#/components/schemas/BugReportTyped'
    - $ref: '#/components/schemas/WeedReportTyped'
    - $ref: '#/components/schemas/DisesaseReportTyped'
  discriminator:
    propertyName: type
    mapping:
      Sowing: '#/components/schemas/SowingTyped'
      Phenology: '#/components/schemas/PhenologyTyped'
      Water: '#/components/schemas/WaterTyped'
      Yield: '#/components/schemas/YieldTyped'
      Fertilization: '#/components/schemas/FertilizationTyped'
      Application: '#/components/schemas/ApplicationTyped'
      LabReport: '#/components/schemas/LabReportTyped'
      FieldReport: '#/components/schemas/FieldReportTyped'
      BugReport: '#/components/schemas/BugReportTyped'
      WeedReport: '#/components/schemas/WeedReportTyped'
      DiseaseReport: '#/components/schemas/DisesaseReportTyped'
/api/logs/:
  get:
    operationId: api_logs_list
    parameters:
      - in: query
        name: polymorphic_ctype
        schema:
          type: integer
    tags:
      - api
    security:
      - tokenAuth: []
    responses:
      '200':
        description: ''
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/Log'

Steps to reproduce

  1. Include the schema above in the OpenAPI spec.
  2. Load the spec using OpenAPIToolset
  3. Attempt to load the endpoint using adk web
  4. See the INVALID_ARGUMENT error from tool generation.

Expected behavior

The agent should recognize the discriminator and oneOf structure as a valid schema definition and generate appropriate tools without raising a malformed parameters.properties[] error.

Desktop

OS: macOS Sequoia
Python version: python 3.13
ADK version: 1.2.1

Model Information: gemini-2.5-pro

Metadata

Metadata

Labels

tools[Component] This issue is related to tools

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions