Skip to content

feat(client): accept preconfigured reqwest clients (#99) - #100

Merged
lightsofapollo merged 1 commit into
mainfrom
feat/custom-reqwest-client
Oct 6, 2026
Merged

lightsofapollo merged 1 commit into
mainfrom
feat/custom-reqwest-client

Conversation

@lightsofapollo

Copy link
Copy Markdown
Contributor

Generated HTTP clients currently create their own reqwest transport, preventing callers from supplying TLS identities, trusted roots, proxy settings, or other client configuration. Add HttpClient::with_client(reqwest::Client) and, when middleware configuration is generated, with_client_and_config(client, ...) so HTTP and SSE requests use a caller-provided transport through the existing middleware stack.

Existing new(), Default, and with_config(...) signatures and defaults are preserved. Operations whose Rust names collide with the new constructors receive the existing numeric suffix; this is the only generated API compatibility caveat. No new runtime dependencies or configuration migrations are required.

Closes #99.

Validation:

  • 720 all-feature nextest tests passed (7 skipped), plus doctests.
  • Formatting, Clippy with warnings denied, and rustdoc with warnings denied passed.
  • Generated runtime coverage exercises all four retry/tracing combinations, custom transport headers on HTTP and SSE requests, retry defaults and explicit retries, response limits, and operation-name collisions.
  • Generated native and WASM client compilation passed.
  • Anthropic and OpenAI compilation and schema round trips passed: 4,984 samples across 1,333 component schemas.
  • All 56 corpus diffs contain the same constructor-only change in client.rs; models and dependency files are unchanged. The corpus manifest was refreshed and verified.

@vercel

vercel Bot commented Oct 6, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated
openapi-to-rust Ready Ready Preview Oct 6, 2026 12:11am UTC

Request Review

@lightsofapollo
lightsofapollo merged commit bfebb81 into main Oct 6, 2026

This branch was successfully deployed

1 active deployment
Preview — 0d13dc23 Deployed Oct 5, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feature]: Ability to provide custom reqwest::Client to generated HttpClient

1 participant