Skip to content

Commit

Permalink
Revert "protoc-gen-swagger: check typeIndex when typeName is Method"
Browse files Browse the repository at this point in the history
This reverts commit 8140d98. It caused
a regression in the swagger generator allow_merge behaviour.

Fixes #923
  • Loading branch information
johanbrandhorst committed Jun 13, 2019
1 parent e6f18d3 commit e35ddc6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion examples/clients/abe/camel_case_service_name_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ func NewCamelCaseServiceNameApiWithBasePath(basePath string) *CamelCaseServiceNa
}

/**
*
* Create a new ABitOfEverything
* This API creates a new ABitOfEverything
*
* @return *interface{}
*/
Expand Down
2 changes: 2 additions & 0 deletions examples/proto/examplepb/a_bit_of_everything.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -1589,6 +1589,8 @@
},
"/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 @@ -1366,7 +1366,7 @@ func isProtoPathMatches(paths []int32, outerPaths []int32, typeName string, type
}

if typeName == "Method" {
if paths[0] != serviceProtoPath || paths[1] != typeIndex || paths[2] != methodProtoPath {
if paths[0] != serviceProtoPath || paths[2] != methodProtoPath {
return false
}
paths = paths[2:]
Expand Down

0 comments on commit e35ddc6

Please sign in to comment.