fix(http): type context parameters and headers with concrete generated models#407
Merged
Conversation
…d models
The HTTP fetch client context interface discarded the fully-typed parameter
class and headers model that are already generated, emitting a structural stub
(`{ getChannelWithParameters }` / `{ marshal }`) instead. Consumers got no type
support on `context.parameters` or `context.requestHeaders`.
Thread the concrete `channelParameters`/`channelHeaders` types into
`generateContextInterface` (mirroring the EventSource protocol) so the context
references the real classes. The parameter class still exposes
`getChannelWithParameters`, so URL building is unaffected; operations without a
typed headers model keep the structural `{ marshal }` fallback.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
The OpenAPI HTTP client snapshot now reflects the concrete parameter class (`parameters: Parameter`) instead of the structural `getChannelWithParameters` stub. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
jonaslagoni
approved these changes
Jul 13, 2026
Contributor
|
🎉 This PR is included in version 0.74.2 🎉 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
When generating a TypeScript HTTP fetch client, the generated context interface discarded the fully-typed parameter class and headers model that are already generated. Instead of the concrete types, it emitted structural stubs:
So a consumer calling
getV2Transactions(context)got no type support oncontext.parameters(the actual query/path params likeskip,take,search,referenceId) orcontext.requestHeaders.Fix
generateContextInterface(inhttp/client.ts) only received ahasParameters: booleanand never saw the concrete class names — even though they were already in hand (channelParameters.type). The headers model wasn't threaded into the renderer at all.channelParameters.type/channelHeaders.typeinto the context interface, mirroring the existing EventSource protocol.http/index.ts→renderHttpFetchClient(addedchannelHeaderstoRenderHttpParameters).Result:
The concrete parameter class still exposes
getChannelWithParameters, sobuildUrlWithParameters(...)in the function body is unaffected. Operations without a typed headers model keep the structural{ marshal: () => string }fallback.Verification
npm run typecheckpasses.test/runtime/typescript/src/request-reply/channels/http_client.ts) — context interfaces now referenceUserItemsParameters/ItemRequestHeaders, matching what theparameters-headers.spec.tsruntime spec already imports and constructs.openapi-http-clientexample:parametersnow resolves to the concrete generated params class.🤖 Generated with Claude Code