Skip to content

feat: emit server and client together - #30

Merged
dotkas merged 3 commits into
mainfrom
dotkas/random-polish-pt2
Jul 15, 2026
Merged

feat: emit server and client together#30
dotkas merged 3 commits into
mainfrom
dotkas/random-polish-pt2

Conversation

@dotkas

@dotkas dotkas commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings July 14, 2026 14:09

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

Adds support for emitting both the axum server and blocking reqwest client in a single generated output by namespacing them into server/client submodules while keeping shared models at the crate root. This expands generator coverage with a combined fixture and compile-checks, and also improves client URL path-parameter encoding for String parameters.

Changes:

  • Emit server + client together via emit_with_service_and_client, producing pub mod server { … } and pub mod client { … } with shared root-level models.
  • Add a combined server+client fixture and golden output, plus coverage + compile-check wiring.
  • Optimize reqwest client path-param encoding to avoid String::to_string() when the parameter is already a String.

Reviewed changes

Copilot reviewed 8 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
crates/oapi-codegen/src/lib.rs Generates service once when either server/client is enabled; routes to combined emission when both are set.
crates/oapi-codegen/src/lower/prune.rs Adds references_models() to decide whether submodules need use super::*;.
crates/oapi-codegen/src/lower/mod.rs Re-exports references_models() from lower.
crates/oapi-codegen/src/emit/mod.rs Implements combined emission with submodule wrapping + indentation/render helpers.
crates/oapi-codegen/src/emit/reqwest.rs Adjusts URL building to use as_str() for String path params (but currently introduces a compile issue; see PR comment).
crates/oapi-codegen/tests/fixtures/combined_server_client.yaml New fixture spec used to exercise combined emission.
crates/oapi-codegen/tests/generated/combined_server_client.rs New committed golden output for combined server+client generation.
crates/oapi-codegen/tests/coverage.rs Adds COMBINED_FIXTURES plus drift-guard tests and includes combined fixtures in compile-check expectations.
crates/oapi-codegen/tests/generated_compiles.rs Includes the new combined golden file to ensure it type-checks.
crates/oapi-codegen/tests/generated/client_widgets.rs Updates generated client code to use as_str() in path encoding for widget routes.

Comment thread crates/oapi-codegen/src/emit/reqwest.rs
Copilot AI review requested due to automatic review settings July 14, 2026 14:25

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

Copilot reviewed 9 out of 11 changed files in this pull request and generated 2 comments.

Comment thread crates/oapi-codegen/src/lower/prune.rs
Comment thread crates/oapi-codegen/src/lower/mod.rs
Copilot AI review requested due to automatic review settings July 14, 2026 15:02

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

Copilot reviewed 9 out of 11 changed files in this pull request and generated no new comments.

@dotkas
dotkas merged commit 251cedf into main Jul 15, 2026
6 checks passed
@dotkas
dotkas deleted the dotkas/random-polish-pt2 branch July 15, 2026 12:12
@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