fix: forward path-parameter model name for OpenAPI http_client operations#396
Merged
Merged
Conversation
…ions
OpenAPI http_client operations always reported `parameterType: undefined` in
their rendered-function metadata, so downstream consumers had no way to know
which operations require a `parameters` argument.
README generation depends on this signal: when it is missing, the generated
usage example omits the required `parameters` for path-parameter operations
(e.g. `getV2ConnectReferenceId` for `GET /v2/connect/{referenceId}`), producing
a snippet that does not type-check, and it can pick such an operation as the
"simple" primary example.
Populate `HttpRenderType.parameterType` with the generated parameter model name
when the operation declares path parameters, and forward it through
`renderedFunctions` in the OpenAPI channels generator. Operations without path
parameters continue to report `undefined`.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
jonaslagoni
approved these changes
Jul 9, 2026
Contributor
|
🎉 This PR is included in version 0.72.9 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
Problem
For OpenAPI inputs, the
http_clientchannels generator pushed every operation intorenderedFunctionswith a hardcodedparameterType: undefined(src/codegen/generators/typescript/channels/openapi.ts). It forwardedmessageType/replyTypebut dropped the path-parameter information entirely.Downstream consumers rely on
parameterTypeto know whether an operation requires aparametersargument. In particular, README generation (in theplatform-and-serviceslibrary) uses it to decide whether to show aparametersline in the usage example and to pick a genuinely argument-free "primary" example.Because it was always
undefined, the generated README could:parametersfor path-parameter operations — e.g.getV2ConnectReferenceIdforGET /v2/connect/{referenceId}— yielding a snippet that does not type-check (Property 'parameters' is missing in type … but required in type 'GetV2ConnectReferenceIdContext'); andThe functions themselves were always exported correctly — this is purely about the metadata that drives documentation/examples.
Fix
parameterType?: stringtoHttpRenderTypeand populate it inrenderHttpFetchClientwith the parameter model name (channelParameters?.name) when the operation declares path parameters.r.parameterType(instead ofundefined) throughrenderedFunctionsin the OpenAPI channels generator.Operations without path parameters continue to report
undefined.Verification
npm run typecheck— clean.npm test -- --testPathPattern=channels.spec— 13 passed, snapshots unchanged.http_clienttest: a path-parameter operation (findPetsByStatusAndCategory) now exposesparameterType: 'FindPetsByStatusAndCategoryParameters', while a parameter-free operation reportsundefined.payload/parameterscorrectly, instead of silently dropping a requiredparametersargument.🤖 Generated with Claude Code