Repository navigation
fix(openapi): emit the body argument for a schema-less request body - #907
Merged
AmaadMartin merged 1 commit intoSep 16, 2026
Conversation
An OpenAPI media type object may omit `schema`. That describes an
unconstrained payload, not the absence of one, so the generated tool must
still accept a body. OperationParser dropped the parameter entirely, and
RestApiTool could never send a body for such an operation.
Default the missing schema to `{}`, which routes the request body into the
existing untyped arm and matches adk-python's `_process_request_body`.
Collaborator
|
Merging in about 6h unless someone objects. Close this PR, add |
Collaborator
|
Merging in about 1h unless someone objects. Close this PR, add |
adk-foundry-approver
approved these changes
Sep 16, 2026
adk-foundry-approver
left a comment
Collaborator
There was a problem hiding this comment.
Approved automatically by ADK Foundry. No human has read this change.
This approval attests only that the change passed the gates below, all
enforced in code:
- the merge critic read the diff and approved it (93.9% precision measured
against 107 upstream pull requests with known maintainer outcomes) - ? changed lines across ? file(s), inside the 200/5 ceiling
- no auth, credential, security, release or dependency-manifest path touched
- required checks green, re-verified immediately before this approval
- opened 25h ago and visible as
automerge: scheduledthroughout,
with no objection from anyone
To stop this merging, close the pull request or add status/on-hold. To stop
the mechanism entirely, revoke this account's access; delivery continues and
nothing merges.
Merged
prasanna8585
pushed a commit
to prasanna8585/adk-js
that referenced
this pull request
Nov 10, 2026
…ogle#907) An OpenAPI media type object may omit `schema`. That describes an unconstrained payload, not the absence of one, so the generated tool must still accept a body. OperationParser dropped the parameter entirely, and RestApiTool could never send a body for such an operation. Default the missing schema to `{}`, which routes the request body into the existing untyped arm and matches adk-python's `_process_request_body`.
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
1. Link to an existing issue (if applicable):
N/A
2. Or, if no issue exists, describe the change:
Problem:
An OpenAPI media type object may omit
schema, as incontent: {'application/json': {}}.OperationParser.processRequestBody()skips the request body in that case. The generated tool then advertises no body argument, soRestApiToolcannot send a payload. adk-python reads the same spec as an unconstrained body and advertises abodyargument for it.Solution:
The missing schema now defaults to
{}. That value falls into the existing untyped arm, which names the parameterbody. This matches_process_request_bodyin adk-python. I keep the empty schema rather than a synthesized{type: 'object'}, because the second form adds a constraint the spec does not state.A
$refrequest body and a$refmedia type schema behave as before.Testing Plan
Unit Tests:
Four new tests, no existing test edited:
operation_parser_test.ts: a schema-less media type yields onebodyparameter with an emptyparamSchema.operation_parser_test.ts:getJsonSchema().propertieshasbody, so the model can see the argument.operation_parser_test.ts: an emptycontentobject still yields zero parameters.rest_api_tool_test.ts: the parsed parameter drivesprepareRequestParamsandprepareRequestBody, and the payload goes out as JSON.I reverted the source change and re-ran both files. Three of the four new tests failed, so they hold the new behavior.
Manual End-to-End (E2E) Tests:
The change touches no network, credential, or model surface. The
prepareRequestParamstoprepareRequestBodytest stands in for an E2E run, because it proves the parsed parameter reaches the request.Checklist