Skip to content

Commit 98b315c

Browse files
authored
Qualify rust trait template comments (#21527)
1 parent a809c18 commit 98b315c

File tree

6 files changed

+44
-44
lines changed

6 files changed

+44
-44
lines changed

modules/openapi-generator/src/main/resources/rust/reqwest-trait/api.mustache

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ pub trait {{{classname}}}: Send + Sync {
2626
/// {{{notes}}}
2727
{{/notes.empty}}
2828
{{#vendorExtensions.x-group-parameters}}
29-
async fn {{{operationId}}}(&self, {{#allParams}}{{#-first}} params: {{{operationIdCamelCase}}}Params {{/-first}}{{/allParams}}{{!
29+
async fn {{{operationId}}}(&self, {{#allParams}}{{#-first}} params: {{{operationIdCamelCase}}}Params {{/-first}}{{/allParams}}{{!
3030
### Function return type
3131
}}) -> Result<{{!
3232
### Multi response support
33-
}}{{#supportMultipleResponses}}ResponseContent<{{{operationIdCamelCase}}}Success>{{/supportMultipleResponses}}{{!
33+
}}{{#supportMultipleResponses}}ResponseContent<{{{operationIdCamelCase}}}Success>{{/supportMultipleResponses}}{{!
3434
### Regular return type
3535
}}{{^supportMultipleResponses}}{{^returnType}}(){{/returnType}}{{{returnType}}}{{/supportMultipleResponses}}{{!
3636
### Error Type
@@ -39,27 +39,27 @@ pub trait {{{classname}}}: Send + Sync {
3939
{{^vendorExtensions.x-group-parameters}}
4040
async fn {{{operationId}}}{{!
4141
### Lifetimes
42-
}}<{{#allParams}}'{{#lambda.lifetimeName}}{{{paramName}}}{{/lambda.lifetimeName}}{{^-last}}, {{/-last}}{{/allParams}}>{{!
42+
}}<{{#allParams}}'{{#lambda.lifetimeName}}{{{paramName}}}{{/lambda.lifetimeName}}{{^-last}}, {{/-last}}{{/allParams}}>{{!
4343
### Function parameter names
44-
}}(&self, {{#allParams}}{{{paramName}}}: {{!
44+
}}(&self, {{#allParams}}{{{paramName}}}: {{!
4545
### Option Start
46-
}}{{^required}}Option<{{/required}}{{#required}}{{#isNullable}}Option<{{/isNullable}}{{/required}}{{!
46+
}}{{^required}}Option<{{/required}}{{#required}}{{#isNullable}}Option<{{/isNullable}}{{/required}}{{!
4747
### &str and Vec<&str>
48-
}}{{#isString}}{{#isArray}}Vec<{{/isArray}}{{^isUuid}}&'{{#lambda.lifetimeName}}{{{paramName}}}{{/lambda.lifetimeName}} str{{/isUuid}}{{#isArray}}>{{/isArray}}{{/isString}}{{!
48+
}}{{#isString}}{{#isArray}}Vec<{{/isArray}}{{^isUuid}}&'{{#lambda.lifetimeName}}{{{paramName}}}{{/lambda.lifetimeName}} str{{/isUuid}}{{#isArray}}>{{/isArray}}{{/isString}}{{!
4949
### UUIDs
50-
}}{{#isUuid}}{{#isArray}}Vec<{{/isArray}}&str{{#isArray}}>{{/isArray}}{{/isUuid}}{{!
50+
}}{{#isUuid}}{{#isArray}}Vec<{{/isArray}}&str{{#isArray}}>{{/isArray}}{{/isUuid}}{{!
5151
### Models and primative types
52-
}}{{^isString}}{{^isUuid}}{{^isPrimitiveType}}{{^isContainer}}models::{{/isContainer}}{{/isPrimitiveType}}{{{dataType}}}{{/isUuid}}{{/isString}}{{!
52+
}}{{^isString}}{{^isUuid}}{{^isPrimitiveType}}{{^isContainer}}models::{{/isContainer}}{{/isPrimitiveType}}{{{dataType}}}{{/isUuid}}{{/isString}}{{!
5353
### Option End
54-
}}{{^required}}>{{/required}}{{#required}}{{#isNullable}}>{{/isNullable}}{{/required}}{{!
54+
}}{{^required}}>{{/required}}{{#required}}{{#isNullable}}>{{/isNullable}}{{/required}}{{!
5555
### Comma for next arguement
5656
}}{{^-last}}, {{/-last}}{{/allParams}}{{!
5757
### Function return type
58-
}}) -> Result<{{!
58+
}}) -> Result<{{!
5959
### Multi response support
60-
}}{{#supportMultipleResponses}}ResponseContent<{{{operationIdCamelCase}}}Success>{{/supportMultipleResponses}}{{!
60+
}}{{#supportMultipleResponses}}ResponseContent<{{{operationIdCamelCase}}}Success>{{/supportMultipleResponses}}{{!
6161
### Regular return type
62-
}}{{^supportMultipleResponses}}{{^returnType}}(){{/returnType}}{{{returnType}}}{{/supportMultipleResponses}}{{!
62+
}}{{^supportMultipleResponses}}{{^returnType}}(){{/returnType}}{{{returnType}}}{{/supportMultipleResponses}}{{!
6363
### Error Type
6464
}}, Error<{{{operationIdCamelCase}}}Error>>;
6565
{{/vendorExtensions.x-group-parameters}}
@@ -83,7 +83,7 @@ impl {{classname}}Client {
8383
{{#vendorExtensions.x-group-parameters}}
8484
{{#allParams}}
8585
{{#-first}}
86-
/// struct for passing parameters to the method [`{{operationId}}`]
86+
/// struct for passing parameters to the method [`{{{classname}}}::{{operationId}}`]
8787
#[derive(Clone, Debug)]
8888
{{#useBonBuilder}}
8989
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
@@ -149,7 +149,7 @@ impl {{classname}} for {{classname}}Client {
149149
### Lifetimes
150150
}}<{{#allParams}}'{{#lambda.lifetimeName}}{{{paramName}}}{{/lambda.lifetimeName}}{{^-last}}, {{/-last}}{{/allParams}}>{{!
151151
### Function parameter names
152-
}}(&self, {{#allParams}}{{{paramName}}}: {{!
152+
}}(&self, {{#allParams}}{{{paramName}}}: {{!
153153
### Option Start
154154
}}{{^required}}Option<{{/required}}{{#required}}{{#isNullable}}Option<{{/isNullable}}{{/required}}{{!
155155
### &str and Vec<&str>
@@ -161,9 +161,9 @@ impl {{classname}} for {{classname}}Client {
161161
### Option End
162162
}}{{^required}}>{{/required}}{{#required}}{{#isNullable}}>{{/isNullable}}{{/required}}{{!
163163
### Comma for next arguement
164-
}}{{^-last}}, {{/-last}}{{/allParams}}{{!
164+
}}{{^-last}}, {{/-last}}{{/allParams}}{{!
165165
### Function return type
166-
}}) -> Result<{{!
166+
}}) -> Result<{{!
167167
### Multi response support
168168
}}{{#supportMultipleResponses}}ResponseContent<{{{operationIdCamelCase}}}Success>{{/supportMultipleResponses}}{{!
169169
### Regular return type
@@ -516,7 +516,7 @@ impl {{classname}} for {{classname}}Client {
516516
{{#supportMultipleResponses}}
517517
{{#operations}}
518518
{{#operation}}
519-
/// struct for typed successes of method [`{{operationId}}`]
519+
/// struct for typed successes of method [`{{{classname}}}::{{operationId}}`]
520520
#[derive(Debug, Clone, Serialize, Deserialize)]
521521
#[serde(untagged)]
522522
pub enum {{{operationIdCamelCase}}}Success {
@@ -536,7 +536,7 @@ pub enum {{{operationIdCamelCase}}}Success {
536536
{{/supportMultipleResponses}}
537537
{{#operations}}
538538
{{#operation}}
539-
/// struct for typed errors of method [`{{operationId}}`]
539+
/// struct for typed errors of method [`{{{classname}}}::{{operationId}}`]
540540
#[derive(Debug, Clone, Serialize, Deserialize)]
541541
#[serde(untagged)]
542542
pub enum {{{operationIdCamelCase}}}Error {

samples/client/petstore/rust/reqwest-trait/petstore/src/apis/fake_api.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ impl FakeApi for FakeApiClient {
8282

8383
}
8484

85-
/// struct for typed errors of method [`test_nullable_required_param`]
85+
/// struct for typed errors of method [`FakeApi::test_nullable_required_param`]
8686
#[derive(Debug, Clone, Serialize, Deserialize)]
8787
#[serde(untagged)]
8888
pub enum TestNullableRequiredParamError {

samples/client/petstore/rust/reqwest-trait/petstore/src/apis/pet_api.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -511,39 +511,39 @@ impl PetApi for PetApiClient {
511511

512512
}
513513

514-
/// struct for typed errors of method [`add_pet`]
514+
/// struct for typed errors of method [`PetApi::add_pet`]
515515
#[derive(Debug, Clone, Serialize, Deserialize)]
516516
#[serde(untagged)]
517517
pub enum AddPetError {
518518
Status405(),
519519
UnknownValue(serde_json::Value),
520520
}
521521

522-
/// struct for typed errors of method [`delete_pet`]
522+
/// struct for typed errors of method [`PetApi::delete_pet`]
523523
#[derive(Debug, Clone, Serialize, Deserialize)]
524524
#[serde(untagged)]
525525
pub enum DeletePetError {
526526
Status400(),
527527
UnknownValue(serde_json::Value),
528528
}
529529

530-
/// struct for typed errors of method [`find_pets_by_status`]
530+
/// struct for typed errors of method [`PetApi::find_pets_by_status`]
531531
#[derive(Debug, Clone, Serialize, Deserialize)]
532532
#[serde(untagged)]
533533
pub enum FindPetsByStatusError {
534534
Status400(),
535535
UnknownValue(serde_json::Value),
536536
}
537537

538-
/// struct for typed errors of method [`find_pets_by_tags`]
538+
/// struct for typed errors of method [`PetApi::find_pets_by_tags`]
539539
#[derive(Debug, Clone, Serialize, Deserialize)]
540540
#[serde(untagged)]
541541
pub enum FindPetsByTagsError {
542542
Status400(),
543543
UnknownValue(serde_json::Value),
544544
}
545545

546-
/// struct for typed errors of method [`get_pet_by_id`]
546+
/// struct for typed errors of method [`PetApi::get_pet_by_id`]
547547
#[derive(Debug, Clone, Serialize, Deserialize)]
548548
#[serde(untagged)]
549549
pub enum GetPetByIdError {
@@ -552,23 +552,23 @@ pub enum GetPetByIdError {
552552
UnknownValue(serde_json::Value),
553553
}
554554

555-
/// struct for typed errors of method [`pets_explode_post`]
555+
/// struct for typed errors of method [`PetApi::pets_explode_post`]
556556
#[derive(Debug, Clone, Serialize, Deserialize)]
557557
#[serde(untagged)]
558558
pub enum PetsExplodePostError {
559559
Status400(),
560560
UnknownValue(serde_json::Value),
561561
}
562562

563-
/// struct for typed errors of method [`pets_post`]
563+
/// struct for typed errors of method [`PetApi::pets_post`]
564564
#[derive(Debug, Clone, Serialize, Deserialize)]
565565
#[serde(untagged)]
566566
pub enum PetsPostError {
567567
Status400(),
568568
UnknownValue(serde_json::Value),
569569
}
570570

571-
/// struct for typed errors of method [`update_pet`]
571+
/// struct for typed errors of method [`PetApi::update_pet`]
572572
#[derive(Debug, Clone, Serialize, Deserialize)]
573573
#[serde(untagged)]
574574
pub enum UpdatePetError {
@@ -578,15 +578,15 @@ pub enum UpdatePetError {
578578
UnknownValue(serde_json::Value),
579579
}
580580

581-
/// struct for typed errors of method [`update_pet_with_form`]
581+
/// struct for typed errors of method [`PetApi::update_pet_with_form`]
582582
#[derive(Debug, Clone, Serialize, Deserialize)]
583583
#[serde(untagged)]
584584
pub enum UpdatePetWithFormError {
585585
Status405(),
586586
UnknownValue(serde_json::Value),
587587
}
588588

589-
/// struct for typed errors of method [`upload_file`]
589+
/// struct for typed errors of method [`PetApi::upload_file`]
590590
#[derive(Debug, Clone, Serialize, Deserialize)]
591591
#[serde(untagged)]
592592
pub enum UploadFileError {

samples/client/petstore/rust/reqwest-trait/petstore/src/apis/store_api.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ impl StoreApi for StoreApiClient {
209209

210210
}
211211

212-
/// struct for typed errors of method [`delete_order`]
212+
/// struct for typed errors of method [`StoreApi::delete_order`]
213213
#[derive(Debug, Clone, Serialize, Deserialize)]
214214
#[serde(untagged)]
215215
pub enum DeleteOrderError {
@@ -218,14 +218,14 @@ pub enum DeleteOrderError {
218218
UnknownValue(serde_json::Value),
219219
}
220220

221-
/// struct for typed errors of method [`get_inventory`]
221+
/// struct for typed errors of method [`StoreApi::get_inventory`]
222222
#[derive(Debug, Clone, Serialize, Deserialize)]
223223
#[serde(untagged)]
224224
pub enum GetInventoryError {
225225
UnknownValue(serde_json::Value),
226226
}
227227

228-
/// struct for typed errors of method [`get_order_by_id`]
228+
/// struct for typed errors of method [`StoreApi::get_order_by_id`]
229229
#[derive(Debug, Clone, Serialize, Deserialize)]
230230
#[serde(untagged)]
231231
pub enum GetOrderByIdError {
@@ -234,7 +234,7 @@ pub enum GetOrderByIdError {
234234
UnknownValue(serde_json::Value),
235235
}
236236

237-
/// struct for typed errors of method [`place_order`]
237+
/// struct for typed errors of method [`StoreApi::place_order`]
238238
#[derive(Debug, Clone, Serialize, Deserialize)]
239239
#[serde(untagged)]
240240
pub enum PlaceOrderError {

samples/client/petstore/rust/reqwest-trait/petstore/src/apis/testing_api.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,21 +167,21 @@ impl TestingApi for TestingApiClient {
167167

168168
}
169169

170-
/// struct for typed errors of method [`tests_all_of_with_one_model_get`]
170+
/// struct for typed errors of method [`TestingApi::tests_all_of_with_one_model_get`]
171171
#[derive(Debug, Clone, Serialize, Deserialize)]
172172
#[serde(untagged)]
173173
pub enum TestsAllOfWithOneModelGetError {
174174
UnknownValue(serde_json::Value),
175175
}
176176

177-
/// struct for typed errors of method [`tests_file_response_get`]
177+
/// struct for typed errors of method [`TestingApi::tests_file_response_get`]
178178
#[derive(Debug, Clone, Serialize, Deserialize)]
179179
#[serde(untagged)]
180180
pub enum TestsFileResponseGetError {
181181
UnknownValue(serde_json::Value),
182182
}
183183

184-
/// struct for typed errors of method [`tests_type_testing_get`]
184+
/// struct for typed errors of method [`TestingApi::tests_type_testing_get`]
185185
#[derive(Debug, Clone, Serialize, Deserialize)]
186186
#[serde(untagged)]
187187
pub enum TestsTypeTestingGetError {

samples/client/petstore/rust/reqwest-trait/petstore/src/apis/user_api.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -368,31 +368,31 @@ impl UserApi for UserApiClient {
368368

369369
}
370370

371-
/// struct for typed errors of method [`create_user`]
371+
/// struct for typed errors of method [`UserApi::create_user`]
372372
#[derive(Debug, Clone, Serialize, Deserialize)]
373373
#[serde(untagged)]
374374
pub enum CreateUserError {
375375
DefaultResponse(),
376376
UnknownValue(serde_json::Value),
377377
}
378378

379-
/// struct for typed errors of method [`create_users_with_array_input`]
379+
/// struct for typed errors of method [`UserApi::create_users_with_array_input`]
380380
#[derive(Debug, Clone, Serialize, Deserialize)]
381381
#[serde(untagged)]
382382
pub enum CreateUsersWithArrayInputError {
383383
DefaultResponse(),
384384
UnknownValue(serde_json::Value),
385385
}
386386

387-
/// struct for typed errors of method [`create_users_with_list_input`]
387+
/// struct for typed errors of method [`UserApi::create_users_with_list_input`]
388388
#[derive(Debug, Clone, Serialize, Deserialize)]
389389
#[serde(untagged)]
390390
pub enum CreateUsersWithListInputError {
391391
DefaultResponse(),
392392
UnknownValue(serde_json::Value),
393393
}
394394

395-
/// struct for typed errors of method [`delete_user`]
395+
/// struct for typed errors of method [`UserApi::delete_user`]
396396
#[derive(Debug, Clone, Serialize, Deserialize)]
397397
#[serde(untagged)]
398398
pub enum DeleteUserError {
@@ -401,7 +401,7 @@ pub enum DeleteUserError {
401401
UnknownValue(serde_json::Value),
402402
}
403403

404-
/// struct for typed errors of method [`get_user_by_name`]
404+
/// struct for typed errors of method [`UserApi::get_user_by_name`]
405405
#[derive(Debug, Clone, Serialize, Deserialize)]
406406
#[serde(untagged)]
407407
pub enum GetUserByNameError {
@@ -410,23 +410,23 @@ pub enum GetUserByNameError {
410410
UnknownValue(serde_json::Value),
411411
}
412412

413-
/// struct for typed errors of method [`login_user`]
413+
/// struct for typed errors of method [`UserApi::login_user`]
414414
#[derive(Debug, Clone, Serialize, Deserialize)]
415415
#[serde(untagged)]
416416
pub enum LoginUserError {
417417
Status400(),
418418
UnknownValue(serde_json::Value),
419419
}
420420

421-
/// struct for typed errors of method [`logout_user`]
421+
/// struct for typed errors of method [`UserApi::logout_user`]
422422
#[derive(Debug, Clone, Serialize, Deserialize)]
423423
#[serde(untagged)]
424424
pub enum LogoutUserError {
425425
DefaultResponse(),
426426
UnknownValue(serde_json::Value),
427427
}
428428

429-
/// struct for typed errors of method [`update_user`]
429+
/// struct for typed errors of method [`UserApi::update_user`]
430430
#[derive(Debug, Clone, Serialize, Deserialize)]
431431
#[serde(untagged)]
432432
pub enum UpdateUserError {

0 commit comments

Comments
 (0)