Skip to content

Feature request: Using Axum optional path routes #1485

@sansmoraxz

Description

@sansmoraxz

This actually give wierd macro errors:

#[utoipa::path(
    get,
    path = "/status/{*path}",
    responses(
        (status = OK, description = "Status", body = model::MyResponse),
    )
)]
async fn my_handler(
    State(state): State<SharedState>,
    path: Option<Path<String>>,
) -> Json<model::MyResponse>

Equivalent route registration without the openapi router normally would be like this:-

use axum::Router;

let app = Router::new()
    .route("/status", get(my_handler))
    .route("/status/{*path}", get(my_handler))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions