Repository navigation
feat(openapi): implement spec operation parser and auth handler (part 2) - #385
Merged
Merged
Conversation
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
added 2 commits
May 27, 2026 13:54
TAG=agy CONV=5d70d8ac-425c-4f8c-a969-97b17ecc66ce
TAG=agy CONV=5d70d8ac-425c-4f8c-a969-97b17ecc66ce
kalenkevich
reviewed
Jun 1, 2026
| import {experimental} from '../../../utils/experimental.js'; | ||
| import {ApiParameter, OperationParser} from './operation_parser.js'; | ||
|
|
||
| const VALID_SCHEMA_TYPES = new Set([ |
Collaborator
There was a problem hiding this comment.
Are you sure that this is a comprehensive list of schema types that OPEN API spec has?
Collaborator
Author
There was a problem hiding this comment.
Yes, this list (array, boolean, integer, null, number, object, string) represents the exhaustive set of types defined under both the OpenAPI V3.0 and V3.1 specifications (matching JSON Schema draft-07/2020-12). This also represents the exact subset of types supported by Gemini's tool/function calling schemas. I've added a clarifying comment block above the constant set.
- Moved resolveRef and collectOperations to top-level utility functions. - Added comprehensive unit tests for OpenApiSpecParser. - Add detailed TSDoc comments to OperationParser class and methods. - Exported OpenAPI spec parser classes in common.ts. - Changed unit tests to import components from @google/adk rather than relative paths. TAG=agy CONV=5d70d8ac-425c-4f8c-a969-97b17ecc66ce
…nings - Added type exports for ParsedOperation, OperationEndpoint, ApiParameter, and AuthPreparationResult. - Verified locally with npm run docs:check. TAG=agy CONV=5d70d8ac-425c-4f8c-a969-97b17ecc66ce
kalenkevich
approved these changes
Jun 8, 2026
Merged
AmaadMartin
referenced
this pull request
in AmaadMartin/adk-js
Jun 11, 2026
… 2) (#385) * feat(openapi): implement auth helpers and credential exchangers (part 1) This implements auth helper methods, service account exchanger, and auto auth credential exchanger for OpenAPI tools. TAG=agy CONV=5d70d8ac-425c-4f8c-a969-97b17ecc66ce * feat(openapi): implement spec operation parser and auth handler (part 2) This implements OpenAPI spec operation parsing and tool auth handling. TAG=agy CONV=5d70d8ac-425c-4f8c-a969-97b17ecc66ce * fix(openapi): move default auth scopes to constant TAG=agy CONV=5d70d8ac-425c-4f8c-a969-97b17ecc66ce * refactor(openapi): address spec parser PR reviews and add tests - Moved resolveRef and collectOperations to top-level utility functions. - Added comprehensive unit tests for OpenApiSpecParser. - Add detailed TSDoc comments to OperationParser class and methods. - Exported OpenAPI spec parser classes in common.ts. - Changed unit tests to import components from @google/adk rather than relative paths. TAG=agy CONV=5d70d8ac-425c-4f8c-a969-97b17ecc66ce * fix(openapi): export referenced types publicly to resolve TypeDoc warnings - Added type exports for ParsedOperation, OperationEndpoint, ApiParameter, and AuthPreparationResult. - Verified locally with npm run docs:check. TAG=agy CONV=5d70d8ac-425c-4f8c-a969-97b17ecc66ce --------- Co-authored-by: Amaad Martin <[email protected]>
Closed
7 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 includingsanitizeSchemaTypesto ensure compatibility with Gemini function calling schemas.tool_auth_handler.ts: Context credential caching and preparation handler for tool contexts.Testing Plan
Unit Tests:
Summary of passed results:
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