Skip to content

Commit a9b7e27

Browse files
Fix tag naming uniqueness
1 parent 2b3acf2 commit a9b7e27

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

internal/generator/path.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func (g *Generator) addPathsToDoc(doc *openapi3.T, services []*protogen.Service)
4848
pathPrefix = fileOptions.Prefix
4949
}
5050

51-
tagName := string(service.Desc.Name())
51+
tagName := string(service.Desc.FullName())
5252
packageName := string(service.Desc.ParentFile().Package())
5353
serviceOptions := new(oapiv1.ServiceOptions)
5454

test/field_test_openapi.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ paths:
6969
servers:
7070
- url: https://api.swagger.io
7171
tags:
72-
- TestService
72+
- test.api.TestService
7373

7474
/v1/TestFieldExamples:
7575
post:
@@ -94,7 +94,7 @@ paths:
9494
servers:
9595
- url: https://api.swagger.io
9696
tags:
97-
- TestService
97+
- test.api.TestService
9898

9999
components:
100100
responses:
@@ -117,10 +117,10 @@ servers:
117117
- url: https://api.swagger.io
118118

119119
tags:
120-
- name: TestService
120+
- name: test.api.TestService
121121
x-displayName: Test Service
122122

123123
x-tagGroups:
124124
- name: Test Group
125125
tags:
126-
- TestService
126+
- test.api.TestService

test/method_test_openapi.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ paths:
2929
- url: https://test.swagger.io
3030
- url: https://test.added.io
3131
tags:
32-
- TestService
32+
- test.api.TestService
3333

3434
components:
3535
responses:
@@ -56,10 +56,10 @@ servers:
5656
- url: https://swagger.io
5757

5858
tags:
59-
- name: TestService
59+
- name: test.api.TestService
6060
x-displayName: Test Service
6161

6262
x-tagGroups:
6363
- name: Test Group
6464
tags:
65-
- TestService
65+
- test.api.TestService

test/service_test_openapi.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ paths:
2424
- url: https://api.swagger.io
2525
- url: https://api.added.io
2626
tags:
27-
- TestService
27+
- test.api.TestService
2828
/v1/TestPost:
2929
post:
3030
operationId: TestService_TestPost
@@ -46,7 +46,7 @@ paths:
4646
- url: https://api.swagger.io
4747
- url: https://api.added.io
4848
tags:
49-
- TestService
49+
- test.api.TestService
5050
security: [ ]
5151
/v1/Test2Get:
5252
get:
@@ -66,7 +66,7 @@ paths:
6666
- url: https://swagger.io
6767
- url: https://api.added.io
6868
tags:
69-
- Test2Service
69+
- test.api.Test2Service
7070

7171
components:
7272
responses:
@@ -93,19 +93,19 @@ servers:
9393
- url: https://swagger.io
9494

9595
tags:
96-
- name: TestService
96+
- name: test.api.TestService
9797
x-displayName: Test Service
98-
- name: Test2Service
98+
- name: test.api.Test2Service
9999
x-displayName: Test 2 Service
100100

101101

102102
x-tagGroups:
103103
- name: Test Group
104104
tags:
105-
- TestService
105+
- test.api.TestService
106106
- name: Test 2 Group
107107
tags:
108-
- Test2Service
108+
- test.api.Test2Service
109109

110110
security:
111111
- bearer_auth:

0 commit comments

Comments
 (0)