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

Update axum to 0.6 RC #345

Closed
wants to merge 6 commits into from
Closed

Update axum to 0.6 RC #345

wants to merge 6 commits into from

Conversation

BBaoVanC
Copy link

@BBaoVanC BBaoVanC commented Nov 11, 2022

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:

breaking: The request /foo/ no longer matches /foo/*rest. If you want
to match /foo/ you have to add a route specifically for that (#1086)

... 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 in SwaggerUi::new(). Then we can just register the two routes easily by appending *tail to the end of the second one.

@BBaoVanC BBaoVanC marked this pull request as ready for review November 12, 2022 03:29
routing::get(serve_swagger_ui).layer(Extension(config.clone())),
).route(
&format!("{}*tail", swagger_ui.path),
routing::get(serve_swagger_ui).layer(Extension(config.clone())),
Copy link
Owner

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.

Suggested change
routing::get(serve_swagger_ui).layer(Extension(config.clone())),
routing::get(serve_swagger_ui).layer(Extension(config)),

Copy link
Owner

@juhaku juhaku left a 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.

@juhaku juhaku mentioned this pull request Nov 25, 2022
@juhaku juhaku closed this in #369 Nov 25, 2022
@BBaoVanC BBaoVanC deleted the axum-0.6 branch November 28, 2022 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants