Skip to content

Commit e223fc6

Browse files
committed
fix tagging
1 parent 865c822 commit e223fc6

File tree

4 files changed

+68
-214
lines changed

4 files changed

+68
-214
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ deps/go:
2222

2323
pre-build:
2424
git submodule update --init --recursive
25-
cd buf-plugin-openapi && make install
25+
cd buf-plugin-openapi && make clean install
2626

2727
.PHONY: proto
2828
proto: pre-build

buf-plugin-openapi/main.go

+14-14
Original file line numberDiff line numberDiff line change
@@ -219,10 +219,10 @@ func main() {
219219
// Add tag if not seen before
220220
if !seenTags[moduleTag] {
221221
seenTags[moduleTag] = true
222-
allPathsSpec.Tags = append(allPathsSpec.Tags, Tag{
223-
Name: moduleTag,
224-
Description: fmt.Sprintf("Operations from package %s", moduleTag),
225-
})
222+
// allPathsSpec.Tags = append(allPathsSpec.Tags, Tag{
223+
// Name: moduleTag,
224+
// Description: fmt.Sprintf("Operations from package %s", moduleTag),
225+
// })
226226
}
227227

228228
// Process all services in the file
@@ -231,10 +231,10 @@ func main() {
231231
serviceTag := fmt.Sprintf("%s/%s", moduleTag, strings.ToLower(service.GoName))
232232
if !seenTags[serviceTag] {
233233
seenTags[serviceTag] = true
234-
allPathsSpec.Tags = append(allPathsSpec.Tags, Tag{
235-
Name: serviceTag,
236-
Description: fmt.Sprintf("Operations for service %s", service.GoName),
237-
})
234+
// allPathsSpec.Tags = append(allPathsSpec.Tags, Tag{
235+
// Name: serviceTag,
236+
// Description: fmt.Sprintf("Operations for service %s", service.GoName),
237+
// })
238238
}
239239

240240
for _, method := range service.Methods {
@@ -261,7 +261,7 @@ func main() {
261261
Summary: method.GoName,
262262
Description: extractLeadingComments(method),
263263
OperationID: fmt.Sprintf("%s_%s", service.GoName, method.GoName),
264-
Tags: []string{moduleTag, serviceTag},
264+
Tags: []string{moduleTag}, // []string{moduleTag, serviceTag},
265265
Responses: map[string]Response{
266266
"200": {
267267
Description: "Successful response",
@@ -281,7 +281,7 @@ func main() {
281281
if isPublicVal != nil {
282282
isPublic = isPublicVal.(bool)
283283
if isPublic {
284-
operation.Tags = append(operation.Tags, "public_rpc")
284+
//operation.Tags = append(operation.Tags, "public_rpc")
285285
}
286286
}
287287
}
@@ -342,10 +342,10 @@ func main() {
342342
}
343343
if !seenPublicTags[serviceTag] {
344344
seenPublicTags[serviceTag] = true
345-
publicPathsSpec.Tags = append(publicPathsSpec.Tags, Tag{
346-
Name: serviceTag,
347-
Description: fmt.Sprintf("Operations for service %s", service.GoName),
348-
})
345+
// publicPathsSpec.Tags = append(publicPathsSpec.Tags, Tag{
346+
// Name: serviceTag,
347+
// Description: fmt.Sprintf("Operations for service %s", service.GoName),
348+
// })
349349
}
350350

351351
// Add operation to publicPathsSpec

gen/openapi/api.public.swagger.json

+4-20
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,7 @@
6565
}
6666
},
6767
"tags": [
68-
"rewards",
69-
"rewards/rewards",
70-
"public_rpc"
68+
"rewards"
7169
]
7270
}
7371
},
@@ -93,9 +91,7 @@
9391
}
9492
},
9593
"tags": [
96-
"rewards",
97-
"rewards/rewards",
98-
"public_rpc"
94+
"rewards"
9995
]
10096
}
10197
},
@@ -132,9 +128,7 @@
132128
}
133129
},
134130
"tags": [
135-
"rewards",
136-
"rewards/rewards",
137-
"public_rpc"
131+
"rewards"
138132
]
139133
}
140134
},
@@ -160,9 +154,7 @@
160154
}
161155
},
162156
"tags": [
163-
"health",
164-
"health/health",
165-
"public_rpc"
157+
"health"
166158
]
167159
}
168160
}
@@ -2101,17 +2093,9 @@
21012093
"name": "health",
21022094
"description": "Operations from package health"
21032095
},
2104-
{
2105-
"name": "health/health",
2106-
"description": "Operations for service Health"
2107-
},
21082096
{
21092097
"name": "rewards",
21102098
"description": "Operations from package rewards"
2111-
},
2112-
{
2113-
"name": "rewards/rewards",
2114-
"description": "Operations for service Rewards"
21152099
}
21162100
]
21172101
}

0 commit comments

Comments
 (0)