Skip to content

Commit bcbdee7

Browse files
authored
Generate Swagger with Unique Operation IDs (#1193)
* OperationId includes service name * Re-generate and fix tests
1 parent 4a27188 commit bcbdee7

21 files changed

+286
-175
lines changed

examples/internal/clients/abe/api/swagger.yaml

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ paths:
3333
post:
3434
tags:
3535
- "ABitOfEverythingService"
36-
operationId: "CreateBody"
36+
operationId: "ABitOfEverythingService_CreateBody"
3737
parameters:
3838
- in: "body"
3939
name: "body"
@@ -69,7 +69,7 @@ paths:
6969
- "echo rpc"
7070
summary: "Summary: Echo rpc"
7171
description: "Description Echo"
72-
operationId: "Echo"
72+
operationId: "ABitOfEverythingService_Echo"
7373
parameters:
7474
- name: "value"
7575
in: "path"
@@ -112,7 +112,7 @@ paths:
112112
get:
113113
tags:
114114
- "ABitOfEverythingService"
115-
operationId: "CheckNestedEnumGetQueryParams"
115+
operationId: "ABitOfEverythingService_CheckNestedEnumGetQueryParams"
116116
parameters:
117117
- name: "single_nested.ok"
118118
in: "path"
@@ -400,7 +400,7 @@ paths:
400400
get:
401401
tags:
402402
- "ABitOfEverythingService"
403-
operationId: "CheckGetQueryParams"
403+
operationId: "ABitOfEverythingService_CheckGetQueryParams"
404404
parameters:
405405
- name: "single_nested.name"
406406
in: "path"
@@ -695,7 +695,7 @@ paths:
695695
post:
696696
tags:
697697
- "ABitOfEverythingService"
698-
operationId: "CheckPostQueryParams"
698+
operationId: "ABitOfEverythingService_CheckPostQueryParams"
699699
parameters:
700700
- name: "string_value"
701701
in: "path"
@@ -734,7 +734,7 @@ paths:
734734
get:
735735
tags:
736736
- "ABitOfEverythingService"
737-
operationId: "GetQuery"
737+
operationId: "ABitOfEverythingService_GetQuery"
738738
parameters:
739739
- name: "uuid"
740740
in: "path"
@@ -1042,7 +1042,7 @@ paths:
10421042
- "ABitOfEverythingService"
10431043
summary: "Create a new ABitOfEverything"
10441044
description: "This API creates a new ABitOfEverything"
1045-
operationId: "Create"
1045+
operationId: "ABitOfEverythingService_Create"
10461046
parameters:
10471047
- name: "float_value"
10481048
in: "path"
@@ -1193,7 +1193,7 @@ paths:
11931193
post:
11941194
tags:
11951195
- "ABitOfEverythingService"
1196-
operationId: "DeepPathEcho"
1196+
operationId: "ABitOfEverythingService_DeepPathEcho"
11971197
parameters:
11981198
- name: "single_nested.name"
11991199
in: "path"
@@ -1233,7 +1233,7 @@ paths:
12331233
get:
12341234
tags:
12351235
- "ABitOfEverythingService"
1236-
operationId: "Lookup"
1236+
operationId: "ABitOfEverythingService_Lookup"
12371237
parameters:
12381238
- name: "uuid"
12391239
in: "path"
@@ -1265,7 +1265,7 @@ paths:
12651265
put:
12661266
tags:
12671267
- "ABitOfEverythingService"
1268-
operationId: "Update"
1268+
operationId: "ABitOfEverythingService_Update"
12691269
parameters:
12701270
- name: "uuid"
12711271
in: "path"
@@ -1302,7 +1302,7 @@ paths:
13021302
delete:
13031303
tags:
13041304
- "ABitOfEverythingService"
1305-
operationId: "Delete"
1305+
operationId: "ABitOfEverythingService_Delete"
13061306
parameters:
13071307
- name: "uuid"
13081308
in: "path"
@@ -1340,7 +1340,7 @@ paths:
13401340
: get:
13411341
tags:
13421342
- "ABitOfEverythingService"
1343-
operationId: "GetRepeatedQuery"
1343+
operationId: "ABitOfEverythingService_GetRepeatedQuery"
13441344
parameters:
13451345
- name: "path_repeated_float_value"
13461346
in: "path"
@@ -1531,7 +1531,7 @@ paths:
15311531
put:
15321532
tags:
15331533
- "ABitOfEverythingService"
1534-
operationId: "UpdateV2"
1534+
operationId: "ABitOfEverythingService_UpdateV2"
15351535
parameters:
15361536
- name: "abe.uuid"
15371537
in: "path"
@@ -1568,7 +1568,7 @@ paths:
15681568
patch:
15691569
tags:
15701570
- "ABitOfEverythingService"
1571-
operationId: "UpdateV22"
1571+
operationId: "ABitOfEverythingService_UpdateV22"
15721572
parameters:
15731573
- name: "abe.uuid"
15741574
in: "path"
@@ -1608,7 +1608,7 @@ paths:
16081608
- "echo rpc"
16091609
summary: "Summary: Echo rpc"
16101610
description: "Description Echo"
1611-
operationId: "Echo3"
1611+
operationId: "ABitOfEverythingService_Echo3"
16121612
parameters:
16131613
- name: "value"
16141614
in: "query"
@@ -1653,7 +1653,7 @@ paths:
16531653
- "echo rpc"
16541654
summary: "Summary: Echo rpc"
16551655
description: "Description Echo"
1656-
operationId: "Echo2"
1656+
operationId: "ABitOfEverythingService_Echo2"
16571657
parameters:
16581658
- in: "body"
16591659
name: "body"
@@ -1697,7 +1697,7 @@ paths:
16971697
get:
16981698
tags:
16991699
- "camelCaseServiceName"
1700-
operationId: "Empty"
1700+
operationId: "camelCaseServiceName_Empty"
17011701
parameters: []
17021702
responses:
17031703
200:
@@ -1724,7 +1724,7 @@ paths:
17241724
get:
17251725
tags:
17261726
- "ABitOfEverythingService"
1727-
operationId: "ErrorWithDetails"
1727+
operationId: "ABitOfEverythingService_ErrorWithDetails"
17281728
parameters: []
17291729
responses:
17301730
200:
@@ -1751,7 +1751,7 @@ paths:
17511751
get:
17521752
tags:
17531753
- "ABitOfEverythingService"
1754-
operationId: "OverwriteResponseContentType"
1754+
operationId: "ABitOfEverythingService_OverwriteResponseContentType"
17551755
produces:
17561756
- "application/text"
17571757
parameters: []
@@ -1781,7 +1781,7 @@ paths:
17811781
post:
17821782
tags:
17831783
- "ABitOfEverythingService"
1784-
operationId: "PostWithEmptyBody"
1784+
operationId: "ABitOfEverythingService_PostWithEmptyBody"
17851785
parameters:
17861786
- name: "name"
17871787
in: "path"
@@ -1819,7 +1819,7 @@ paths:
18191819
get:
18201820
tags:
18211821
- "ABitOfEverythingService"
1822-
operationId: "Timeout"
1822+
operationId: "ABitOfEverythingService_Timeout"
18231823
parameters: []
18241824
responses:
18251825
200:
@@ -1846,7 +1846,7 @@ paths:
18461846
post:
18471847
tags:
18481848
- "ABitOfEverythingService"
1849-
operationId: "GetMessageWithBody"
1849+
operationId: "ABitOfEverythingService_GetMessageWithBody"
18501850
parameters:
18511851
- name: "id"
18521852
in: "path"
@@ -1884,7 +1884,7 @@ paths:
18841884
patch:
18851885
tags:
18861886
- "ABitOfEverythingService"
1887-
operationId: "UpdateV23"
1887+
operationId: "ABitOfEverythingService_UpdateV23"
18881888
parameters:
18891889
- name: "abe.uuid"
18901890
in: "path"

0 commit comments

Comments
 (0)