feat: http client context cleanup#411
Merged
jonaslagoni merged 6 commits intoJul 14, 2026
Merged
Conversation
Deletes PaginationInfo, PaginationConfig and all pagination subtypes, applyPagination, extractPaginationInfo, parseLinkHeader, and createPaginationHelpers from the runtime template. Removes pagination fields from HttpClientResponse and HttpClientContext. Deletes the pagination runtime spec and strips pagination sections from docs. The current pagination was client-side invention (offset/limit/cursor params not derived from the spec) — a future spec-derived implementation is deferred; see thoughts/2026-07-14-http-client-context-cleanup/plan.md.
path was half-broken: parameterized operations already baked the path
literal into buildUrlWithParameters and silently ignored config.path;
only parameterless operations respected it. Now parameterless ops also
bake the literal path at generation time (e.g. `${config.server}/ping`).
The escape hatch for gateway rewrites is hooks.beforeRequest mutating
params.url, as documented.
Renames mirror the additionalHeaders convention: additionalQueryParams makes clear it is an escape hatch for params not in the spec, not a replacement for typed parameters. baseUrl is unambiguous vs the old server field. Also fixes the scheme-less default 'localhost:3000' → 'http://localhost:3000' so generated code works out of the box without a CORS or fetch failure.
3a: Emit requestHeaders in context interface only when the spec defines operation-level headers; operations with no spec headers get a plain headersInit instead of the applyTypedHeaders branch. 3b: OpenAPI header models are now generated as plain interfaces (no marshal/unmarshal/validate) with a standalone serializeXxxHeaders() function. The channels generator imports and calls that function when hasSerializeHeaders is true.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
….com/the-codegen-project/cli into feat/http-client-context-cleanup
Remove three pagination test cases missed from methods.spec.ts, hooks.spec.ts, and basics.spec.ts when pagination.spec.ts was deleted. Refactor generateTypescriptHeadersCore into three extracted helpers (createAsyncAPIHeadersGenerator, appendOpenAPISerializerFunctions, deduplicateFiles) to bring cognitive complexity within the lint limit. Also fix pre-existing TypescryptHeadersContext typo → TypescriptHeadersContext.
jonaslagoni
approved these changes
Jul 14, 2026
5a5d1b2
into
feat/plain-object-openapi-parameters
16 checks passed
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.
Summary
PaginationInfo/applyPagination/extractPaginationInfostack was spec-unaware invention; it appendedoffset/limit/cursorparams that shadow the typedparametersthe spec actually defines. Deleted entirely (including the runtime spec file). A future spec-derived approach is deferred.pathfrom context — half-broken: parameterized operations silently ignoredconfig.pathand the legitimate escape hatch ishooks.beforeRequest. Parameterless operations now bake the path literal directly into`${config.baseUrl}${requestTopic}`.server→baseUrl,queryParams→additionalQueryParams(mirrorsadditionalHeaders). Fixed scheme-less default'localhost:3000'→'http://localhost:3000'.requestHeaders— the field is now emitted only when the spec defines operation-level headers. Operations with no spec headers get a plainContent-Typeheader init instead of the fallbackapplyTypedHeadersbranch.serializeXxxHeaders()function imported and called by the generated channel function.Test plan
npm test)npm run build){ marshal: () => string }are gone;FindPetsByStatusAndCategoryContextgainsrequestHeaders?: FindPetsByStatusAndCategoryHeadersand the serializer import🤖 Generated with Claude Code