Skip to content

Commit

Permalink
Follow a change in protoc-gen-go
Browse files Browse the repository at this point in the history
Follows golang/protobuf@59b73b3,
which introduces an incompatible change in generated codes
  • Loading branch information
yugui committed Sep 3, 2015
1 parent 9078b50 commit 6e59041
Show file tree
Hide file tree
Showing 7 changed files with 226 additions and 27 deletions.
4 changes: 4 additions & 0 deletions examples/examplepb/a_bit_of_everything.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions examples/examplepb/echo_service.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions examples/examplepb/flow_combination.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions examples/sub/message.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 14 additions & 13 deletions protoc-gen-grpc-gateway/descriptor/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,35 +72,36 @@ func (r *Registry) newMethod(svc *Service, md *descriptor.MethodDescriptorProto,
pathTemplate string
)
switch {
case opts.Get != "":
case opts.GetGet() != "":
httpMethod = "GET"
pathTemplate = opts.Get
pathTemplate = opts.GetGet()
if opts.Body != "" {
return nil, fmt.Errorf("needs request body even though http method is GET: %s", md.GetName())
}

case opts.Put != "":
case opts.GetPut() != "":
httpMethod = "PUT"
pathTemplate = opts.Put
pathTemplate = opts.GetPut()

case opts.Post != "":
case opts.GetPost() != "":
httpMethod = "POST"
pathTemplate = opts.Post
pathTemplate = opts.GetPost()

case opts.Delete != "":
case opts.GetDelete() != "":
httpMethod = "DELETE"
pathTemplate = opts.Delete
pathTemplate = opts.GetDelete()
if opts.Body != "" {
return nil, fmt.Errorf("needs request body even though http method is DELETE: %s", md.GetName())
}

case opts.Patch != "":
case opts.GetPatch() != "":
httpMethod = "PATCH"
pathTemplate = opts.Patch
pathTemplate = opts.GetPatch()

case opts.Custom != nil:
httpMethod = opts.Custom.Kind
pathTemplate = opts.Custom.Path
case opts.GetCustom() != nil:
custom := opts.GetCustom()
httpMethod = custom.Kind
pathTemplate = custom.Path

default:
glog.Errorf("No pattern specified in google.api.HttpRule: %s", md.GetName())
Expand Down
6 changes: 6 additions & 0 deletions third_party/googleapis/google/api/annotations.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

198 changes: 184 additions & 14 deletions third_party/googleapis/google/api/http.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6e59041

Please sign in to comment.