From 13d2d679a329120ed0d747ce9fec835b39810d94 Mon Sep 17 00:00:00 2001 From: Yuki Yugui Sonoda Date: Sat, 17 Jun 2017 11:59:57 +0900 Subject: [PATCH 1/4] Add accessors to oneof fields in the code template The idea behind the change is similar to https://github.com/golang/protobuf/issues/283. But it returns a non-nil pointer to an oneof option struct for ease of use in both of unmarshaling and assignment. --- .../examplepb/a_bit_of_everything.pb.gw.go | 18 +++++ protoc-gen-grpc-gateway/descriptor/types.go | 22 ++++++ .../descriptor/types_test.go | 72 +++++++++++++++++++ .../gengateway/template.go | 40 +++++++++-- 4 files changed, 147 insertions(+), 5 deletions(-) diff --git a/examples/examplepb/a_bit_of_everything.pb.gw.go b/examples/examplepb/a_bit_of_everything.pb.gw.go index ec3b01490a5..052d5fab200 100644 --- a/examples/examplepb/a_bit_of_everything.pb.gw.go +++ b/examples/examplepb/a_bit_of_everything.pb.gw.go @@ -850,3 +850,21 @@ var ( forward_ABitOfEverythingService_Timeout_0 = runtime.ForwardResponseMessage ) + +func (m *ABitOfEverything) alloc_OneofEmpty() *ABitOfEverything_OneofEmpty { + if x, ok := m.OneofValue.(*ABitOfEverything_OneofEmpty); ok { + return x + } + x := new(ABitOfEverything_OneofEmpty) + m.OneofValue = x + return x +} + +func (m *ABitOfEverything) alloc_OneofString() *ABitOfEverything_OneofString { + if x, ok := m.OneofValue.(*ABitOfEverything_OneofString); ok { + return x + } + x := new(ABitOfEverything_OneofString) + m.OneofValue = x + return x +} diff --git a/protoc-gen-grpc-gateway/descriptor/types.go b/protoc-gen-grpc-gateway/descriptor/types.go index 248538e7bad..2843df1052f 100644 --- a/protoc-gen-grpc-gateway/descriptor/types.go +++ b/protoc-gen-grpc-gateway/descriptor/types.go @@ -175,6 +175,28 @@ type Field struct { *descriptor.FieldDescriptorProto } +// IsOneof returns whether the field is in a oneof definition. +func (f Field) IsOneof() bool { + return f.OneofIndex != nil +} + +// GoOneofName returns the name of the golang field name corresponding to +// the oneof definition to which this protobuf field "f" belongs. +// It returns an error if "f" is not a member of oneof definition. +func (f Field) GoOneofName() (string, error) { + if !f.IsOneof() { + return "", fmt.Errorf("%s is not a oneof field", f.GetName()) + } + d := f.Message.GetOneofDecl()[f.GetOneofIndex()] + return gogen.CamelCase(d.GetName()), nil +} + +// GoName returns the name of the golang field name corresponding to +// this protobuf field. +func (f Field) GoName() string { + return gogen.CamelCase(f.GetName()) +} + // Parameter is a parameter provided in http requests type Parameter struct { // FieldPath is a path to a proto field which this parameter is mapped to. diff --git a/protoc-gen-grpc-gateway/descriptor/types_test.go b/protoc-gen-grpc-gateway/descriptor/types_test.go index ef2162a61fb..688527e0f85 100644 --- a/protoc-gen-grpc-gateway/descriptor/types_test.go +++ b/protoc-gen-grpc-gateway/descriptor/types_test.go @@ -79,6 +79,78 @@ func TestGoPackageString(t *testing.T) { } } +func TestIsOneof(t *testing.T) { + const src = ` + name: 'M' + field < + name: 'oneof_option' + label: LABEL_OPTIONAL + type: TYPE_STRING + number: 1 + oneof_index: 0 + > + oneof_decl < + name: 'oneof_field' + > + ` + var d descriptor.DescriptorProto + if err := proto.UnmarshalText(src, &d); err != nil { + t.Fatalf("proto.UnmarshalText(%s, &d) failed with %v; want success", src, err) + } + m := &Message{DescriptorProto: &d} + f := &Field{ + Message: m, + FieldDescriptorProto: d.Field[0], + } + + if got, want := f.IsOneof(), true; got != want { + t.Errorf("f.IsOneof() = %v; want %v", got, want) + } + + f.OneofIndex = nil + if got, want := f.IsOneof(), false; got != want { + t.Errorf("f.IsOneof() = %v; want %v", got, want) + } +} + +func TestGoOneofName(t *testing.T) { + const src = ` + name: 'M' + field < + name: 'oneof_option' + label: LABEL_OPTIONAL + type: TYPE_STRING + number: 1 + oneof_index: 0 + > + oneof_decl < + name: 'oneof_field' + > + ` + var d descriptor.DescriptorProto + if err := proto.UnmarshalText(src, &d); err != nil { + t.Fatalf("proto.UnmarshalText(%s, &d) failed with %v; want success", src, err) + } + m := &Message{DescriptorProto: &d} + f := &Field{ + Message: m, + FieldDescriptorProto: d.Field[0], + } + + name, err := f.GoOneofName() + if err != nil { + t.Errorf("f.GoOneofName() failed with %v; want success", err) + } + if got, want := name, "OneofField"; got != want { + t.Errorf("name = %q; want %q", got, want) + } + + f.OneofIndex = nil + if name, err := f.GoOneofName(); err == nil { + t.Errorf("f.GoOneofName() = %q; want failure", name) + } +} + func TestFieldPath(t *testing.T) { var fds []*descriptor.FileDescriptorProto for _, src := range []string{ diff --git a/protoc-gen-grpc-gateway/gengateway/template.go b/protoc-gen-grpc-gateway/gengateway/template.go index b660f16d6e0..b1810b88250 100644 --- a/protoc-gen-grpc-gateway/gengateway/template.go +++ b/protoc-gen-grpc-gateway/gengateway/template.go @@ -67,11 +67,15 @@ func (f queryParamFilter) String() string { return fmt.Sprintf("&utilities.DoubleArray{Encoding: map[string]int{%s}, Base: %#v, Check: %#v}", e, f.Base, f.Check) } -type trailerParams struct { +type registererParams struct { Services []*descriptor.Service UseRequestContext bool } +type decodeHelperParams struct { + Messages []*descriptor.Message +} + func applyTemplate(p param) (string, error) { w := bytes.NewBuffer(nil) if err := headerTemplate.Execute(w, p); err != nil { @@ -99,11 +103,18 @@ func applyTemplate(p param) (string, error) { return "", errNoTargetService } - tp := trailerParams{ + rp := registererParams{ Services: targetServices, UseRequestContext: p.UseRequestContext, } - if err := trailerTemplate.Execute(w, tp); err != nil { + if err := registerersTemplate.Execute(w, rp); err != nil { + return "", err + } + + hp := decodeHelperParams{ + Messages: p.Messages, + } + if err := decodeHelperTemplate.Execute(w, hp); err != nil { return "", err } return w.String(), nil @@ -308,7 +319,7 @@ var ( } `)) - trailerTemplate = template.Must(template.New("trailer").Parse(` + registerersTemplate = template.Must(template.New("registerers").Parse(` {{$UseRequestContext := .UseRequestContext}} {{range $svc := .Services}} // Register{{$svc.GetName}}HandlerFromEndpoint is same as Register{{$svc.GetName}}Handler but @@ -396,5 +407,24 @@ var ( {{end}} {{end}} ) -{{end}}`)) +{{end}} +`)) + decodeHelperTemplate = template.Must(template.New("decode-helpers").Parse(` +{{range $m := .Messages}} +{{range $m.Fields}} +{{if .IsOneof}} +{{$mt := $m.GoType $m.File.GoPkg.Path}} +{{$ft := printf "%s_%s" $mt .GoName}} +func (m *{{$mt}}) alloc_{{.GoName}}() *{{$ft}} { + if x, ok := m.{{.GoOneofName}}.(*{{$ft}}); ok { + return x + } + x := new({{$ft}}) + m.{{.GoOneofName}} = x + return x +} +{{end}} +{{end}} +{{end}} +`)) ) From 5acfc79acc7de56a7acbeaa94d505c5245ddac2d Mon Sep 17 00:00:00 2001 From: Yuki Yugui Sonoda Date: Sat, 17 Jun 2017 12:00:07 +0900 Subject: [PATCH 2/4] Support unmarshaling to oneof fields fixes #413 --- protoc-gen-grpc-gateway/descriptor/types.go | 5 ++ .../descriptor/types_test.go | 61 ++++++++++++++++--- 2 files changed, 57 insertions(+), 9 deletions(-) diff --git a/protoc-gen-grpc-gateway/descriptor/types.go b/protoc-gen-grpc-gateway/descriptor/types.go index 2843df1052f..bfafaa27269 100644 --- a/protoc-gen-grpc-gateway/descriptor/types.go +++ b/protoc-gen-grpc-gateway/descriptor/types.go @@ -284,6 +284,11 @@ type FieldPathComponent struct { // RHS returns a right-hand-side expression in go for this field. func (c FieldPathComponent) RHS() string { + if c.Target.IsOneof() { + n := gogen.CamelCase(c.Name) + // alloc func is generated in the target .pb.gw.go file + return fmt.Sprintf("alloc_%s().%s", n, n) + } return gogen.CamelCase(c.Name) } diff --git a/protoc-gen-grpc-gateway/descriptor/types_test.go b/protoc-gen-grpc-gateway/descriptor/types_test.go index 688527e0f85..ec958316649 100644 --- a/protoc-gen-grpc-gateway/descriptor/types_test.go +++ b/protoc-gen-grpc-gateway/descriptor/types_test.go @@ -151,7 +151,9 @@ func TestGoOneofName(t *testing.T) { } } -func TestFieldPath(t *testing.T) { +// nestedExamples returns a pair of message descriptors for testing +// field paths to nested fields with them. +func nestedExamples(t *testing.T) (proto3, proto2 *Message) { var fds []*descriptor.FileDescriptorProto for _, src := range []string{ ` @@ -172,6 +174,16 @@ func TestFieldPath(t *testing.T) { type: TYPE_STRING number: 2 > + field < + name: 'oneof_opt' + label: LABEL_OPTIONAL + type: TYPE_INT32 + number: 3 + oneof_index: 0 + > + oneof_decl < + name: 'oneof_field' + > > syntax: "proto3" `, ` @@ -192,6 +204,7 @@ func TestFieldPath(t *testing.T) { type: TYPE_STRING number: 2 > + # NOTE: oneof field is not supported in proto2 syntax > syntax: "proto2" `, @@ -202,14 +215,15 @@ func TestFieldPath(t *testing.T) { } fds = append(fds, &fd) } - nest := &Message{ + proto3 = &Message{ DescriptorProto: fds[0].MessageType[0], Fields: []*Field{ {FieldDescriptorProto: fds[0].MessageType[0].Field[0]}, {FieldDescriptorProto: fds[0].MessageType[0].Field[1]}, + {FieldDescriptorProto: fds[0].MessageType[0].Field[2]}, }, } - nest2 := &Message{ + proto2 = &Message{ DescriptorProto: fds[1].MessageType[0], Fields: []*Field{ {FieldDescriptorProto: fds[1].MessageType[0].Field[0]}, @@ -219,19 +233,25 @@ func TestFieldPath(t *testing.T) { file1 := &File{ FileDescriptorProto: fds[0], GoPkg: GoPackage{Path: "example", Name: "example"}, - Messages: []*Message{nest}, + Messages: []*Message{proto3}, } file2 := &File{ FileDescriptorProto: fds[1], GoPkg: GoPackage{Path: "example", Name: "example"}, - Messages: []*Message{nest2}, + Messages: []*Message{proto2}, } crossLinkFixture(file1) crossLinkFixture(file2) + return proto3, proto2 +} + +func TestFieldPath(t *testing.T) { + proto3, proto2 := nestedExamples(t) + c1 := FieldPathComponent{ Name: "nest_field", - Target: nest2.Fields[0], + Target: proto2.Fields[0], } if got, want := c1.LHS(), "GetNestField()"; got != want { t.Errorf("c1.LHS() = %q; want %q", got, want) @@ -242,7 +262,7 @@ func TestFieldPath(t *testing.T) { c2 := FieldPathComponent{ Name: "nest2_field", - Target: nest.Fields[0], + Target: proto3.Fields[0], } if got, want := c2.LHS(), "Nest2Field"; got != want { t.Errorf("c2.LHS() = %q; want %q", got, want) @@ -254,7 +274,7 @@ func TestFieldPath(t *testing.T) { fp := FieldPath{ c1, c2, c1, FieldPathComponent{ Name: "terminal_field", - Target: nest.Fields[1], + Target: proto3.Fields[1], }, } if got, want := fp.RHS("resp"), "resp.GetNestField().Nest2Field.GetNestField().TerminalField"; got != want { @@ -264,7 +284,7 @@ func TestFieldPath(t *testing.T) { fp2 := FieldPath{ c2, c1, c2, FieldPathComponent{ Name: "terminal_field", - Target: nest2.Fields[1], + Target: proto2.Fields[1], }, } if got, want := fp2.RHS("resp"), "resp.Nest2Field.GetNestField().Nest2Field.TerminalField"; got != want { @@ -276,3 +296,26 @@ func TestFieldPath(t *testing.T) { t.Errorf("fpEmpty.RHS(%q) = %q; want %q", "resp", got, want) } } + +func TestOneofFieldPath(t *testing.T) { + proto3, proto2 := nestedExamples(t) + + c1 := FieldPathComponent{ + Name: "nest_field", + Target: proto2.Fields[0], + } + c2 := FieldPathComponent{ + Name: "nest2_field", + Target: proto3.Fields[0], + } + + fp := FieldPath{ + c1, c2, c1, FieldPathComponent{ + Name: "oneof_opt", + Target: proto3.Fields[2], + }, + } + if got, want := fp.RHS("resp"), "resp.GetNestField().Nest2Field.GetNestField().alloc_OneofOpt().OneofOpt"; got != want { + t.Errorf("fp.RHS(%q) = %q; want %q", "resp", got, want) + } +} From 65b1c2af97612528075fadbf5771230204c76802 Mon Sep 17 00:00:00 2001 From: Yuki Yugui Sonoda Date: Sat, 17 Jun 2017 12:02:12 +0900 Subject: [PATCH 3/4] Add a integration test for oneof fields in body --- .../clients/abe/ABitOfEverythingServiceApi.go | 68 +++++++- examples/examplepb/a_bit_of_everything.pb.go | 165 +++++++++--------- .../examplepb/a_bit_of_everything.pb.gw.go | 54 ++++++ examples/examplepb/a_bit_of_everything.proto | 6 + .../a_bit_of_everything.swagger.json | 26 +++ examples/integration_test.go | 36 ++++ 6 files changed, 269 insertions(+), 86 deletions(-) diff --git a/examples/clients/abe/ABitOfEverythingServiceApi.go b/examples/clients/abe/ABitOfEverythingServiceApi.go index fcc60763608..d6b3db48a7e 100644 --- a/examples/clients/abe/ABitOfEverythingServiceApi.go +++ b/examples/clients/abe/ABitOfEverythingServiceApi.go @@ -197,6 +197,66 @@ func (a ABitOfEverythingServiceApi) DeepPathEcho (singleNestedName string, body break // only use the first Accept } +// body params + _sling = _sling.BodyJSON(body) + + var successPayload = new(ExamplepbABitOfEverything) + + // We use this map (below) so that any arbitrary error JSON can be handled. + // FIXME: This is in the absence of this Go generator honoring the non-2xx + // response (error) models, which needs to be implemented at some point. + var failurePayload map[string]interface{} + + httpResponse, err := _sling.Receive(successPayload, &failurePayload) + + if err == nil { + // err == nil only means that there wasn't a sub-application-layer error (e.g. no network error) + if failurePayload != nil { + // If the failurePayload is present, there likely was some kind of non-2xx status + // returned (and a JSON payload error present) + var str []byte + str, err = json.Marshal(failurePayload) + if err == nil { // For safety, check for an error marshalling... probably superfluous + // This will return the JSON error body as a string + err = errors.New(string(str)) + } + } else { + // So, there was no network-type error, and nothing in the failure payload, + // but we should still check the status code + if httpResponse == nil { + // This should never happen... + err = errors.New("No HTTP Response received.") + } else if code := httpResponse.StatusCode; 200 > code || code > 299 { + err = errors.New("HTTP Error: " + string(httpResponse.StatusCode)) + } + } + } + + return *successPayload, err +} +/** + * + * + * @param body + * @return ExamplepbABitOfEverything + */ +//func (a ABitOfEverythingServiceApi) DeepPathEcho_1 (body string) (ExamplepbABitOfEverything, error) { +func (a ABitOfEverythingServiceApi) DeepPathEcho_1 (body string) (ExamplepbABitOfEverything, error) { + + _sling := sling.New().Post(a.basePath) + + // create path and map variables + path := "/v2/example/oneof/echo" + + _sling = _sling.Path(path) + + // accept header + accepts := []string { "application/json" } + for key := range accepts { + _sling = _sling.Set("Accept", accepts[key]) + break // only use the first Accept + } + // body params _sling = _sling.BodyJSON(body) @@ -358,8 +418,8 @@ func (a ABitOfEverythingServiceApi) Echo (value string) (SubStringMessage, error * @param value * @return SubStringMessage */ -//func (a ABitOfEverythingServiceApi) Echo_1 (value string) (SubStringMessage, error) { -func (a ABitOfEverythingServiceApi) Echo_1 (value string) (SubStringMessage, error) { +//func (a ABitOfEverythingServiceApi) Echo_2 (value string) (SubStringMessage, error) { +func (a ABitOfEverythingServiceApi) Echo_2 (value string) (SubStringMessage, error) { _sling := sling.New().Get(a.basePath) @@ -421,8 +481,8 @@ func (a ABitOfEverythingServiceApi) Echo_1 (value string) (SubStringMessage, err * @param body * @return SubStringMessage */ -//func (a ABitOfEverythingServiceApi) Echo_2 (body string) (SubStringMessage, error) { -func (a ABitOfEverythingServiceApi) Echo_2 (body string) (SubStringMessage, error) { +//func (a ABitOfEverythingServiceApi) Echo_3 (body string) (SubStringMessage, error) { +func (a ABitOfEverythingServiceApi) Echo_3 (body string) (SubStringMessage, error) { _sling := sling.New().Post(a.basePath) diff --git a/examples/examplepb/a_bit_of_everything.pb.go b/examples/examplepb/a_bit_of_everything.pb.go index 30afc97d2d6..a1909ea11de 100644 --- a/examples/examplepb/a_bit_of_everything.pb.go +++ b/examples/examplepb/a_bit_of_everything.pb.go @@ -871,87 +871,88 @@ var _AnotherServiceWithNoBindings_serviceDesc = grpc.ServiceDesc{ func init() { proto.RegisterFile("examples/examplepb/a_bit_of_everything.proto", fileDescriptor1) } var fileDescriptor1 = []byte{ - // 1297 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x57, 0x4f, 0x6f, 0x1b, 0x45, - 0x14, 0xcf, 0xd8, 0x89, 0x13, 0x3f, 0xc7, 0x89, 0x33, 0x69, 0x53, 0xd7, 0x2d, 0x64, 0x71, 0x01, - 0xad, 0x42, 0xb5, 0xab, 0xba, 0x15, 0x6a, 0x23, 0x41, 0x95, 0x34, 0x86, 0x22, 0xda, 0xb4, 0xdd, - 0xfe, 0x41, 0x8a, 0x5a, 0xac, 0xb5, 0x3d, 0xb6, 0x57, 0xf1, 0xee, 0x2c, 0xbb, 0xb3, 0x26, 0x96, - 0x31, 0x07, 0x0e, 0x5c, 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 0x42, 0xed, 0xa6, 0x36, - 0x23, 0x05, 0xda, 0x24, 0x92, 0xb6, 0xcf, 0xed, 0x8d, 0x65, 0x01, 0x27, 0x56, 0x18, 0xc3, 0x7c, - 0x10, 0x58, 0xed, 0x32, 0x52, 0x90, 0x9a, 0x37, 0xf8, 0x37, 0x7e, 0x08, 0x39, 0xc9, 0x95, 0x51, - 0xb2, 0x6f, 0xc4, 0x25, 0x71, 0xf0, 0x26, 0x14, 0x3a, 0x7d, 0x6a, 0xb2, 0xc6, 0xc0, 0xec, 0x07, - 0xa4, 0x9c, 0x55, 0x90, 0x9a, 0x31, 0x80, 0x6f, 0x3d, 0x0b, 0x77, 0xf0, 0x7b, 0xb0, 0xdc, 0xa6, - 0x41, 0xb3, 0x4f, 0xa4, 0xc6, 0xbc, 0x82, 0x54, 0x64, 0x14, 0xc4, 0x9e, 0x50, 0xd9, 0x84, 0x82, - 0xe5, 0xb0, 0x8f, 0x6f, 0x48, 0x8d, 0x05, 0x05, 0xa9, 0x59, 0x03, 0xf8, 0x56, 0x8c, 0x11, 0x24, - 0x35, 0x72, 0x0a, 0x52, 0xe7, 0x8d, 0x42, 0x90, 0x50, 0x11, 0x18, 0xd7, 0x6b, 0x52, 0x63, 0x51, - 0x41, 0xea, 0x02, 0xc7, 0xb8, 0x5e, 0x13, 0x0a, 0x57, 0xa0, 0xd8, 0xb1, 0x8e, 0x48, 0x3b, 0x06, - 0x59, 0x52, 0x90, 0x9a, 0x33, 0x96, 0xe5, 0x66, 0x5a, 0x29, 0xc6, 0xc9, 0x2b, 0x48, 0x5d, 0x94, - 0x4a, 0x11, 0xd2, 0x3b, 0x00, 0x4d, 0x4a, 0xfb, 0x52, 0x03, 0x14, 0xa4, 0x2e, 0x19, 0xf9, 0x70, - 0x27, 0x76, 0xd6, 0x67, 0x9e, 0xe5, 0x74, 0xa5, 0x42, 0x81, 0xe7, 0xbf, 0x20, 0xf6, 0x52, 0xf1, - 0xc4, 0x2c, 0x45, 0x05, 0xa9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x46, 0x6d, + 0x43, 0x34, 0xda, 0xe4, 0x20, 0xde, 0x58, 0xb3, 0xbe, 0xcb, 0x5d, 0x7a, 0x39, 0xd9, 0x25, 0xb2, + 0xbb, 0x4f, 0xcd, 0x81, 0x28, 0xa3, 0x9d, 0xcb, 0xf5, 0x8a, 0x79, 0xd8, 0x48, 0xf5, 0x63, 0xd9, + 0xba, 0x68, 0x9c, 0x3b, 0x18, 0x1f, 0x13, 0xe1, 0xbf, 0x11, 0xcc, 0xc7, 0xb3, 0xe9, 0x91, 0xcd, + 0xf6, 0x79, 0x24, 0x6f, 0xa7, 0xb8, 0xba, 0x3c, 0x36, 0xbb, 0x7e, 0x7b, 0x62, 0xda, 0x33, 0x7f, + 0x61, 0x46, 0x3c, 0xb9, 0xe3, 0xab, 0xb6, 0x73, 0xbd, 0xbe, 0xa2, 0xc6, 0xc2, 0x87, 0x81, 0x08, + 0x36, 0xf3, 0x94, 0xc4, 0x1b, 0x00, 0xdb, 0x74, 0xd3, 0xf1, 0x3a, 0x8e, 0xd7, 0x0d, 0xf1, 0xe5, + 0x63, 0xd9, 0xdf, 0x92, 0x7f, 0x99, 0x63, 0x2f, 0xc6, 0x14, 0x7e, 0x0e, 0xb3, 0xf1, 0x13, 0x86, + 0x46, 0x0c, 0x8f, 0x51, 0x1a, 0x6b, 0x7c, 0x85, 0x87, 0x79, 0x11, 0x2f, 0xab, 0xbe, 0x32, 0x01, + 0xd6, 0xf8, 0x0a, 0xae, 0x6e, 0x78, 0x94, 0xed, 0x93, 0x40, 0x0e, 0xa2, 0x2f, 0x1d, 0xb6, 0xaf, + 0x38, 0xfb, 0x71, 0xc6, 0xf5, 0xd3, 0x52, 0x4f, 0x6d, 0x96, 0x76, 0x8a, 0x69, 0x06, 0xda, 0x05, + 0x2e, 0xbe, 0xf5, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x39, 0xc0, 0x3f, 0x45, 0xf1, 0x0f, 0x00, 0x00, } diff --git a/examples/examplepb/a_bit_of_everything.pb.gw.go b/examples/examplepb/a_bit_of_everything.pb.gw.go index 052d5fab200..bcd3d77e494 100644 --- a/examples/examplepb/a_bit_of_everything.pb.gw.go +++ b/examples/examplepb/a_bit_of_everything.pb.gw.go @@ -442,6 +442,27 @@ func request_ABitOfEverythingService_DeepPathEcho_0(ctx context.Context, marshal } +var ( + filter_ABitOfEverythingService_DeepPathEcho_1 = &utilities.DoubleArray{Encoding: map[string]int{"oneof_string": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_ABitOfEverythingService_DeepPathEcho_1(ctx context.Context, marshaler runtime.Marshaler, client ABitOfEverythingServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ABitOfEverything + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.alloc_OneofString().OneofString); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_ABitOfEverythingService_DeepPathEcho_1); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.DeepPathEcho(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + func request_ABitOfEverythingService_Timeout_0(ctx context.Context, marshaler runtime.Marshaler, client ABitOfEverythingServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq empty.Empty var metadata runtime.ServerMetadata @@ -771,6 +792,35 @@ func RegisterABitOfEverythingServiceHandler(ctx context.Context, mux *runtime.Se }) + mux.Handle("POST", pattern_ABitOfEverythingService_DeepPathEcho_1, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(ctx) + 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_ABitOfEverythingService_DeepPathEcho_1(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ABitOfEverythingService_DeepPathEcho_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_ABitOfEverythingService_Timeout_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(ctx) defer cancel() @@ -824,6 +874,8 @@ var ( pattern_ABitOfEverythingService_DeepPathEcho_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "example", "a_bit_of_everything", "single_nested.name"}, "")) + pattern_ABitOfEverythingService_DeepPathEcho_1 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v2", "example", "oneof", "echo"}, "")) + pattern_ABitOfEverythingService_Timeout_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "example", "timeout"}, "")) ) @@ -848,6 +900,8 @@ var ( forward_ABitOfEverythingService_DeepPathEcho_0 = runtime.ForwardResponseMessage + forward_ABitOfEverythingService_DeepPathEcho_1 = runtime.ForwardResponseMessage + forward_ABitOfEverythingService_Timeout_0 = runtime.ForwardResponseMessage ) diff --git a/examples/examplepb/a_bit_of_everything.proto b/examples/examplepb/a_bit_of_everything.proto index 91e561e06a8..0468a4b9da8 100644 --- a/examples/examplepb/a_bit_of_everything.proto +++ b/examples/examplepb/a_bit_of_everything.proto @@ -122,6 +122,12 @@ service ABitOfEverythingService { option (google.api.http) = { post: "/v1/example/a_bit_of_everything/{single_nested.name}" body: "*" + + additional_bindings { + post: "/v2/example/oneof/echo" + // a oneof option in body + body: "oneof_string" + } }; } rpc NoBindings(google.protobuf.Duration) returns (google.protobuf.Empty) {} diff --git a/examples/examplepb/a_bit_of_everything.swagger.json b/examples/examplepb/a_bit_of_everything.swagger.json index 052b256b505..b58223246fd 100644 --- a/examples/examplepb/a_bit_of_everything.swagger.json +++ b/examples/examplepb/a_bit_of_everything.swagger.json @@ -544,6 +544,32 @@ ] } }, + "/v2/example/oneof/echo": { + "post": { + "operationId": "DeepPathEcho", + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/examplepbABitOfEverything" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "string" + } + } + ], + "tags": [ + "ABitOfEverythingService" + ] + } + }, "/v2/example/timeout": { "get": { "operationId": "Timeout", diff --git a/examples/integration_test.go b/examples/integration_test.go index 44a9fa7da21..1e31377c503 100644 --- a/examples/integration_test.go +++ b/examples/integration_test.go @@ -703,6 +703,42 @@ func testAdditionalBindings(t *testing.T, port int) { } } +func TestOneofInBody(t *testing.T) { + const ( + url = "http://localhost:8080/v2/example/oneof/echo" + payload = `"foo"` + ) + want := gw.ABitOfEverything{ + OneofValue: &gw.ABitOfEverything_OneofString{"foo"}, + } + + resp, err := http.Post(url, "application/json", strings.NewReader(payload)) + if err != nil { + t.Errorf("http.Post(%q) failed with %v; want success", url, err) + return + } + defer resp.Body.Close() + buf, err := ioutil.ReadAll(resp.Body) + if err != nil { + t.Errorf("iotuil.ReadAll(resp.Body) failed with %v; want success", err) + return + } + + if got, want := resp.StatusCode, http.StatusOK; got != want { + t.Errorf("resp.StatusCode = %d; want %d", got, want) + t.Logf("%s", buf) + } + + var got gw.ABitOfEverything + if err := jsonpb.UnmarshalString(string(buf), &got); err != nil { + t.Errorf("jsonpb.UnmarshalString(%s, &msg) failed with %v; want success", buf, err) + return + } + if !reflect.DeepEqual(got, want) { + t.Errorf("got = %v; want %v", got, want) + } +} + func TestTimeout(t *testing.T) { url := "http://localhost:8080/v2/example/timeout" req, err := http.NewRequest("GET", url, nil) From ea5acb0f103436a861e4c2914882cd97a68bfd2a Mon Sep 17 00:00:00 2001 From: Yuki Yugui Sonoda Date: Sat, 17 Jun 2017 12:05:55 +0900 Subject: [PATCH 4/4] Add an integration test for oneof fields in path parameters --- .../a_bit_of_everything_service.spec.js | 1 + examples/client_test.go | 2 + .../clients/abe/ABitOfEverythingServiceApi.go | 8 +- examples/examplepb/a_bit_of_everything.pb.go | 96 +++++++++---------- .../examplepb/a_bit_of_everything.pb.gw.go | 15 ++- examples/examplepb/a_bit_of_everything.proto | 2 +- .../a_bit_of_everything.swagger.json | 8 +- examples/integration_test.go | 4 +- 8 files changed, 80 insertions(+), 56 deletions(-) diff --git a/examples/browser/a_bit_of_everything_service.spec.js b/examples/browser/a_bit_of_everything_service.spec.js index edcbebe11d6..b197931e871 100644 --- a/examples/browser/a_bit_of_everything_service.spec.js +++ b/examples/browser/a_bit_of_everything_service.spec.js @@ -33,6 +33,7 @@ describe('ABitOfEverythingService', function() { sfixed64_value: "-4611686018427387904", sint32_value: 2147483647, sint64_value: "4611686018427387903", + oneof_string: "bar", nonConventionalNameValue: "camelCase", }; diff --git a/examples/client_test.go b/examples/client_test.go index 0574d9fbb0c..520c7d77876 100644 --- a/examples/client_test.go +++ b/examples/client_test.go @@ -71,6 +71,7 @@ func testABEClientCreate(t *testing.T, cl *abe.ABitOfEverythingServiceApi) { Sfixed64Value: "-4611686018427387904", Sint32Value: 2147483647, Sint64Value: "4611686018427387903", + OneofString: "bar", NonConventionalNameValue: "camelCase", } resp, err := cl.Create( @@ -88,6 +89,7 @@ func testABEClientCreate(t *testing.T, cl *abe.ABitOfEverythingServiceApi) { want.Sfixed64Value, want.Sint32Value, want.Sint64Value, + want.OneofString, want.NonConventionalNameValue, ) if err != nil { diff --git a/examples/clients/abe/ABitOfEverythingServiceApi.go b/examples/clients/abe/ABitOfEverythingServiceApi.go index d6b3db48a7e..ae9be3e1870 100644 --- a/examples/clients/abe/ABitOfEverythingServiceApi.go +++ b/examples/clients/abe/ABitOfEverythingServiceApi.go @@ -42,16 +42,17 @@ func NewABitOfEverythingServiceApiWithBasePath(basePath string) *ABitOfEverythin * @param sfixed64Value * @param sint32Value * @param sint64Value + * @param oneofString * @param nonConventionalNameValue * @return ExamplepbABitOfEverything */ -//func (a ABitOfEverythingServiceApi) Create (floatValue float32, doubleValue float64, int64Value string, uint64Value string, int32Value int32, fixed64Value string, fixed32Value int64, boolValue bool, stringValue string, uint32Value int64, sfixed32Value int32, sfixed64Value string, sint32Value int32, sint64Value string, nonConventionalNameValue string) (ExamplepbABitOfEverything, error) { -func (a ABitOfEverythingServiceApi) Create (floatValue float32, doubleValue float64, int64Value string, uint64Value string, int32Value int32, fixed64Value string, fixed32Value int64, boolValue bool, stringValue string, uint32Value int64, sfixed32Value int32, sfixed64Value string, sint32Value int32, sint64Value string, nonConventionalNameValue string) (ExamplepbABitOfEverything, error) { +//func (a ABitOfEverythingServiceApi) Create (floatValue float32, doubleValue float64, int64Value string, uint64Value string, int32Value int32, fixed64Value string, fixed32Value int64, boolValue bool, stringValue string, uint32Value int64, sfixed32Value int32, sfixed64Value string, sint32Value int32, sint64Value string, oneofString string, nonConventionalNameValue string) (ExamplepbABitOfEverything, error) { +func (a ABitOfEverythingServiceApi) Create (floatValue float32, doubleValue float64, int64Value string, uint64Value string, int32Value int32, fixed64Value string, fixed32Value int64, boolValue bool, stringValue string, uint32Value int64, sfixed32Value int32, sfixed64Value string, sint32Value int32, sint64Value string, oneofString string, nonConventionalNameValue string) (ExamplepbABitOfEverything, error) { _sling := sling.New().Post(a.basePath) // create path and map variables - path := "/v1/example/a_bit_of_everything/{float_value}/{double_value}/{int64_value}/separator/{uint64_value}/{int32_value}/{fixed64_value}/{fixed32_value}/{bool_value}/{string_value}/{uint32_value}/{sfixed32_value}/{sfixed64_value}/{sint32_value}/{sint64_value}/{nonConventionalNameValue}" + path := "/v1/example/a_bit_of_everything/{float_value}/{double_value}/{int64_value}/separator/{uint64_value}/{int32_value}/{fixed64_value}/{fixed32_value}/{bool_value}/{string_value}/{uint32_value}/{sfixed32_value}/{sfixed64_value}/{sint32_value}/{sint64_value}/{oneof_string}/{nonConventionalNameValue}" path = strings.Replace(path, "{" + "float_value" + "}", fmt.Sprintf("%v", floatValue), -1) path = strings.Replace(path, "{" + "double_value" + "}", fmt.Sprintf("%v", doubleValue), -1) path = strings.Replace(path, "{" + "int64_value" + "}", fmt.Sprintf("%v", int64Value), -1) @@ -66,6 +67,7 @@ func (a ABitOfEverythingServiceApi) Create (floatValue float32, doubleValue floa path = strings.Replace(path, "{" + "sfixed64_value" + "}", fmt.Sprintf("%v", sfixed64Value), -1) path = strings.Replace(path, "{" + "sint32_value" + "}", fmt.Sprintf("%v", sint32Value), -1) path = strings.Replace(path, "{" + "sint64_value" + "}", fmt.Sprintf("%v", sint64Value), -1) + path = strings.Replace(path, "{" + "oneof_string" + "}", fmt.Sprintf("%v", oneofString), -1) path = strings.Replace(path, "{" + "nonConventionalNameValue" + "}", fmt.Sprintf("%v", nonConventionalNameValue), -1) _sling = _sling.Path(path) diff --git a/examples/examplepb/a_bit_of_everything.pb.go b/examples/examplepb/a_bit_of_everything.pb.go index a1909ea11de..1b3b8f22d89 100644 --- a/examples/examplepb/a_bit_of_everything.pb.go +++ b/examples/examplepb/a_bit_of_everything.pb.go @@ -871,17 +871,17 @@ var _AnotherServiceWithNoBindings_serviceDesc = grpc.ServiceDesc{ func init() { proto.RegisterFile("examples/examplepb/a_bit_of_everything.proto", fileDescriptor1) } var fileDescriptor1 = []byte{ - // 1313 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x57, 0xcf, 0x6e, 0xdb, 0x46, - 0x13, 0xf7, 0x4a, 0xb6, 0x6c, 0x8d, 0x2c, 0x5b, 0x5e, 0x27, 0x8e, 0xa2, 0xe4, 0xfb, 0xcc, 0x2a, - 0x6d, 0x40, 0xb8, 0x01, 0x89, 0x28, 0x41, 0x91, 0x1a, 0x68, 0x0b, 0x3b, 0x56, 0x9b, 0xa2, 0x89, - 0x93, 0x30, 0x7f, 0x0a, 0x18, 0x49, 0x05, 0xca, 0x5a, 0xcb, 0x84, 0x45, 0x2e, 0x4b, 0x2e, 0x5d, - 0x0b, 0xaa, 0x7a, 0xe8, 0xa1, 0x97, 0x5e, 0x0a, 0xf4, 0x9e, 0x4b, 0x81, 0xa2, 0x97, 0x3e, 0x43, - 0xfb, 0x0e, 0x3d, 0xf7, 0xd6, 0x07, 0x29, 0xb8, 0xbb, 0x64, 0x96, 0xb2, 0x05, 0xc5, 0x76, 0x91, - 0x1b, 0x77, 0x67, 0xe6, 0xf7, 0x9b, 0xd9, 0xd9, 0x99, 0x59, 0xc2, 0x0d, 0x72, 0x64, 0xbb, 0x7e, + // 1318 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x57, 0xcf, 0x6f, 0x1b, 0xc5, + 0x17, 0xcf, 0xd8, 0x89, 0x13, 0x3f, 0xc7, 0x89, 0x33, 0x69, 0x53, 0xd7, 0xed, 0xf7, 0x9b, 0xc5, + 0x85, 0x6a, 0x15, 0xaa, 0x5d, 0xd5, 0xad, 0x50, 0x89, 0x04, 0x28, 0x69, 0x0c, 0x45, 0xb4, 0x69, + 0xbb, 0xfd, 0x81, 0x14, 0xb5, 0x58, 0xeb, 0x78, 0xe2, 0xac, 0xe2, 0xdd, 0x59, 0x76, 0x67, 0x43, + 0x2c, 0x63, 0x0e, 0x1c, 0xb8, 0x70, 0xe4, 0x0e, 0x57, 0x2e, 0x5c, 0x90, 0xb8, 0x21, 0xc1, 0xff, + 0xc0, 0x99, 0x1b, 0x7f, 0x08, 0xda, 0x99, 0xd9,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 0xf8, 0x41, 0xc8, 0x02, + 0x3f, 0x20, 0x7b, 0xce, 0x91, 0xb9, 0x36, 0x14, 0x24, 0x8a, 0x59, 0x38, 0x8a, 0x13, 0x8e, 0x12, + 0x85, 0x23, 0x06, 0x59, 0x27, 0xd5, 0x11, 0x30, 0x34, 0x07, 0xe3, 0x5a, 0xcf, 0x10, 0xff, 0x88, + 0x00, 0x44, 0xbe, 0x36, 0x69, 0xa7, 0xff, 0x86, 0x72, 0xb6, 0xc6, 0x53, 0xf6, 0x76, 0x7d, 0x75, + 0x42, 0xc2, 0xd6, 0xd1, 0x1a, 0xfe, 0x1a, 0x0a, 0xf7, 0x29, 0x3d, 0x88, 0x7c, 0xbc, 0x68, 0xc4, + 0x2f, 0x52, 0xe3, 0xd3, 0xce, 0x03, 0xf1, 0x26, 0x3d, 0x0b, 0xb3, 0xc1, 0x99, 0x75, 0x7c, 0x7d, + 0xe2, 0x55, 0x89, 0x9f, 0x91, 0x43, 0xfc, 0x1d, 0x82, 0xc2, 0x33, 0xbf, 0x73, 0xc6, 0xeb, 0x3c, + 0x66, 0x62, 0xd7, 0x6f, 0x72, 0x2f, 0xde, 0xad, 0xbd, 0xa6, 0x17, 0xf1, 0x31, 0xd8, 0x50, 0xd8, + 0x22, 0x3d, 0xc2, 0xc8, 0xf1, 0x63, 0x18, 0xc7, 0x22, 0x63, 0x5d, 0x7b, 0xdd, 0x58, 0xbf, 0x47, + 0x30, 0xf7, 0x09, 0x61, 0x8f, 0x23, 0x12, 0xf4, 0xff, 0xcb, 0x68, 0x6f, 0x73, 0x3f, 0x0c, 0x7c, + 0x63, 0x92, 0x1f, 0x5f, 0xc6, 0xcc, 0x89, 0x37, 0x7f, 0x20, 0x98, 0x6e, 0xee, 0xee, 0x53, 0xac, + 0x8f, 0xf1, 0x24, 0x8c, 0xda, 0x86, 0xe8, 0xbb, 0xc9, 0x41, 0xbc, 0xb6, 0x66, 0x7d, 0x97, 0xbb, + 0xf4, 0x72, 0xb2, 0x4b, 0x64, 0x77, 0x9f, 0x9a, 0x03, 0x51, 0x55, 0x3b, 0x97, 0xeb, 0x15, 0xf3, + 0xb0, 0x91, 0xea, 0xc7, 0xb2, 0x75, 0xd1, 0x47, 0x77, 0x30, 0x3e, 0x26, 0xc2, 0x7f, 0x23, 0x98, + 0x8f, 0x47, 0xd5, 0x23, 0x9b, 0xed, 0xf3, 0x48, 0xde, 0x4c, 0x71, 0x75, 0x79, 0x6c, 0x76, 0xfd, + 0xf6, 0xc4, 0xb4, 0x67, 0x7e, 0xca, 0x8c, 0x78, 0x90, 0xc7, 0x57, 0x6d, 0xe7, 0x7a, 0x7d, 0x45, + 0x8d, 0x85, 0xb7, 0x12, 0x11, 0x6c, 0xe6, 0x65, 0x89, 0x37, 0x00, 0xb6, 0xe9, 0xa6, 0xe3, 0x75, + 0x1c, 0xaf, 0x1b, 0xe2, 0xcb, 0xc7, 0xb2, 0xbf, 0x25, 0x7f, 0x3a, 0xc7, 0x5e, 0x8c, 0x29, 0xfc, + 0x1c, 0x66, 0xe3, 0x17, 0x0d, 0x8d, 0x18, 0x1e, 0xa3, 0x34, 0xd6, 0xf8, 0x0a, 0x0f, 0xf3, 0x22, + 0x5e, 0x56, 0x7d, 0x65, 0x02, 0xac, 0xf1, 0x05, 0x5c, 0xdd, 0xf0, 0x28, 0xdb, 0x27, 0x81, 0x9c, + 0x4b, 0x9f, 0x3b, 0x6c, 0x5f, 0x71, 0xf6, 0xc3, 0x8c, 0xeb, 0xa7, 0xa5, 0x9e, 0xda, 0x2c, 0xed, + 0x14, 0xd3, 0x0c, 0xb4, 0x0b, 0x5c, 0x7c, 0xeb, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xde, 0x2e, + 0x28, 0x3f, 0x00, 0x10, 0x00, 0x00, } diff --git a/examples/examplepb/a_bit_of_everything.pb.gw.go b/examples/examplepb/a_bit_of_everything.pb.gw.go index bcd3d77e494..c4f7473319c 100644 --- a/examples/examplepb/a_bit_of_everything.pb.gw.go +++ b/examples/examplepb/a_bit_of_everything.pb.gw.go @@ -33,7 +33,7 @@ var _ = runtime.String var _ = utilities.NewDoubleArray var ( - filter_ABitOfEverythingService_Create_0 = &utilities.DoubleArray{Encoding: map[string]int{"float_value": 0, "double_value": 1, "int64_value": 2, "uint64_value": 3, "int32_value": 4, "fixed64_value": 5, "fixed32_value": 6, "bool_value": 7, "string_value": 8, "uint32_value": 9, "sfixed32_value": 10, "sfixed64_value": 11, "sint32_value": 12, "sint64_value": 13, "nonConventionalNameValue": 14}, Base: []int{1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, Check: []int{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}} + filter_ABitOfEverythingService_Create_0 = &utilities.DoubleArray{Encoding: map[string]int{"float_value": 0, "double_value": 1, "int64_value": 2, "uint64_value": 3, "int32_value": 4, "fixed64_value": 5, "fixed32_value": 6, "bool_value": 7, "string_value": 8, "uint32_value": 9, "sfixed32_value": 10, "sfixed64_value": 11, "sint32_value": 12, "sint64_value": 13, "oneof_string": 14, "nonConventionalNameValue": 15}, Base: []int{1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, Check: []int{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17}} ) func request_ABitOfEverythingService_Create_0(ctx context.Context, marshaler runtime.Marshaler, client ABitOfEverythingServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -201,6 +201,17 @@ func request_ABitOfEverythingService_Create_0(ctx context.Context, marshaler run return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "sint64_value", err) } + val, ok = pathParams["oneof_string"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "oneof_string") + } + + protoReq.alloc_OneofString().OneofString, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "oneof_string", err) + } + val, ok = pathParams["nonConventionalNameValue"] if !ok { return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "nonConventionalNameValue") @@ -854,7 +865,7 @@ func RegisterABitOfEverythingServiceHandler(ctx context.Context, mux *runtime.Se } var ( - pattern_ABitOfEverythingService_Create_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5, 2, 6, 1, 0, 4, 1, 5, 7, 1, 0, 4, 1, 5, 8, 1, 0, 4, 1, 5, 9, 1, 0, 4, 1, 5, 10, 1, 0, 4, 1, 5, 11, 2, 12, 1, 0, 4, 2, 5, 13, 1, 0, 4, 1, 5, 14, 1, 0, 4, 1, 5, 15, 1, 0, 4, 1, 5, 16, 1, 0, 4, 1, 5, 17, 1, 0, 4, 1, 5, 18, 1, 0, 4, 1, 5, 19}, []string{"v1", "example", "a_bit_of_everything", "float_value", "double_value", "int64_value", "separator", "uint64_value", "int32_value", "fixed64_value", "fixed32_value", "bool_value", "strprefix", "string_value", "uint32_value", "sfixed32_value", "sfixed64_value", "sint32_value", "sint64_value", "nonConventionalNameValue"}, "")) + pattern_ABitOfEverythingService_Create_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5, 2, 6, 1, 0, 4, 1, 5, 7, 1, 0, 4, 1, 5, 8, 1, 0, 4, 1, 5, 9, 1, 0, 4, 1, 5, 10, 1, 0, 4, 1, 5, 11, 2, 12, 1, 0, 4, 2, 5, 13, 1, 0, 4, 1, 5, 14, 1, 0, 4, 1, 5, 15, 1, 0, 4, 1, 5, 16, 1, 0, 4, 1, 5, 17, 1, 0, 4, 1, 5, 18, 1, 0, 4, 1, 5, 19, 1, 0, 4, 1, 5, 20}, []string{"v1", "example", "a_bit_of_everything", "float_value", "double_value", "int64_value", "separator", "uint64_value", "int32_value", "fixed64_value", "fixed32_value", "bool_value", "strprefix", "string_value", "uint32_value", "sfixed32_value", "sfixed64_value", "sint32_value", "sint64_value", "oneof_string", "nonConventionalNameValue"}, "")) pattern_ABitOfEverythingService_CreateBody_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "example", "a_bit_of_everything"}, "")) diff --git a/examples/examplepb/a_bit_of_everything.proto b/examples/examplepb/a_bit_of_everything.proto index 0468a4b9da8..9b99c04b8fd 100644 --- a/examples/examplepb/a_bit_of_everything.proto +++ b/examples/examplepb/a_bit_of_everything.proto @@ -76,7 +76,7 @@ service ABitOfEverythingService { rpc Create(ABitOfEverything) returns (ABitOfEverything) { // TODO add enum_value option (google.api.http) = { - post: "/v1/example/a_bit_of_everything/{float_value}/{double_value}/{int64_value}/separator/{uint64_value}/{int32_value}/{fixed64_value}/{fixed32_value}/{bool_value}/{string_value=strprefix/*}/{uint32_value}/{sfixed32_value}/{sfixed64_value}/{sint32_value}/{sint64_value}/{nonConventionalNameValue}" + post: "/v1/example/a_bit_of_everything/{float_value}/{double_value}/{int64_value}/separator/{uint64_value}/{int32_value}/{fixed64_value}/{fixed32_value}/{bool_value}/{string_value=strprefix/*}/{uint32_value}/{sfixed32_value}/{sfixed64_value}/{sint32_value}/{sint64_value}/{oneof_string}/{nonConventionalNameValue}" }; } rpc CreateBody(ABitOfEverything) returns (ABitOfEverything) { diff --git a/examples/examplepb/a_bit_of_everything.swagger.json b/examples/examplepb/a_bit_of_everything.swagger.json index b58223246fd..34c0aca4312 100644 --- a/examples/examplepb/a_bit_of_everything.swagger.json +++ b/examples/examplepb/a_bit_of_everything.swagger.json @@ -267,7 +267,7 @@ ] } }, - "/v1/example/a_bit_of_everything/{float_value}/{double_value}/{int64_value}/separator/{uint64_value}/{int32_value}/{fixed64_value}/{fixed32_value}/{bool_value}/{string_value}/{uint32_value}/{sfixed32_value}/{sfixed64_value}/{sint32_value}/{sint64_value}/{nonConventionalNameValue}": { + "/v1/example/a_bit_of_everything/{float_value}/{double_value}/{int64_value}/separator/{uint64_value}/{int32_value}/{fixed64_value}/{fixed32_value}/{bool_value}/{string_value}/{uint32_value}/{sfixed32_value}/{sfixed64_value}/{sint32_value}/{sint64_value}/{oneof_string}/{nonConventionalNameValue}": { "post": { "operationId": "Create", "responses": { @@ -376,6 +376,12 @@ "type": "string", "format": "int64" }, + { + "name": "oneof_string", + "in": "path", + "required": true, + "type": "string" + }, { "name": "nonConventionalNameValue", "in": "path", diff --git a/examples/integration_test.go b/examples/integration_test.go index 1e31377c503..3a2236239ae 100644 --- a/examples/integration_test.go +++ b/examples/integration_test.go @@ -160,6 +160,7 @@ func TestABE(t *testing.T) { } func testABECreate(t *testing.T, port int) { + const oneofStr = "bar" want := gw.ABitOfEverything{ FloatValue: 1.5, DoubleValue: 2.5, @@ -175,9 +176,10 @@ func testABECreate(t *testing.T, port int) { Sfixed64Value: -4611686018427387904, Sint32Value: 2147483647, Sint64Value: 4611686018427387903, + OneofValue: &gw.ABitOfEverything_OneofString{oneofStr}, NonConventionalNameValue: "camelCase", } - url := fmt.Sprintf("http://localhost:%d/v1/example/a_bit_of_everything/%f/%f/%d/separator/%d/%d/%d/%d/%v/%s/%d/%d/%d/%d/%d/%s", port, want.FloatValue, want.DoubleValue, want.Int64Value, want.Uint64Value, want.Int32Value, want.Fixed64Value, want.Fixed32Value, want.BoolValue, want.StringValue, want.Uint32Value, want.Sfixed32Value, want.Sfixed64Value, want.Sint32Value, want.Sint64Value, want.NonConventionalNameValue) + url := fmt.Sprintf("http://localhost:%d/v1/example/a_bit_of_everything/%f/%f/%d/separator/%d/%d/%d/%d/%v/%s/%d/%d/%d/%d/%d/%s/%s", port, want.FloatValue, want.DoubleValue, want.Int64Value, want.Uint64Value, want.Int32Value, want.Fixed64Value, want.Fixed32Value, want.BoolValue, want.StringValue, want.Uint32Value, want.Sfixed32Value, want.Sfixed64Value, want.Sint32Value, want.Sint64Value, oneofStr, want.NonConventionalNameValue) resp, err := http.Post(url, "application/json", strings.NewReader("{}")) if err != nil {