fix: swagger 重复的path,会丢失问题

pull/192/head
meng.li 6 years ago
parent a191f4ffad
commit 9f9d958d6d
  1. 4
      tool/protobuf/protoc-gen-bswagger/generator.go

@ -74,7 +74,9 @@ func (t *swaggerGen) generateSwagger(file *descriptor.FileDescriptorProto) *plug
} }
apiInfo := t.GetHttpInfoCached(file, svc, meth) apiInfo := t.GetHttpInfoCached(file, svc, meth)
pathItem := swaggerPathItemObject{} pathItem := swaggerPathItemObject{}
if originPathItem,ok := swaggerObj.Paths[apiInfo.Path];ok{
pathItem= originPathItem
}
op := t.getOperationByHTTPMethod(apiInfo.HttpMethod, &pathItem) op := t.getOperationByHTTPMethod(apiInfo.HttpMethod, &pathItem)
op.Summary = apiInfo.Title op.Summary = apiInfo.Title
op.Description = apiInfo.Description op.Description = apiInfo.Description

Loading…
Cancel
Save