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 a build error with the latest protoc-gen-go #50

Merged
merged 1 commit into from
Sep 4, 2015
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
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.