feat: http client context cleanup (rebased onto main)#415
Merged
Conversation
Republishes the HTTP-client cleanup from #411 directly on top of main, decoupled from the plain-object parameter refactor it was originally based on. Only the HTTP-client changes are included; no parameter serializer / plain-object-parameter work is carried over. - Remove pagination: the client-side PaginationInfo/applyPagination/ extractPaginationInfo stack was spec-unaware invention that appended offset/limit/cursor params shadowing the typed parameters. Deleted entirely (including the runtime spec). A spec-derived approach is deferred. - Remove `path` from context: parameterized operations already baked the path literal and ignored config.path; parameterless operations now bake the literal too (`${config.baseUrl}${requestTopic}`). The escape hatch for gateway rewrites is hooks.beforeRequest. - Renames: server → baseUrl, queryParams → additionalQueryParams (mirrors additionalHeaders). Fix scheme-less default localhost:3000 → http://localhost:3000. - Conditional requestHeaders: emitted only when the spec defines operation-level headers; operations without them get a plain Content-Type header init. - Plain-object OpenAPI header models: interfaces instead of marshallable classes, plus a standalone serializeXxxHeaders() function imported and called by the generated channel function. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
🎉 This PR is included in version 0.75.0 🎉 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.
Summary
Republishes the HTTP-client cleanup from #411 directly on top of
main, decoupled fromfeat/plain-object-openapi-parameters(#409) which it was originally based on. That base branch may not land, and the parameter direction appears to be shifting toward the companion-interface approach (#413), so this PR carries only the HTTP-client changes — no plain-object-parameter /serialize*Urlwork is included.Ported by taking the
base...headdelta of #411 and applying it ontomain, re-implementing the few hunks that were entangled with the parameter refactor (buildUrlCode/serialize${type}Url) against main's existing inline URL-building structure. All snapshots were regenerated from the ported generator.What's included
PaginationInfo/applyPagination/extractPaginationInfostack was spec-unaware invention that appendedoffset/limit/cursorparams shadowing the typedparameters. Deleted entirely (including the runtime spec). A spec-derived approach is deferred.pathfrom context — parameterless operations now bake the path literal (`${config.baseUrl}${requestTopic}`). The escape hatch for gateway rewrites ishooks.beforeRequest.server→baseUrl,queryParams→additionalQueryParams(mirrorsadditionalHeaders). Fixed scheme-less default'localhost:3000'→'http://localhost:3000'.requestHeaders— emitted only when the spec defines operation-level headers; operations without them get a plainContent-Typeheader init.serializeXxxHeaders()function imported and called by the generated channel function.What's explicitly excluded (vs #411's base)
hasSerializeUrlcontext field andserialize${parametersType}UrlcallsbuildUrlCodehelper (main's inline URL builder is kept)Test plan
tsc --noEmitcleannpm run lint(eslint +typecheck:test) passesrequestHeadersconditional;serializeXxxHeadersimport present; noserialize*Url/config.path/config.server)SlowBuffer/oclif manifestincompatibility)🤖 Generated with Claude Code