1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-06-26 06:57:43 +02:00

add url_for test for conflicting named resources

This commit is contained in:
Rob Ede
2022-01-20 01:25:46 +00:00
parent 81ef12a0fd
commit f2e736719a
5 changed files with 139 additions and 19 deletions

View File

@ -39,7 +39,7 @@
//! ```
//! # use actix_web::HttpResponse;
//! # use actix_web_codegen::route;
//! #[route("/test", method="GET", method="HEAD")]
//! #[route("/test", method = "GET", method = "HEAD")]
//! async fn get_and_head_handler() -> HttpResponse {
//! HttpResponse::Ok().finish()
//! }
@ -74,10 +74,12 @@ mod route;
///
/// # Attributes
/// - `"path"` - Raw literal string with path for which to register handler.
/// - `name="resource_name"` - Specifies resource name for the handler. If not set, the function name of handler is used.
/// - `method="HTTP_METHOD"` - Registers HTTP method to provide guard for. Upper-case string, "GET", "POST" for example.
/// - `guard="function_name"` - Registers function as guard using `actix_web::guard::fn_guard`
/// - `wrap="Middleware"` - Registers a resource middleware.
/// - `name = "resource_name"` - Specifies resource name for the handler. If not set, the function
/// name of handler is used.
/// - `method = "HTTP_METHOD"` - Registers HTTP method to provide guard for. Upper-case string,
/// "GET", "POST" for example.
/// - `guard = "function_name"` - Registers function as guard using `actix_web::guard::fn_guard`
/// - `wrap = "Middleware"` - Registers a resource middleware.
///
/// # Notes
/// Function name can be specified as any expression that is going to be accessible to the generate