-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Description
Is your feature request related to a problem? Please describe.
ADK's OpenAPIToolset automatically converts camelCase to snake_case when generating tool parameters, and there doesn't appear to be a built-in option to disable this. This is a problem when calling APIs which expect camelCase property names in the request body.
For example, an OpenAPI spec with sessionInfo gets converted to session_info in the actual API call, causing the target API to reject the request.
Describe the solution you'd like
It would be good to be able to flag parameters in the OpenAPI spec to preserve their original casing. For example, a vendor extension like:
sessionInfo:
type: object
x-adk-preserve-case: true
properties:
session:
type: string
Or a global option in the OpenAPIToolset constructor:
toolset = OpenAPIToolset(
spec_str=spec_content,
spec_str_type="yaml",
preserve_property_names=True, # Skip snake_case conversion
)
Describe alternatives you've considered
Modifying the target API to accept both session_info and sessionInfo - works but requires changes to every API endpoint
Creating a custom FunctionTool wrapper instead of using OpenAPIToolset - bypasses the conversion but loses the benefits of automatic OpenAPI parsing
Using snake_case in the OpenAPI spec - but this misrepresents the actual API contract
Additional context
The conversion happens in _sanitize_schema_formats_for_gemini in _gemini_schema_util.py at line 154:
field_name = _to_snake_case(field_name)
This converts all OpenAPI schema field names to snake_case before passing them to Gemini. While rest_api_tool.py does store original_name for parameters, the schema transformation happens before this mapping can preserve the original casing in the request body.