Skip to main content

axum_to_openapi_path

Function axum_to_openapi_path 

Source
pub fn axum_to_openapi_path(path: &str) -> String
Expand description

Convert Axum 0.8+ style path parameters to OpenAPI-style placeholders.

Removes the asterisk prefix from Axum wildcards {*path} to make them OpenAPI-compatible {path}.

ยงExamples

assert_eq!(axum_to_openapi_path("/users/{id}"), "/users/{id}");
assert_eq!(axum_to_openapi_path("/static/{*path}"), "/static/{path}");