Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support to define mulitple operation methods #1006

Merged
merged 3 commits into from
Aug 28, 2024

Conversation

juhaku
Copy link
Owner

@juhaku juhaku commented Aug 27, 2024

Add support for defining multiple operation methods to
#[utoipa::path(...)] attribte macro as follows.

 #[utoipa::path(method(head, get), ...)]
 async fn path() {}

Add #[route(...)] macro support for actix-web library.

Enhance utoipa-axum bindings to support multiple operation methods.

Breaking

This commit renames PathItemType to HttpMethod to better describe the
usage. Also this commit removes Connect from the HttpMethod since it is
not supported by OpenAPI specification. https://spec.openapis.org/oas/latest.html#path-item-object

Fixes #827

@juhaku juhaku added the enhancement New feature or request label Aug 27, 2024
@juhaku juhaku force-pushed the feature-add-support-multiple-methods branch 5 times, most recently from 7c10f63 to 53061af Compare August 28, 2024 17:42
Add support for defining mulitple operation methods to
`#[utoipa::path(...)]` attribte macro as follows.
```rust
 #[utoipa::path(method(head, get), ...)]
 async fn path() {}
```

This PR also integrates this support for axum and actix-web frameworks.
Remove `CONNECT` http method from supported path operation types since
it actually is not supported by the OpenAPI specification. Also this
commit renames the `PathItemType` `HttpMethod` to more precisely
describe the use case.
Add `#[route(...)]` macro support for `actix-web` library.
@juhaku juhaku force-pushed the feature-add-support-multiple-methods branch from 53061af to e813ff3 Compare August 28, 2024 17:45
@juhaku juhaku marked this pull request as ready for review August 28, 2024 17:54
@juhaku juhaku merged commit 69dfbbc into master Aug 28, 2024
18 checks passed
@juhaku juhaku deleted the feature-add-support-multiple-methods branch August 28, 2024 20:29
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

How to define multiple methods (GET/HEAD/OPTIONS) for same method
1 participant