We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I have an endpoint (/health) that accepts GET,HEAD,OPTIONS, this compiles but only uses the last one (HEAD):
#[utoipa::path( get, path= "/health", responses ( (status = 200, description = "Database connection is healthy", body = [Health]), (status = 503, description = "Database connection is unhealthy", body = [Health]) ), head, path= "/health", responses ( (status = 200, description = "Database connection is healthy"), (status = 503, description = "Database connection is unhealthy") ) )] // axum handler for health #[instrument] pub async fn health(method: Method, pool: Extension<PgPool>) -> impl IntoResponse { debug!(method = ?method, "HTTP request method: {}", method); ...
How could I manage this without duplicating the method fn health_get, fn health_head, fn health_options?
fn health_get
fn health_head
fn health_options
The text was updated successfully, but these errors were encountered:
I'd like to see this too.
Example handler that handles both GET and HEAD for actix:
#[route("/track", method = "GET", method = "HEAD")] pub async fn track_endpoint( req: HttpRequest, query: web::Query<GetTrackQuery>, api_state: web::Data<MusicApiState>, ) -> Result<HttpResponse> { ...
Sorry, something went wrong.
Good idea. Let's evaluate possibilities and see if this can be added.
69dfbbc
Successfully merging a pull request may close this issue.
I have an endpoint (/health) that accepts GET,HEAD,OPTIONS, this compiles but only uses the last one (HEAD):
How could I manage this without duplicating the method
fn health_get
,fn health_head
,fn health_options
?The text was updated successfully, but these errors were encountered: