From bce3839877bdcc2296c0178f0592d1f145aaae83 Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Fri, 19 Mar 2021 12:59:53 +0300 Subject: [PATCH] fix http client generation without openapiv2 annotation Signed-off-by: Vasiliy Tolstov --- util.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/util.go b/util.go index 24c41ca..52b9560 100644 --- a/util.go +++ b/util.go @@ -55,15 +55,15 @@ func generateServiceClientMethods(gfile *protogen.GeneratedFile, service *protog gfile.P("opts = append(opts,") gfile.P(microClientHttpPackage.Ident("ErrorMap"), "(errmap),") - - if proto.HasExtension(method.Desc.Options(), api_options.E_Http) { - endpoints, _ := generateEndpoints(method) - path, method, body := getEndpoint(endpoints[0]) - gfile.P(microClientHttpPackage.Ident("Method"), `("`, method, `"),`) - gfile.P(microClientHttpPackage.Ident("Path"), `("`, path, `"),`) - gfile.P(microClientHttpPackage.Ident("Body"), `("`, body, `"),`) - } - + gfile.P(")") + } + if proto.HasExtension(method.Desc.Options(), api_options.E_Http) { + gfile.P("opts = append(opts,") + endpoints, _ := generateEndpoints(method) + path, method, body := getEndpoint(endpoints[0]) + gfile.P(microClientHttpPackage.Ident("Method"), `("`, method, `"),`) + gfile.P(microClientHttpPackage.Ident("Path"), `("`, path, `"),`) + gfile.P(microClientHttpPackage.Ident("Body"), `("`, body, `"),`) gfile.P(")") } }