use micro-proto repo

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2021-02-27 19:35:53 +03:00
parent 5ee7c4f231
commit 477a69fe6a
3 changed files with 12 additions and 496 deletions

10
util.go
View File

@@ -4,8 +4,8 @@ import (
"fmt"
"strings"
openapi_options "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options"
api_options "google.golang.org/genproto/googleapis/api/annotations"
api_options "github.com/unistack-org/micro-proto/api"
openapiv2_options "github.com/unistack-org/micro-proto/openapiv2"
"google.golang.org/protobuf/compiler/protogen"
"google.golang.org/protobuf/proto"
)
@@ -50,10 +50,10 @@ func generateServiceClientMethods(gfile *protogen.GeneratedFile, service *protog
generateClientFuncSignature(gfile, serviceName, method)
if http && method.Desc.Options() != nil {
if proto.HasExtension(method.Desc.Options(), openapi_options.E_Openapiv2Operation) {
opts := proto.GetExtension(method.Desc.Options(), openapi_options.E_Openapiv2Operation)
if proto.HasExtension(method.Desc.Options(), openapiv2_options.E_Openapiv2Operation) {
opts := proto.GetExtension(method.Desc.Options(), openapiv2_options.E_Openapiv2Operation)
if opts != nil {
r := opts.(*openapi_options.Operation)
r := opts.(*openapiv2_options.Operation)
gfile.P("errmap := make(map[string]interface{}, ", len(r.Responses), ")")
for code, response := range r.Responses {
if response.Schema != nil && response.Schema.JsonSchema != nil {