Skip to content

feat(openapi): implement spec operation parser and auth handler (part 2)#385

Open
AmaadMartin wants to merge 5 commits into
google:mainfrom
AmaadMartin:feat/openapi_tool_part2
Open

feat(openapi): implement spec operation parser and auth handler (part 2)#385
AmaadMartin wants to merge 5 commits into
google:mainfrom
AmaadMartin:feat/openapi_tool_part2

Conversation

@AmaadMartin
Copy link
Copy Markdown
Collaborator

Link to Issue or Description of Change

Problem:
Generating LLM-callable tools from OpenAPI specifications requires robust parsing of spec parameters and managing authentication requirements within session state.

Solution:
Implemented OpenAPI spec operation parsing and tool auth handling (Part 2 of 4):

  • operation_parser.ts: Logic to extract and parse API parameters, request body schemas, and response types from OpenAPI path operations.
  • openapi_spec_parser.ts: Base OpenAPI spec parsing logic including sanitizeSchemaTypes to ensure compatibility with Gemini function calling schemas.
  • tool_auth_handler.ts: Context credential caching and preparation handler for tool contexts.

Testing Plan

Unit Tests:

  • I have added or updated unit tests for my change.
  • All unit tests pass locally.

Summary of passed results:

  • Added unit tests for parsing operations, sanitizing schemas, and tool auth handling.
  • Actual Line Coverage by File:
    • openapi_spec_parser/tool_auth_handler.ts: 100%
    • openapi_spec_parser/openapi_spec_parser.ts: 94.81%
    • openapi_spec_parser/operation_parser.ts: 93.60%

Checklist

  • I have performed a self-review of my own code.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.

Amaad Martin added 2 commits May 27, 2026 13:23
This implements auth helper methods, service account exchanger, and auto auth credential exchanger for OpenAPI tools.

TAG=agy
CONV=5d70d8ac-425c-4f8c-a969-97b17ecc66ce
This implements OpenAPI spec operation parsing and tool auth handling.

TAG=agy
CONV=5d70d8ac-425c-4f8c-a969-97b17ecc66ce
@AmaadMartin AmaadMartin changed the base branch from main to feat/openapi_tool_part1 May 27, 2026 20:38
Amaad Martin added 2 commits May 27, 2026 13:54
TAG=agy
CONV=5d70d8ac-425c-4f8c-a969-97b17ecc66ce
TAG=agy
CONV=5d70d8ac-425c-4f8c-a969-97b17ecc66ce
@AmaadMartin AmaadMartin self-assigned this May 28, 2026
@AmaadMartin AmaadMartin requested a review from kalenkevich May 28, 2026 19:15
@AmaadMartin AmaadMartin changed the base branch from feat/openapi_tool_part1 to main May 28, 2026 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant