diff --git a/actix-web-codegen/src/route.rs b/actix-web-codegen/src/route.rs index a5700b423..243f41558 100644 --- a/actix-web-codegen/src/route.rs +++ b/actix-web-codegen/src/route.rs @@ -465,9 +465,13 @@ impl ToTokens for Route { }) .collect(); + let documentation = format!( + "Struct generated by the routing macro for the handler function `{name}`.", + ); + let stream = quote! { #(#doc_attributes)* - #[doc(hidden)] + #[doc = #documentation] #[allow(non_camel_case_types)] #vis struct #name; diff --git a/actix-web/src/response/http_codes.rs b/actix-web/src/response/http_codes.rs index 6be50ee6f..1427ee16a 100644 --- a/actix-web/src/response/http_codes.rs +++ b/actix-web/src/response/http_codes.rs @@ -7,7 +7,7 @@ use crate::{HttpResponse, HttpResponseBuilder}; macro_rules! static_resp { ($name:ident, $status:expr) => { #[allow(non_snake_case)] - #[doc(hidden)] + #[doc = concat!("Creates a new response builder with the status code `", stringify!($status), "`.")] pub fn $name() -> HttpResponseBuilder { HttpResponseBuilder::new($status) }