Skip to content

feat: query parameters support - #5

Merged
dotkas merged 3 commits into
mainfrom
dotkas/query-header-params
Jun 30, 2026
Merged

feat: query parameters support#5
dotkas merged 3 commits into
mainfrom
dotkas/query-header-params

Conversation

@dotkas

@dotkas dotkas commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@dotkas
dotkas force-pushed the dotkas/query-header-params branch from 7153100 to 285c201 Compare June 29, 2026 07:05
@dotkas
dotkas requested a review from Copilot June 29, 2026 07:08

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 server-side query parameter support to the oapi-codegen-rust axum server generator by lowering OpenAPI query params into per-operation structs and wiring them through axum_extra::extract::Query.

Changes:

  • Lower query parameters into an IR Struct (Operation.query) and emit it plus the corresponding axum extractor in generated handlers.
  • Extend the bookstore example and README to demonstrate query parameters, including adding axum-extra as a dependency.
  • Add generation fixtures and compile tests to cover supported query params and ensure unsupported shapes fail generation.

Reviewed changes

Copilot reviewed 12 out of 15 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
README.md Documents new query-parameter support and the axum-extra dependency requirement.
examples/bookstore/tests/smoke.rs Implements the new list_books API method consuming generated query struct.
examples/bookstore/openapi.yaml Adds a GET /books operation with query parameters to exercise generation end-to-end.
examples/bookstore/generated/restapi.rs Regenerates server code: query struct, trait signature change, new handler + route.
examples/bookstore/Cargo.toml Adds axum-extra dependency needed by generated query extractor usage.
crates/oapi-codegen/tests/generated/server_query_params.rs New golden generated output covering query param structs + handler extractor.
crates/oapi-codegen/tests/generated_compiles.rs Adds a compile test ensuring generated query extractor type-checks.
crates/oapi-codegen/tests/fixtures/server_unsupported_object_query_param.yaml New fixture asserting object-shaped query params are rejected.
crates/oapi-codegen/tests/fixtures/server_query_params.yaml New fixture asserting scalar/array/required query params are supported.
crates/oapi-codegen/tests/coverage.rs Extends coverage matrix to include query-param server fixture(s).
crates/oapi-codegen/src/paths.rs Implements query-param lowering and scalar/array validation logic.
crates/oapi-codegen/src/ir.rs Adds Operation.query: Option<Struct> to carry query struct through IR.
crates/oapi-codegen/src/emit.rs Emits query structs and injects axum_extra::extract::Query extractor + method arg.
crates/oapi-codegen/Cargo.toml Adds axum-extra as a dev-dependency for generated server compilation tests.
Cargo.lock Locks new transitive deps from adding axum-extra.

Comment thread crates/oapi-codegen/src/paths.rs
Comment thread crates/oapi-codegen/src/paths.rs

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 12 out of 15 changed files in this pull request and generated 2 comments.

Comment thread README.md Outdated
Comment thread README.md

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 13 out of 16 changed files in this pull request and generated no new comments.

@dotkas
dotkas merged commit 6530c4e into main Jun 30, 2026
6 checks passed
@dotkas
dotkas deleted the dotkas/query-header-params branch June 30, 2026 07: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