diff --git a/examples/example-gateway/build/endpoints/bar/endpoint.go b/examples/example-gateway/build/endpoints/bar/endpoint.go index 42c89ecce..f53bb6897 100644 --- a/examples/example-gateway/build/endpoints/bar/endpoint.go +++ b/examples/example-gateway/build/endpoints/bar/endpoint.go @@ -46,9 +46,9 @@ func NewEndpoint(deps *module.Dependencies) Endpoint { BarArgWithParamsAndDuplicateFieldsHandler: NewBarArgWithParamsAndDuplicateFieldsHandler(deps), BarArgWithQueryHeaderHandler: NewBarArgWithQueryHeaderHandler(deps), BarArgWithQueryParamsHandler: NewBarArgWithQueryParamsHandler(deps), + BarDeleteWithBodyHandler: NewBarDeleteWithBodyHandler(deps), BarHelloWorldHandler: NewBarHelloWorldHandler(deps), BarListAndEnumHandler: NewBarListAndEnumHandler(deps), - BarDeleteWithBodyHandler: NewBarDeleteWithBodyHandler(deps), BarMissingArgHandler: NewBarMissingArgHandler(deps), BarNoRequestHandler: NewBarNoRequestHandler(deps), BarNormalHandler: NewBarNormalHandler(deps), @@ -64,16 +64,12 @@ type EndpointHandlers struct { BarArgWithNearDupQueryParamsHandler *BarArgWithNearDupQueryParamsHandler BarArgWithNestedQueryParamsHandler *BarArgWithNestedQueryParamsHandler BarArgWithParamsHandler *BarArgWithParamsHandler -<<<<<<< HEAD BarArgWithParamsAndDuplicateFieldsHandler *BarArgWithParamsAndDuplicateFieldsHandler BarArgWithQueryHeaderHandler *BarArgWithQueryHeaderHandler BarArgWithQueryParamsHandler *BarArgWithQueryParamsHandler + BarDeleteWithBodyHandler *BarDeleteWithBodyHandler BarHelloWorldHandler *BarHelloWorldHandler BarListAndEnumHandler *BarListAndEnumHandler -======= - BarArgWithManyQueryParamsHandler *BarArgWithManyQueryParamsHandler - BarDeleteWithBodyHandler *BarDeleteWithBodyHandler ->>>>>>> Add a test endpoint to exercise the DELETE with body code path BarMissingArgHandler *BarMissingArgHandler BarNoRequestHandler *BarNoRequestHandler BarNormalHandler *BarNormalHandler @@ -114,63 +110,35 @@ func (handlers *EndpointHandlers) Register(gateway *zanzibar.Gateway) error { if err7 != nil { return err7 } -<<<<<<< HEAD err8 := handlers.BarArgWithQueryParamsHandler.Register(gateway) if err8 != nil { return err8 } - err9 := handlers.BarHelloWorldHandler.Register(gateway) - if err9 != nil { - return err9 - } - err10 := handlers.BarListAndEnumHandler.Register(gateway) - if err10 != nil { - return err10 - } - err11 := handlers.BarMissingArgHandler.Register(gateway) - if err11 != nil { - return err11 - } - err12 := handlers.BarNoRequestHandler.Register(gateway) - if err12 != nil { - return err12 - } - err13 := handlers.BarNormalHandler.Register(gateway) - if err13 != nil { - return err13 - } - err14 := handlers.BarTooManyArgsHandler.Register(gateway) -======= - err8 := handlers.BarDeleteWithBodyHandler.Register(gateway) - if err8 != nil { - return err8 - } - err9 := handlers.BarMissingArgHandler.Register(gateway) + err9 := handlers.BarDeleteWithBodyHandler.Register(gateway) if err9 != nil { return err9 } - err10 := handlers.BarNoRequestHandler.Register(gateway) + err10 := handlers.BarHelloWorldHandler.Register(gateway) if err10 != nil { return err10 } - err11 := handlers.BarNormalHandler.Register(gateway) + err11 := handlers.BarListAndEnumHandler.Register(gateway) if err11 != nil { return err11 } - err12 := handlers.BarTooManyArgsHandler.Register(gateway) + err12 := handlers.BarMissingArgHandler.Register(gateway) if err12 != nil { return err12 } - err13 := handlers.BarHelloWorldHandler.Register(gateway) + err13 := handlers.BarNoRequestHandler.Register(gateway) if err13 != nil { return err13 } - err14 := handlers.BarListAndEnumHandler.Register(gateway) ->>>>>>> Add a test endpoint to exercise the DELETE with body code path + err14 := handlers.BarNormalHandler.Register(gateway) if err14 != nil { return err14 } - err15 := handlers.BarArgWithParamsAndDuplicateFieldsHandler.Register(gateway) + err15 := handlers.BarTooManyArgsHandler.Register(gateway) if err15 != nil { return err15 } diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_deletewithbody.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_deletewithbody.go index 78498a6b5..65776ff2f 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_deletewithbody.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_deletewithbody.go @@ -84,6 +84,19 @@ func (w barDeleteWithBodyWorkflow) Handle( var ok bool var h string + var k string + + k = textproto.CanonicalMIMEHeaderKey("x-uber-foo") + h, ok = reqHeaders.Get(k) + if ok { + clientHeaders[k] = h + } + k = textproto.CanonicalMIMEHeaderKey("x-uber-bar") + h, ok = reqHeaders.Get(k) + if ok { + clientHeaders[k] = h + } + h, ok = reqHeaders.Get("X-Deputy-Forwarded") if ok { clientHeaders["X-Deputy-Forwarded"] = h diff --git a/examples/example-gateway/build/gen-code/clients/bar/bar/bar_easyjson.go b/examples/example-gateway/build/gen-code/clients/bar/bar/bar_easyjson.go index 534e634fa..398f2c82d 100644 --- a/examples/example-gateway/build/gen-code/clients/bar/bar/bar_easyjson.go +++ b/examples/example-gateway/build/gen-code/clients/bar/bar/bar_easyjson.go @@ -1,6 +1,6 @@ // Code generated by zanzibar // @generated -// Checksum : snRCAsag0Fwle6jKqEYVrA== +// Checksum : ptODOThv0GfwSLnn0sbghw== // Code generated by easyjson for marshaling/unmarshaling. DO NOT EDIT. package bar @@ -12,6 +12,7 @@ import ( easyjson "github.com/mailru/easyjson" jlexer "github.com/mailru/easyjson/jlexer" jwriter "github.com/mailru/easyjson/jwriter" + base "github.com/uber/zanzibar/examples/example-gateway/build/gen-code/clients/foo/base/base" foo "github.com/uber/zanzibar/examples/example-gateway/build/gen-code/clients/foo/foo" ) @@ -3902,7 +3903,7 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo if out.FooException == nil { out.FooException = new(foo.FooException) } - (*out.FooException).UnmarshalEasyJSON(in) + easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsFooFoo(in, out.FooException) } default: in.SkipRecursive() @@ -3942,7 +3943,7 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo } else { out.RawString(prefix) } - (*in.FooException).MarshalEasyJSON(out) + easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsFooFoo(out, *in.FooException) } out.RawByte('}') } @@ -3970,7 +3971,6 @@ func (v *Bar_TooManyArgs_Result) UnmarshalJSON(data []byte) error { func (v *Bar_TooManyArgs_Result) UnmarshalEasyJSON(l *jlexer.Lexer) { easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBarBarTooManyArgs(l, v) } -<<<<<<< HEAD func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsFooFoo(in *jlexer.Lexer, out *foo.FooException) { isTopLevel := in.IsStart() if in.IsNull() { @@ -4018,8 +4018,6 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo } out.RawByte('}') } -======= ->>>>>>> Add a test endpoint to exercise the DELETE with body code path func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBarBarTooManyArgs1(in *jlexer.Lexer, out *Bar_TooManyArgs_Args) { isTopLevel := in.IsStart() if in.IsNull() { @@ -4059,7 +4057,7 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo if out.Foo == nil { out.Foo = new(foo.FooStruct) } - (*out.Foo).UnmarshalEasyJSON(in) + easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsFooFoo1(in, out.Foo) } default: in.SkipRecursive() @@ -4090,7 +4088,7 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo if in.Foo != nil { const prefix string = ",\"foo\":" out.RawString(prefix) - (*in.Foo).MarshalEasyJSON(out) + easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsFooFoo1(out, *in.Foo) } out.RawByte('}') } @@ -4118,7 +4116,6 @@ func (v *Bar_TooManyArgs_Args) UnmarshalJSON(data []byte) error { func (v *Bar_TooManyArgs_Args) UnmarshalEasyJSON(l *jlexer.Lexer) { easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBarBarTooManyArgs1(l, v) } -<<<<<<< HEAD func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsFooFoo1(in *jlexer.Lexer, out *foo.FooStruct) { isTopLevel := in.IsStart() if in.IsNull() { @@ -4327,8 +4324,6 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo } out.RawByte('}') } -======= ->>>>>>> Add a test endpoint to exercise the DELETE with body code path func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBarBarNormal(in *jlexer.Lexer, out *Bar_Normal_Result) { isTopLevel := in.IsStart() if in.IsNull() { @@ -5124,9 +5119,9 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.DemoIds = (out.DemoIds)[:0] } for !in.IsDelim(']') { - var v46 string - v46 = string(in.String()) - out.DemoIds = append(out.DemoIds, v46) + var v48 string + v48 = string(in.String()) + out.DemoIds = append(out.DemoIds, v48) in.WantComma() } in.Delim(']') @@ -5160,11 +5155,11 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.Demos = (out.Demos)[:0] } for !in.IsDelim(']') { - var v47 DemoType + var v49 DemoType if data := in.Raw(); in.Ok() { - in.AddError((v47).UnmarshalJSON(data)) + in.AddError((v49).UnmarshalJSON(data)) } - out.Demos = append(out.Demos, v47) + out.Demos = append(out.Demos, v49) in.WantComma() } in.Delim(']') @@ -5193,11 +5188,11 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.RawString("null") } else { out.RawByte('[') - for v48, v49 := range in.DemoIds { - if v48 > 0 { + for v50, v51 := range in.DemoIds { + if v50 > 0 { out.RawByte(',') } - out.String(string(v49)) + out.String(string(v51)) } out.RawByte(']') } @@ -5212,11 +5207,11 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.RawString(prefix) { out.RawByte('[') - for v50, v51 := range in.Demos { - if v50 > 0 { + for v52, v53 := range in.Demos { + if v52 > 0 { out.RawByte(',') } - out.Raw((v51).MarshalJSON()) + out.Raw((v53).MarshalJSON()) } out.RawByte(']') } @@ -5577,7 +5572,7 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo } in.Delim('{') for !in.IsDelim('}') { - key := in.UnsafeString() + key := in.UnsafeFieldName(false) in.WantColon() if in.IsNull() { in.Skip() @@ -5637,7 +5632,7 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo var FilterSet bool in.Delim('{') for !in.IsDelim('}') { - key := in.UnsafeString() + key := in.UnsafeFieldName(false) in.WantColon() if in.IsNull() { in.Skip() @@ -5966,9 +5961,9 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.Foo = (out.Foo)[:0] } for !in.IsDelim(']') { - var v52 string - v52 = string(in.String()) - out.Foo = append(out.Foo, v52) + var v54 string + v54 = string(in.String()) + out.Foo = append(out.Foo, v54) in.WantComma() } in.Delim(']') @@ -5989,9 +5984,9 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.Bar = (out.Bar)[:0] } for !in.IsDelim(']') { - var v53 int8 - v53 = int8(in.Int8()) - out.Bar = append(out.Bar, v53) + var v55 int8 + v55 = int8(in.Int8()) + out.Bar = append(out.Bar, v55) in.WantComma() } in.Delim(']') @@ -6032,11 +6027,11 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.RawString(prefix) { out.RawByte('[') - for v54, v55 := range in.Foo { - if v54 > 0 { + for v56, v57 := range in.Foo { + if v56 > 0 { out.RawByte(',') } - out.String(string(v55)) + out.String(string(v57)) } out.RawByte(']') } @@ -6048,11 +6043,11 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.RawString("null") } else { out.RawByte('[') - for v56, v57 := range in.Bar { - if v56 > 0 { + for v58, v59 := range in.Bar { + if v58 > 0 { out.RawByte(',') } - out.Int8(int8(v57)) + out.Int8(int8(v59)) } out.RawByte(']') } @@ -7156,9 +7151,9 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.AListUUID = (out.AListUUID)[:0] } for !in.IsDelim(']') { - var v58 UUID - v58 = UUID(in.String()) - out.AListUUID = append(out.AListUUID, v58) + var v60 UUID + v60 = UUID(in.String()) + out.AListUUID = append(out.AListUUID, v60) in.WantComma() } in.Delim(']') @@ -7180,9 +7175,9 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.AnOptListUUID = (out.AnOptListUUID)[:0] } for !in.IsDelim(']') { - var v59 UUID - v59 = UUID(in.String()) - out.AnOptListUUID = append(out.AnOptListUUID, v59) + var v61 UUID + v61 = UUID(in.String()) + out.AnOptListUUID = append(out.AnOptListUUID, v61) in.WantComma() } in.Delim(']') @@ -7203,9 +7198,9 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.AStringList = (out.AStringList)[:0] } for !in.IsDelim(']') { - var v60 string - v60 = string(in.String()) - out.AStringList = append(out.AStringList, v60) + var v62 string + v62 = string(in.String()) + out.AStringList = append(out.AStringList, v62) in.WantComma() } in.Delim(']') @@ -7227,9 +7222,9 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.AnOptStringList = (out.AnOptStringList)[:0] } for !in.IsDelim(']') { - var v61 string - v61 = string(in.String()) - out.AnOptStringList = append(out.AnOptStringList, v61) + var v63 string + v63 = string(in.String()) + out.AnOptStringList = append(out.AnOptStringList, v63) in.WantComma() } in.Delim(']') @@ -7250,9 +7245,9 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.AUUIDList = (out.AUUIDList)[:0] } for !in.IsDelim(']') { - var v62 UUID - v62 = UUID(in.String()) - out.AUUIDList = append(out.AUUIDList, v62) + var v64 UUID + v64 = UUID(in.String()) + out.AUUIDList = append(out.AUUIDList, v64) in.WantComma() } in.Delim(']') @@ -7274,9 +7269,9 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.AnOptUUIDList = (out.AnOptUUIDList)[:0] } for !in.IsDelim(']') { - var v63 UUID - v63 = UUID(in.String()) - out.AnOptUUIDList = append(out.AnOptUUIDList, v63) + var v65 UUID + v65 = UUID(in.String()) + out.AnOptUUIDList = append(out.AnOptUUIDList, v65) in.WantComma() } in.Delim(']') @@ -7331,11 +7326,11 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.AReqFruits = (out.AReqFruits)[:0] } for !in.IsDelim(']') { - var v64 Fruit + var v66 Fruit if data := in.Raw(); in.Ok() { - in.AddError((v64).UnmarshalJSON(data)) + in.AddError((v66).UnmarshalJSON(data)) } - out.AReqFruits = append(out.AReqFruits, v64) + out.AReqFruits = append(out.AReqFruits, v66) in.WantComma() } in.Delim(']') @@ -7357,11 +7352,11 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.AnOptDemos = (out.AnOptDemos)[:0] } for !in.IsDelim(']') { - var v65 DemoType + var v67 DemoType if data := in.Raw(); in.Ok() { - in.AddError((v65).UnmarshalJSON(data)) + in.AddError((v67).UnmarshalJSON(data)) } - out.AnOptDemos = append(out.AnOptDemos, v65) + out.AnOptDemos = append(out.AnOptDemos, v67) in.WantComma() } in.Delim(']') @@ -7509,11 +7504,11 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.RawString("null") } else { out.RawByte('[') - for v66, v67 := range in.AListUUID { - if v66 > 0 { + for v68, v69 := range in.AListUUID { + if v68 > 0 { out.RawByte(',') } - out.String(string(v67)) + out.String(string(v69)) } out.RawByte(']') } @@ -7523,11 +7518,11 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.RawString(prefix) { out.RawByte('[') - for v68, v69 := range in.AnOptListUUID { - if v68 > 0 { + for v70, v71 := range in.AnOptListUUID { + if v70 > 0 { out.RawByte(',') } - out.String(string(v69)) + out.String(string(v71)) } out.RawByte(']') } @@ -7539,11 +7534,11 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.RawString("null") } else { out.RawByte('[') - for v70, v71 := range in.AStringList { - if v70 > 0 { + for v72, v73 := range in.AStringList { + if v72 > 0 { out.RawByte(',') } - out.String(string(v71)) + out.String(string(v73)) } out.RawByte(']') } @@ -7553,11 +7548,11 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.RawString(prefix) { out.RawByte('[') - for v72, v73 := range in.AnOptStringList { - if v72 > 0 { + for v74, v75 := range in.AnOptStringList { + if v74 > 0 { out.RawByte(',') } - out.String(string(v73)) + out.String(string(v75)) } out.RawByte(']') } @@ -7569,11 +7564,11 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.RawString("null") } else { out.RawByte('[') - for v74, v75 := range in.AUUIDList { - if v74 > 0 { + for v76, v77 := range in.AUUIDList { + if v76 > 0 { out.RawByte(',') } - out.String(string(v75)) + out.String(string(v77)) } out.RawByte(']') } @@ -7583,11 +7578,11 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.RawString(prefix) { out.RawByte('[') - for v76, v77 := range in.AnOptUUIDList { - if v76 > 0 { + for v78, v79 := range in.AnOptUUIDList { + if v78 > 0 { out.RawByte(',') } - out.String(string(v77)) + out.String(string(v79)) } out.RawByte(']') } @@ -7619,11 +7614,11 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.RawString("null") } else { out.RawByte('[') - for v78, v79 := range in.AReqFruits { - if v78 > 0 { + for v80, v81 := range in.AReqFruits { + if v80 > 0 { out.RawByte(',') } - out.Raw((v79).MarshalJSON()) + out.Raw((v81).MarshalJSON()) } out.RawByte(']') } @@ -7633,11 +7628,11 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.RawString(prefix) { out.RawByte('[') - for v80, v81 := range in.AnOptDemos { - if v80 > 0 { + for v82, v83 := range in.AnOptDemos { + if v82 > 0 { out.RawByte(',') } - out.Raw((v81).MarshalJSON()) + out.Raw((v83).MarshalJSON()) } out.RawByte(']') } @@ -8005,9 +8000,9 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.Nodes = (out.Nodes)[:0] } for !in.IsDelim(']') { - var v82 string - v82 = string(in.String()) - out.Nodes = append(out.Nodes, v82) + var v84 string + v84 = string(in.String()) + out.Nodes = append(out.Nodes, v84) in.WantComma() } in.Delim(']') @@ -8043,11 +8038,11 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.RawString("null") } else { out.RawByte('[') - for v83, v84 := range in.Nodes { - if v83 > 0 { + for v85, v86 := range in.Nodes { + if v85 > 0 { out.RawByte(',') } - out.String(string(v84)) + out.String(string(v86)) } out.RawByte(']') } @@ -8126,9 +8121,9 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo for !in.IsDelim('}') { key := UUID(in.String()) in.WantColon() - var v85 int32 - v85 = int32(in.Int32()) - (out.MapIntWithRange)[key] = v85 + var v87 int32 + v87 = int32(in.Int32()) + (out.MapIntWithRange)[key] = v87 in.WantComma() } in.Delim('}') @@ -8143,9 +8138,9 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo for !in.IsDelim('}') { key := string(in.String()) in.WantColon() - var v86 int32 - v86 = int32(in.Int32()) - (out.MapIntWithoutRange)[key] = v86 + var v88 int32 + v88 = int32(in.Int32()) + (out.MapIntWithoutRange)[key] = v88 in.WantComma() } in.Delim('}') @@ -8223,16 +8218,16 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.RawString(`null`) } else { out.RawByte('{') - v88First := true - for v88Name, v88Value := range in.MapIntWithRange { - if v88First { - v88First = false + v90First := true + for v90Name, v90Value := range in.MapIntWithRange { + if v90First { + v90First = false } else { out.RawByte(',') } - out.String(string(v88Name)) + out.String(string(v90Name)) out.RawByte(':') - out.Int32(int32(v88Value)) + out.Int32(int32(v90Value)) } out.RawByte('}') } @@ -8244,16 +8239,16 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.RawString(`null`) } else { out.RawByte('{') - v89First := true - for v89Name, v89Value := range in.MapIntWithoutRange { - if v89First { - v89First = false + v91First := true + for v91Name, v91Value := range in.MapIntWithoutRange { + if v91First { + v91First = false } else { out.RawByte(',') } - out.String(string(v89Name)) + out.String(string(v91Name)) out.RawByte(':') - out.Int32(int32(v89Value)) + out.Int32(int32(v91Value)) } out.RawByte('}') } diff --git a/examples/example-gateway/build/gen-code/endpoints/bar/bar/bar_easyjson.go b/examples/example-gateway/build/gen-code/endpoints/bar/bar/bar_easyjson.go index 2c54f32c2..280aeab4f 100644 --- a/examples/example-gateway/build/gen-code/endpoints/bar/bar/bar_easyjson.go +++ b/examples/example-gateway/build/gen-code/endpoints/bar/bar/bar_easyjson.go @@ -1,6 +1,6 @@ // Code generated by zanzibar // @generated -// Checksum : RB1/EAUgAbo/RUJWY81U5Q== +// Checksum : E1a7y/BF5gSfsFOVVqCiTg== // Code generated by easyjson for marshaling/unmarshaling. DO NOT EDIT. package bar @@ -12,6 +12,7 @@ import ( easyjson "github.com/mailru/easyjson" jlexer "github.com/mailru/easyjson/jlexer" jwriter "github.com/mailru/easyjson/jwriter" + base "github.com/uber/zanzibar/examples/example-gateway/build/gen-code/endpoints/foo/base/base" foo "github.com/uber/zanzibar/examples/example-gateway/build/gen-code/endpoints/foo/foo" ) @@ -559,7 +560,7 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo if out.FooException == nil { out.FooException = new(foo.FooException) } - (*out.FooException).UnmarshalEasyJSON(in) + easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsFooFoo(in, out.FooException) } default: in.SkipRecursive() @@ -599,7 +600,7 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo } else { out.RawString(prefix) } - (*in.FooException).MarshalEasyJSON(out) + easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsFooFoo(out, *in.FooException) } out.RawByte('}') } @@ -627,7 +628,6 @@ func (v *Bar_TooManyArgs_Result) UnmarshalJSON(data []byte) error { func (v *Bar_TooManyArgs_Result) UnmarshalEasyJSON(l *jlexer.Lexer) { easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBarBarTooManyArgs(l, v) } -<<<<<<< HEAD func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsFooFoo(in *jlexer.Lexer, out *foo.FooException) { isTopLevel := in.IsStart() if in.IsNull() { @@ -675,8 +675,6 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo } out.RawByte('}') } -======= ->>>>>>> Add a test endpoint to exercise the DELETE with body code path func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBarBarTooManyArgs1(in *jlexer.Lexer, out *Bar_TooManyArgs_Args) { isTopLevel := in.IsStart() if in.IsNull() { @@ -716,7 +714,7 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo if out.Foo == nil { out.Foo = new(foo.FooStruct) } - (*out.Foo).UnmarshalEasyJSON(in) + easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsFooFoo1(in, out.Foo) } default: in.SkipRecursive() @@ -747,7 +745,7 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo if in.Foo != nil { const prefix string = ",\"foo\":" out.RawString(prefix) - (*in.Foo).MarshalEasyJSON(out) + easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsFooFoo1(out, *in.Foo) } out.RawByte('}') } @@ -775,7 +773,6 @@ func (v *Bar_TooManyArgs_Args) UnmarshalJSON(data []byte) error { func (v *Bar_TooManyArgs_Args) UnmarshalEasyJSON(l *jlexer.Lexer) { easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBarBarTooManyArgs1(l, v) } -<<<<<<< HEAD func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsFooFoo1(in *jlexer.Lexer, out *foo.FooStruct) { isTopLevel := in.IsStart() if in.IsNull() { @@ -984,8 +981,6 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo } out.RawByte('}') } -======= ->>>>>>> Add a test endpoint to exercise the DELETE with body code path func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBarBarNormal(in *jlexer.Lexer, out *Bar_Normal_Result) { isTopLevel := in.IsStart() if in.IsNull() { @@ -1603,9 +1598,9 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.DemoIds = (out.DemoIds)[:0] } for !in.IsDelim(']') { - var v4 string - v4 = string(in.String()) - out.DemoIds = append(out.DemoIds, v4) + var v6 string + v6 = string(in.String()) + out.DemoIds = append(out.DemoIds, v6) in.WantComma() } in.Delim(']') @@ -1639,11 +1634,11 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.Demos = (out.Demos)[:0] } for !in.IsDelim(']') { - var v5 DemoType + var v7 DemoType if data := in.Raw(); in.Ok() { - in.AddError((v5).UnmarshalJSON(data)) + in.AddError((v7).UnmarshalJSON(data)) } - out.Demos = append(out.Demos, v5) + out.Demos = append(out.Demos, v7) in.WantComma() } in.Delim(']') @@ -1672,11 +1667,11 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.RawString("null") } else { out.RawByte('[') - for v6, v7 := range in.DemoIds { - if v6 > 0 { + for v8, v9 := range in.DemoIds { + if v8 > 0 { out.RawByte(',') } - out.String(string(v7)) + out.String(string(v9)) } out.RawByte(']') } @@ -1691,11 +1686,11 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.RawString(prefix) { out.RawByte('[') - for v8, v9 := range in.Demos { - if v8 > 0 { + for v10, v11 := range in.Demos { + if v10 > 0 { out.RawByte(',') } - out.Raw((v9).MarshalJSON()) + out.Raw((v11).MarshalJSON()) } out.RawByte(']') } @@ -2056,7 +2051,7 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo } in.Delim('{') for !in.IsDelim('}') { - key := in.UnsafeString() + key := in.UnsafeFieldName(false) in.WantColon() if in.IsNull() { in.Skip() @@ -2116,7 +2111,7 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo var FilterSet bool in.Delim('{') for !in.IsDelim('}') { - key := in.UnsafeString() + key := in.UnsafeFieldName(false) in.WantColon() if in.IsNull() { in.Skip() @@ -2315,9 +2310,9 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.Foo = (out.Foo)[:0] } for !in.IsDelim(']') { - var v10 string - v10 = string(in.String()) - out.Foo = append(out.Foo, v10) + var v12 string + v12 = string(in.String()) + out.Foo = append(out.Foo, v12) in.WantComma() } in.Delim(']') @@ -2338,9 +2333,9 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.Bar = (out.Bar)[:0] } for !in.IsDelim(']') { - var v11 int8 - v11 = int8(in.Int8()) - out.Bar = append(out.Bar, v11) + var v13 int8 + v13 = int8(in.Int8()) + out.Bar = append(out.Bar, v13) in.WantComma() } in.Delim(']') @@ -2381,11 +2376,11 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.RawString(prefix) { out.RawByte('[') - for v12, v13 := range in.Foo { - if v12 > 0 { + for v14, v15 := range in.Foo { + if v14 > 0 { out.RawByte(',') } - out.String(string(v13)) + out.String(string(v15)) } out.RawByte(']') } @@ -2397,11 +2392,11 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.RawString("null") } else { out.RawByte('[') - for v14, v15 := range in.Bar { - if v14 > 0 { + for v16, v17 := range in.Bar { + if v16 > 0 { out.RawByte(',') } - out.Int8(int8(v15)) + out.Int8(int8(v17)) } out.RawByte(']') } @@ -3498,9 +3493,9 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.AListUUID = (out.AListUUID)[:0] } for !in.IsDelim(']') { - var v16 UUID - v16 = UUID(in.String()) - out.AListUUID = append(out.AListUUID, v16) + var v18 UUID + v18 = UUID(in.String()) + out.AListUUID = append(out.AListUUID, v18) in.WantComma() } in.Delim(']') @@ -3522,9 +3517,9 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.AnOptListUUID = (out.AnOptListUUID)[:0] } for !in.IsDelim(']') { - var v17 UUID - v17 = UUID(in.String()) - out.AnOptListUUID = append(out.AnOptListUUID, v17) + var v19 UUID + v19 = UUID(in.String()) + out.AnOptListUUID = append(out.AnOptListUUID, v19) in.WantComma() } in.Delim(']') @@ -3545,9 +3540,9 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.AStringList = (out.AStringList)[:0] } for !in.IsDelim(']') { - var v18 string - v18 = string(in.String()) - out.AStringList = append(out.AStringList, v18) + var v20 string + v20 = string(in.String()) + out.AStringList = append(out.AStringList, v20) in.WantComma() } in.Delim(']') @@ -3569,9 +3564,9 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.AnOptStringList = (out.AnOptStringList)[:0] } for !in.IsDelim(']') { - var v19 string - v19 = string(in.String()) - out.AnOptStringList = append(out.AnOptStringList, v19) + var v21 string + v21 = string(in.String()) + out.AnOptStringList = append(out.AnOptStringList, v21) in.WantComma() } in.Delim(']') @@ -3592,9 +3587,9 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.AUUIDList = (out.AUUIDList)[:0] } for !in.IsDelim(']') { - var v20 UUID - v20 = UUID(in.String()) - out.AUUIDList = append(out.AUUIDList, v20) + var v22 UUID + v22 = UUID(in.String()) + out.AUUIDList = append(out.AUUIDList, v22) in.WantComma() } in.Delim(']') @@ -3616,9 +3611,9 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.AnOptUUIDList = (out.AnOptUUIDList)[:0] } for !in.IsDelim(']') { - var v21 UUID - v21 = UUID(in.String()) - out.AnOptUUIDList = append(out.AnOptUUIDList, v21) + var v23 UUID + v23 = UUID(in.String()) + out.AnOptUUIDList = append(out.AnOptUUIDList, v23) in.WantComma() } in.Delim(']') @@ -3673,11 +3668,11 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.AReqFruits = (out.AReqFruits)[:0] } for !in.IsDelim(']') { - var v22 Fruit + var v24 Fruit if data := in.Raw(); in.Ok() { - in.AddError((v22).UnmarshalJSON(data)) + in.AddError((v24).UnmarshalJSON(data)) } - out.AReqFruits = append(out.AReqFruits, v22) + out.AReqFruits = append(out.AReqFruits, v24) in.WantComma() } in.Delim(']') @@ -3699,11 +3694,11 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.AnOptDemos = (out.AnOptDemos)[:0] } for !in.IsDelim(']') { - var v23 DemoType + var v25 DemoType if data := in.Raw(); in.Ok() { - in.AddError((v23).UnmarshalJSON(data)) + in.AddError((v25).UnmarshalJSON(data)) } - out.AnOptDemos = append(out.AnOptDemos, v23) + out.AnOptDemos = append(out.AnOptDemos, v25) in.WantComma() } in.Delim(']') @@ -3851,11 +3846,11 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.RawString("null") } else { out.RawByte('[') - for v24, v25 := range in.AListUUID { - if v24 > 0 { + for v26, v27 := range in.AListUUID { + if v26 > 0 { out.RawByte(',') } - out.String(string(v25)) + out.String(string(v27)) } out.RawByte(']') } @@ -3865,11 +3860,11 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.RawString(prefix) { out.RawByte('[') - for v26, v27 := range in.AnOptListUUID { - if v26 > 0 { + for v28, v29 := range in.AnOptListUUID { + if v28 > 0 { out.RawByte(',') } - out.String(string(v27)) + out.String(string(v29)) } out.RawByte(']') } @@ -3881,11 +3876,11 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.RawString("null") } else { out.RawByte('[') - for v28, v29 := range in.AStringList { - if v28 > 0 { + for v30, v31 := range in.AStringList { + if v30 > 0 { out.RawByte(',') } - out.String(string(v29)) + out.String(string(v31)) } out.RawByte(']') } @@ -3895,11 +3890,11 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.RawString(prefix) { out.RawByte('[') - for v30, v31 := range in.AnOptStringList { - if v30 > 0 { + for v32, v33 := range in.AnOptStringList { + if v32 > 0 { out.RawByte(',') } - out.String(string(v31)) + out.String(string(v33)) } out.RawByte(']') } @@ -3911,11 +3906,11 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.RawString("null") } else { out.RawByte('[') - for v32, v33 := range in.AUUIDList { - if v32 > 0 { + for v34, v35 := range in.AUUIDList { + if v34 > 0 { out.RawByte(',') } - out.String(string(v33)) + out.String(string(v35)) } out.RawByte(']') } @@ -3925,11 +3920,11 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.RawString(prefix) { out.RawByte('[') - for v34, v35 := range in.AnOptUUIDList { - if v34 > 0 { + for v36, v37 := range in.AnOptUUIDList { + if v36 > 0 { out.RawByte(',') } - out.String(string(v35)) + out.String(string(v37)) } out.RawByte(']') } @@ -3961,11 +3956,11 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.RawString("null") } else { out.RawByte('[') - for v36, v37 := range in.AReqFruits { - if v36 > 0 { + for v38, v39 := range in.AReqFruits { + if v38 > 0 { out.RawByte(',') } - out.Raw((v37).MarshalJSON()) + out.Raw((v39).MarshalJSON()) } out.RawByte(']') } @@ -3975,11 +3970,11 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.RawString(prefix) { out.RawByte('[') - for v38, v39 := range in.AnOptDemos { - if v38 > 0 { + for v40, v41 := range in.AnOptDemos { + if v40 > 0 { out.RawByte(',') } - out.Raw((v39).MarshalJSON()) + out.Raw((v41).MarshalJSON()) } out.RawByte(']') } @@ -4345,9 +4340,9 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo for !in.IsDelim('}') { key := UUID(in.String()) in.WantColon() - var v40 int32 - v40 = int32(in.Int32()) - (out.MapIntWithRange)[key] = v40 + var v42 int32 + v42 = int32(in.Int32()) + (out.MapIntWithRange)[key] = v42 in.WantComma() } in.Delim('}') @@ -4362,9 +4357,9 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo for !in.IsDelim('}') { key := string(in.String()) in.WantColon() - var v41 int32 - v41 = int32(in.Int32()) - (out.MapIntWithoutRange)[key] = v41 + var v43 int32 + v43 = int32(in.Int32()) + (out.MapIntWithoutRange)[key] = v43 in.WantComma() } in.Delim('}') @@ -4442,16 +4437,16 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.RawString(`null`) } else { out.RawByte('{') - v43First := true - for v43Name, v43Value := range in.MapIntWithRange { - if v43First { - v43First = false + v45First := true + for v45Name, v45Value := range in.MapIntWithRange { + if v45First { + v45First = false } else { out.RawByte(',') } - out.String(string(v43Name)) + out.String(string(v45Name)) out.RawByte(':') - out.Int32(int32(v43Value)) + out.Int32(int32(v45Value)) } out.RawByte('}') } @@ -4463,16 +4458,16 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.RawString(`null`) } else { out.RawByte('{') - v44First := true - for v44Name, v44Value := range in.MapIntWithoutRange { - if v44First { - v44First = false + v46First := true + for v46Name, v46Value := range in.MapIntWithoutRange { + if v46First { + v46First = false } else { out.RawByte(',') } - out.String(string(v44Name)) + out.String(string(v46Name)) out.RawByte(':') - out.Int32(int32(v44Value)) + out.Int32(int32(v46Value)) } out.RawByte('}') }