Skip to content

feat: http client context cleanup (rebased onto main)#415

Merged
ALagoni97 merged 1 commit into
mainfrom
feat/http-client-context-cleanup-main
Jul 15, 2026
Merged

feat: http client context cleanup (rebased onto main)#415
ALagoni97 merged 1 commit into
mainfrom
feat/http-client-context-cleanup-main

Conversation

@ALagoni97

Copy link
Copy Markdown
Contributor

Summary

Republishes the HTTP-client cleanup from #411 directly on top of main, decoupled from feat/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*Url work is included.

Ported by taking the base...head delta of #411 and applying it onto main, 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

  • 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 — parameterless operations now bake the path literal (`${config.baseUrl}${requestTopic}`). The escape hatch for gateway rewrites is hooks.beforeRequest.
  • RenamesserverbaseUrl, queryParamsadditionalQueryParams (mirrors additionalHeaders). Fixed 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.

What's explicitly excluded (vs #411's base)

  • hasSerializeUrl context field and serialize${parametersType}Url calls
  • the base branch's buildUrlCode helper (main's inline URL builder is kept)
  • any plain-object parameter model changes

Test plan

  • tsc --noEmit clean
  • npm run lint (eslint + typecheck:test) passes
  • Codegen unit tests: 135 passed, snapshots regenerated (pagination gone; requestHeaders conditional; serializeXxxHeaders import present; no serialize*Url / config.path / config.server)
  • Runtime HTTP client tests: 113 passed against freshly generated client code
  • CI (runs on Node 22 — local runs used avsc 5.7.9 to work around a Node 25 SlowBuffer/oclif manifest incompatibility)

🤖 Generated with Claude Code

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>
@ALagoni97
ALagoni97 requested a review from jonaslagoni as a code owner July 15, 2026 17:11
@vercel

vercel Bot commented Jul 15, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
the-codegen-project Ready Ready Preview, Comment Jul 15, 2026 5:12pm
the-codegen-project-mcp Ready Ready Preview, Comment Jul 15, 2026 5:12pm

@jonaslagoni

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.75.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants