Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: protoc-gen-swagger: get wrong second services method comments #1116

Merged
merged 2 commits into from
Jan 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions examples/clients/abe/api/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1624,8 +1624,6 @@ paths:
get:
tags:
- "camelCaseServiceName"
summary: "Create a new ABitOfEverything"
description: "This API creates a new ABitOfEverything"
operationId: "Empty"
parameters: []
responses:
Expand Down
3 changes: 1 addition & 2 deletions examples/clients/abe/api_camel_case_service_name.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ var (
type CamelCaseServiceNameApiService service

/*
CamelCaseServiceNameApiService Create a new ABitOfEverything
This API creates a new ABitOfEverything
CamelCaseServiceNameApiService
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().

@return interface{}
Expand Down
2 changes: 0 additions & 2 deletions examples/proto/examplepb/a_bit_of_everything.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -1926,8 +1926,6 @@
},
"/v2/example/empty": {
"get": {
"summary": "Create a new ABitOfEverything",
"description": "This API creates a new ABitOfEverything",
"operationId": "Empty",
"responses": {
"200": {
Expand Down
2 changes: 1 addition & 1 deletion protoc-gen-swagger/genswagger/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,7 @@ func renderServices(services []*descriptor.Service, paths swaggerPathsObject, re
}
}

methComments := protoComments(reg, svc.File, nil, "Method", int32(svcIdx), methProtoPath, int32(methIdx))
methComments := protoComments(reg, svc.File, nil, "Service", int32(svcIdx), methProtoPath, int32(methIdx))
if err := updateSwaggerDataFromComments(reg, operationObject, meth, methComments, false); err != nil {
panic(err)
}
Expand Down