From a67b26d108a13fd6076dec31db10984c15baa5a5 Mon Sep 17 00:00:00 2001 From: AraMinjibir Date: Wed, 22 Jul 2026 10:17:54 +0100 Subject: [PATCH] docs(web): clarify scope route matching --- actix-web/src/scope.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/actix-web/src/scope.rs b/actix-web/src/scope.rs index 560a66b8e..b3f37fb2f 100644 --- a/actix-web/src/scope.rs +++ b/actix-web/src/scope.rs @@ -30,6 +30,19 @@ type Guards = Vec>; /// requests using the [`Path`](crate::web::Path) extractor or /// with [`HttpRequest::match_info()`](crate::HttpRequest::match_info). /// +/// # Route Matching +/// +/// Scopes are matched independently during routing. Once a request matches a +/// scope's path prefix, routing continues only within that scope. If no route +/// inside the matched scope can handle the request, Actix Web does not continue +/// searching sibling scopes or services. +/// +/// Consequently, overlapping scopes do not behave the same as an equivalent +/// flat route structure. +/// +/// If your goal is to organize routes into separate modules without changing +/// routing behavior, consider using `App::configure` or `Scope::configure`. +/// /// # Avoid Trailing Slashes /// Avoid using trailing slashes in the scope prefix (e.g., `web::scope("/scope/")`). It will almost /// certainly not have the expected behavior. See the [documentation on resource definitions][pat]