diff --git a/examples/proto/examplepb/echo_service.pb.go b/examples/proto/examplepb/echo_service.pb.go index 905eaa93a44..e94c9dfa895 100644 --- a/examples/proto/examplepb/echo_service.pb.go +++ b/examples/proto/examplepb/echo_service.pb.go @@ -46,7 +46,7 @@ func (m *Embedded) Reset() { *m = Embedded{} } func (m *Embedded) String() string { return proto.CompactTextString(m) } func (*Embedded) ProtoMessage() {} func (*Embedded) Descriptor() ([]byte, []int) { - return fileDescriptor_echo_service_c13a64d5f1f0c068, []int{0} + return fileDescriptor_echo_service_c2772da14984c01c, []int{0} } func (m *Embedded) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Embedded.Unmarshal(m, b) @@ -189,7 +189,7 @@ func (m *SimpleMessage) Reset() { *m = SimpleMessage{} } func (m *SimpleMessage) String() string { return proto.CompactTextString(m) } func (*SimpleMessage) ProtoMessage() {} func (*SimpleMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_echo_service_c13a64d5f1f0c068, []int{1} + return fileDescriptor_echo_service_c2772da14984c01c, []int{1} } func (m *SimpleMessage) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SimpleMessage.Unmarshal(m, b) @@ -562,39 +562,40 @@ var _EchoService_serviceDesc = grpc.ServiceDesc{ } func init() { - proto.RegisterFile("examples/proto/examplepb/echo_service.proto", fileDescriptor_echo_service_c13a64d5f1f0c068) -} - -var fileDescriptor_echo_service_c13a64d5f1f0c068 = []byte{ - // 470 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x53, 0x3f, 0x6f, 0xd3, 0x40, - 0x14, 0xef, 0xd9, 0x6e, 0x9a, 0xbc, 0x08, 0x54, 0x9d, 0x40, 0x98, 0xb4, 0xa8, 0x91, 0xc5, 0x10, - 0x8a, 0xe4, 0x53, 0xc2, 0x06, 0x13, 0x11, 0x45, 0x5d, 0x60, 0x70, 0xb7, 0x2c, 0xd1, 0xc5, 0xf7,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x49, 0x7d, 0xeb, 0x51, 0xef, 0xaa, - 0x45, 0xd3, 0x99, 0x12, 0x8b, 0x97, 0xe4, 0x98, 0x7e, 0x25, 0x00, 0x46, 0xce, 0x1b, 0xcc, 0x50, - 0xe3, 0xd6, 0x05, 0x1d, 0x59, 0x41, 0x8f, 0x8f, 0x1f, 0x5d, 0x11, 0x24, 0xac, 0x80, 0x71, 0x77, - 0xd2, 0xd9, 0x60, 0x67, 0x2d, 0xfb, 0xcf, 0xbe, 0xf8, 0x1b, 0x00, 0x00, 0xff, 0xff, 0xe9, 0xdb, - 0x6f, 0x39, 0x21, 0x04, 0x00, 0x00, + proto.RegisterFile("examples/proto/examplepb/echo_service.proto", fileDescriptor_echo_service_c2772da14984c01c) +} + +var fileDescriptor_echo_service_c2772da14984c01c = []byte{ + // 482 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x53, 0xcd, 0x6e, 0xd3, 0x4c, + 0x14, 0xed, 0x8c, 0xdd, 0x34, 0x99, 0xe8, 0xfb, 0x54, 0x8d, 0x40, 0x98, 0xb4, 0xa8, 0x91, 0xc5, + 0x22, 0x14, 0xc9, 0xa3, 0x84, 0x5d, 0x61, 0x83, 0x45, 0x51, 0x37, 0xb0, 0x70, 0x77, 0xde, 0x44, + 0x13, 0xcf, 0x95, 0x6b, 0x61, 0xcf, 0x58, 0xf6, 0xa4, 0x34, 0xb2, 0xb2, 0x41, 0x62, 0xc9, 0x8a, + 0x3d, 0x8f, 0xd0, 0x1d, 0x4f, 0xc2, 0x2b, 0xb0, 0xe7, 0x15, 0xd0, 0x4c, 0xe2, 0x48, 0xd0, 0x88, + 0xaa, 0x8b, 0xee, 0x7c, 0x7f, 0xce, 0x3d, 0xe7, 0x9e, 0xb9, 0x26, 0xcf, 0xe1, 0x8a, 0x17, 0x65, + 0x0e, 0x35, 0x2b, 0x2b, 0xa5, 0x15, 0x5b, 0x87, 0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x7e, 0x07, 0x00, 0x00, 0xff, 0xff, 0x3e, 0x6a, 0xaf, 0xec, 0x43, 0x04, + 0x00, 0x00, } diff --git a/examples/proto/examplepb/echo_service.pb.gw.go b/examples/proto/examplepb/echo_service.pb.gw.go index 844ef1418ad..897f075fb7f 100644 --- a/examples/proto/examplepb/echo_service.pb.gw.go +++ b/examples/proto/examplepb/echo_service.pb.gw.go @@ -281,6 +281,50 @@ func request_EchoService_EchoBody_0(ctx context.Context, marshaler runtime.Marsh } +var ( + filter_EchoService_EchoBody_1 = &utilities.DoubleArray{Encoding: map[string]int{"no": 0, "id": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} +) + +func request_EchoService_EchoBody_1(ctx context.Context, marshaler runtime.Marshaler, client EchoServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq SimpleMessage + var metadata runtime.ServerMetadata + + if protoReq.Ext == nil { + protoReq.Ext = &SimpleMessage_No{} + } else if _, ok := protoReq.Ext.(*SimpleMessage_No); !ok { + return nil, metadata, grpc.Errorf(codes.InvalidArgument, "expect type: *SimpleMessage_No, but: %t\n", protoReq.Ext) + } + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Ext.(*SimpleMessage_No).No); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_EchoService_EchoBody_1); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.EchoBody(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + var ( filter_EchoService_EchoDelete_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} ) @@ -510,6 +554,35 @@ func RegisterEchoServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux }) + mux.Handle("PUT", pattern_EchoService_EchoBody_1, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + if cn, ok := w.(http.CloseNotifier); ok { + go func(done <-chan struct{}, closed <-chan bool) { + select { + case <-done: + case <-closed: + cancel() + } + }(ctx.Done(), cn.CloseNotify()) + } + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_EchoService_EchoBody_1(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_EchoService_EchoBody_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("DELETE", pattern_EchoService_EchoDelete_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -555,6 +628,8 @@ var ( pattern_EchoService_EchoBody_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "example", "echo_body"}, "")) + pattern_EchoService_EchoBody_1 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "example", "echo_body", "id"}, "")) + pattern_EchoService_EchoDelete_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "example", "echo_delete"}, "")) ) @@ -571,5 +646,7 @@ var ( forward_EchoService_EchoBody_0 = runtime.ForwardResponseMessage + forward_EchoService_EchoBody_1 = runtime.ForwardResponseMessage + forward_EchoService_EchoDelete_0 = runtime.ForwardResponseMessage ) diff --git a/examples/proto/examplepb/echo_service.proto b/examples/proto/examplepb/echo_service.proto index 710d0576e45..95ff477736b 100644 --- a/examples/proto/examplepb/echo_service.proto +++ b/examples/proto/examplepb/echo_service.proto @@ -61,6 +61,10 @@ service EchoService { option (google.api.http) = { post: "/v1/example/echo_body" body: "*" + additional_bindings { + put: "/v1/example/echo_body/{id}" + body: "no" + } }; } // EchoDelete method receives a simple message and returns it. diff --git a/examples/proto/examplepb/echo_service.swagger.json b/examples/proto/examplepb/echo_service.swagger.json index c14354ffbce..a88ca31dc3e 100644 --- a/examples/proto/examplepb/echo_service.swagger.json +++ b/examples/proto/examplepb/echo_service.swagger.json @@ -374,6 +374,39 @@ ] } }, + "/v1/example/echo_body/{id}": { + "put": { + "summary": "EchoBody method receives a simple message and returns it.", + "operationId": "EchoBody2", + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/examplepbSimpleMessage" + } + } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/examplepbEmbedded" + } + } + ], + "tags": [ + "EchoService" + ] + } + }, "/v1/example/echo_delete": { "delete": { "summary": "EchoDelete method receives a simple message and returns it.", diff --git a/protoc-gen-grpc-gateway/descriptor/types.go b/protoc-gen-grpc-gateway/descriptor/types.go index 6346b68e956..338842a7256 100644 --- a/protoc-gen-grpc-gateway/descriptor/types.go +++ b/protoc-gen-grpc-gateway/descriptor/types.go @@ -240,6 +240,12 @@ func (b Body) AssignableExpr(msgExpr string) string { return b.FieldPath.AssignableExpr(msgExpr) } +// AssignableExprPrep returns prepatory statements for an assignable expression to initialize +// method request object. +func (b Body) AssignableExprPrep(msgExpr string) string { + return b.FieldPath.AssignableExprPrep(msgExpr) +} + // FieldPath is a path to a field from a request message. type FieldPath []FieldPathComponent @@ -261,13 +267,46 @@ func (p FieldPath) IsNestedProto3() bool { } // AssignableExpr is an assignable expression in Go to be used to assign a value to the target field. -// It starts with "msgExpr", which is the go expression of the method request object. +// It starts with "msgExpr", which is the go expression of the method request object. Before using +// such an expression the prep statements must be emitted first, in case the field path includes +// a oneof. See FieldPath.AssignableExprPrep. func (p FieldPath) AssignableExpr(msgExpr string) string { l := len(p) if l == 0 { return msgExpr } + components := msgExpr + for i, c := range p { + // Check if it is a oneOf field. + if c.Target.OneofIndex != nil { + index := c.Target.OneofIndex + msg := c.Target.Message + oneOfName := gogen.CamelCase(msg.GetOneofDecl()[*index].GetName()) + oneofFieldName := msg.GetName() + "_" + c.AssignableExpr() + + components = components + "." + oneOfName + ".(*" + oneofFieldName + ")" + } + + if i == l-1 { + components = components + "." + c.AssignableExpr() + continue + } + components = components + "." + c.ValueExpr() + } + + return components +} + +// AssignableExprPrep returns preparation statements for an assignable expression to assign a value +// to the target field. The go expression of the method request object is "msgExpr". This is only +// needed for field paths that contain oneofs. Otherwise, an empty string is returned. +func (p FieldPath) AssignableExprPrep(msgExpr string) string { + l := len(p) + if l == 0 { + return "" + } + var preparations []string components := msgExpr for i, c := range p { @@ -296,7 +335,6 @@ func (p FieldPath) AssignableExpr(msgExpr string) string { components = components + "." + c.ValueExpr() } - preparations = append(preparations, components) return strings.Join(preparations, "\n") } diff --git a/protoc-gen-grpc-gateway/gengateway/template.go b/protoc-gen-grpc-gateway/gengateway/template.go index 435a1405100..ea9d32abc6b 100644 --- a/protoc-gen-grpc-gateway/gengateway/template.go +++ b/protoc-gen-grpc-gateway/gengateway/template.go @@ -207,6 +207,7 @@ var ( var protoReq {{.Method.RequestType.GoType .Method.Service.File.GoPkg.Path}} var metadata runtime.ServerMetadata {{if .Body}} + {{.Body.AssignableExprPrep "protoReq"}} if err := marshaler.NewDecoder(req.Body).Decode(&{{.Body.AssignableExpr "protoReq"}}); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -226,6 +227,7 @@ var ( {{if $param.IsNestedProto3 }} err = runtime.PopulateFieldFromPath(&protoReq, {{$param | printf "%q"}}, val) {{else}} + {{$param.AssignableExprPrep "protoReq"}} {{$param.AssignableExpr "protoReq"}}, err = {{$param.ConvertFuncExpr}}(val) {{end}} if err != nil {