Skip to content

feat: blocking reqwest client generator - #20

Merged
dotkas merged 2 commits into
mainfrom
dotkas/reqwest-generator
Jul 7, 2026
Merged

feat: blocking reqwest client generator#20
dotkas merged 2 commits into
mainfrom
dotkas/reqwest-generator

Conversation

@dotkas

@dotkas dotkas commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings July 7, 2026 17:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new code generation mode to oapi-codegen that emits a blocking reqwest client from the same lowered Service IR used by the axum server generator, along with new fixtures/snapshot outputs and coverage harness updates to validate the generated client output.

Changes:

  • Introduces a new generate.client config knob and wires it through CLI/config plumbing to emit a blocking reqwest client.
  • Adds a new emit/reqwest.rs client emitter (typed responses, per-op methods, and an operation-shape rejection gate).
  • Extends the test/coverage framework with client fixtures, a committed generated client snapshot, and compile/runtime checks.

Reviewed changes

Copilot reviewed 14 out of 16 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
README.md Documents the new generate.client knob, supported/rejected shapes, and dependency requirements.
crates/oapi-codegen/tests/generated/client_widgets.rs New committed snapshot of generated client+models output for the client_widgets fixture.
crates/oapi-codegen/tests/generated_compiles.rs Includes the new generated client snapshot for compile-checking and adds a small runtime smoke test.
crates/oapi-codegen/tests/fixtures/client_widgets.yaml New supported fixture exercising client params, bodies, and responses.
crates/oapi-codegen/tests/fixtures/client_unsupported_negotiated_response.yaml New unsupported fixture for negotiated responses.
crates/oapi-codegen/tests/fixtures/client_unsupported_negotiated_request.yaml New unsupported fixture for negotiated requests.
crates/oapi-codegen/tests/fixtures/client_unsupported_multipart_request.yaml New unsupported fixture for multipart request bodies.
crates/oapi-codegen/tests/fixtures/client_unsupported_form_response.yaml New unsupported fixture for form response bodies.
crates/oapi-codegen/tests/coverage.rs Adds client fixture catalogs and snapshot/unsupported rejection checks; updates compile-check coverage.
crates/oapi-codegen/src/main.rs Updates “nothing to generate” guard to include generate.client.
crates/oapi-codegen/src/lib.rs Wires generate.client into the main generation pipeline and ensures models are emitted when client/server is requested.
crates/oapi-codegen/src/emit/reqwest.rs New blocking reqwest client emitter implementation.
crates/oapi-codegen/src/emit/mod.rs Adds ClientEmitter trait and emit_with_client entrypoint.
crates/oapi-codegen/src/config.rs Adds Generate::client configuration field.
crates/oapi-codegen/Cargo.toml Adds reqwest as a dev-dependency to type-check generated client code.
Cargo.lock Locks new transitive deps from reqwest.

Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread crates/oapi-codegen/tests/generated_compiles.rs
@dotkas
dotkas enabled auto-merge (squash) July 7, 2026 18:08
@dotkas
dotkas merged commit 48ec56b into main Jul 7, 2026
5 checks passed
@dotkas
dotkas deleted the dotkas/reqwest-generator branch July 7, 2026 18:09
@dotkas dotkas removed the released label Jul 16, 2026
@alchemaxinc alchemaxinc deleted a comment from alchemax-housekeeper Bot Jul 16, 2026
@alchemax-housekeeper

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 1.0.0-dev.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@alchemax-housekeeper

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 1.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants