diff --git a/cmd/protoc-gen-go-http/http.go b/cmd/protoc-gen-go-http/http.go index 4886b8061..eb3fa89e3 100644 --- a/cmd/protoc-gen-go-http/http.go +++ b/cmd/protoc-gen-go-http/http.go @@ -163,9 +163,10 @@ func buildMethodDesc(g *protogen.GeneratedFile, m *protogen.Method, method, path defer func() { methodSets[m.GoName]++ }() vars := buildPathVars(path) - fields := m.Input.Desc.Fields() for v, s := range vars { + fields := m.Input.Desc.Fields() + if s != nil { path = replacePath(v, *s, path) }