-
Notifications
You must be signed in to change notification settings - Fork 215
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
Update axum to 0.6 RC #345
Conversation
Also removes the need to specify `*tail` in the SwaggerUi::new()
routing::get(serve_swagger_ui).layer(Extension(config.clone())), | ||
).route( | ||
&format!("{}*tail", swagger_ui.path), | ||
routing::get(serve_swagger_ui).layer(Extension(config.clone())), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to .clone()
here since it is the last usage, thus it can be moved.
routing::get(serve_swagger_ui).layer(Extension(config.clone())), | |
routing::get(serve_swagger_ui).layer(Extension(config)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall seems solid 👍
Yeah, I agree, I wouldn't merge this yet because axum
hasn't released yet the 0.6
stable and most of users are still using the 0.5
version according to the crates statistics. I'd go with the version has most downloads in crates.
Probably best not to merge this until 0.6 is a stable release, but review would be appreciated
BREAKING
Because of this change in axum 0.6:
... that means that we have to manually specify a second route without
*tail
at the end. So I decided the most reasonable thing would be to make the user remove the*tail
from the URL inSwaggerUi::new()
. Then we can just register the two routes easily by appending*tail
to the end of the second one.