File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -140,6 +140,9 @@ struct Operation {
140
140
id : String ,
141
141
/// The name to use for the operation in code.
142
142
name : String ,
143
+ /// Description of the operation to use for documentation.
144
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
145
+ description : Option < String > ,
143
146
/// The HTTP method.
144
147
///
145
148
/// Encoded as "get", "post" or such because that's what aide's PathItem iterator gives us.
@@ -316,6 +319,7 @@ impl Operation {
316
319
let op = Operation {
317
320
id : op_id,
318
321
name : op_name,
322
+ description : op. description ,
319
323
method : method. to_owned ( ) ,
320
324
path : path. to_owned ( ) ,
321
325
path_params,
Original file line number Diff line number Diff line change @@ -49,6 +49,9 @@ impl<'a> {{ resource_type_name }}<'a> {
49
49
{% for op in resource .operations %}
50
50
{% set has_query_params = op .query_params | length > 0 -%}
51
51
{% set has_header_params = op .header_params | length > 0 -%}
52
+ {% if op .description is defined -%}
53
+ #[doc = " {{ op.description }}"]
54
+ {% endif -%}
52
55
pub async fn {{ op.name | to_snake_case }}(
53
56
&self,
54
57
You can’t perform that action at this time.
0 commit comments