fix http client generation without openapiv2 annotation
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
parent
4d2af78ba7
commit
bce3839877
18
util.go
18
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(")")
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user