From be9cfde7a4f611b8bef55dd55f41c302109b29b1 Mon Sep 17 00:00:00 2001 From: Nikita Krasnikov Date: Mon, 16 May 2022 08:37:36 +0300 Subject: [PATCH] Fix buildMethodDesc for two and more message field (#1979) --- cmd/protoc-gen-go-http/http.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) }