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

fix(docs): Clarify nested router fallbacks in CHANGELOG.md #1581

Merged
merged 1 commit into from Nov 27, 2022

Conversation

LeoniePhiline
Copy link
Contributor

Motivation

The first subsection of the CHANGELOG.md's axum 0.6 section is somewhat unclear.

Solution

This PR clarifies the explanation of nested routers' fallback routes in the ChangeLog entry for axum 0.6.

@LeoniePhiline LeoniePhiline changed the title fix(docs): Clarify nested outer fallbacks in CHANGELOG.md fix(docs): Clarify nested router fallbacks in CHANGELOG.md Nov 26, 2022
@@ -24,7 +24,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
// this would panic in 0.5 but in 0.6 it just works
//
// requests starting with `/api` but not handled by `api_router`
// will go to `/api_fallback`
// will go to `api_fallback`
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reasoning:

  • api_fallback is a handler, not a path.

@@ -37,7 +37,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

let app = Router::new()
.nest("/api", api_router)
// `api_fallback` will inherit this fallback
// `api_router` will inherit this fallback
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reasoning:

  • api_fallback does not exist here.
  • The Router api_router inherits the app_fallback handler as fallback.

Copy link
Member

@davidpdrsn davidpdrsn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@davidpdrsn davidpdrsn merged commit 28f1996 into tokio-rs:main Nov 27, 2022
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