From 4d29bb8a14997f9d861e58631df246d24a9b7b86 Mon Sep 17 00:00:00 2001 From: Stephan Behnke Date: Mon, 23 Nov 2026 20:26:32 -0700 Subject: [PATCH 1/8] Find proxy payloads through recursive message types Complete reachability across cycles before pruning payload visitors and test a recursive graph that reaches Payload through an ancestor. --- cmd/proxygenerator/interceptor.go | 39 ++++++++++++++++++++------ cmd/proxygenerator/interceptor_test.go | 36 ++++++++++++++++++++++++ 2 files changed, 67 insertions(+), 8 deletions(-) create mode 100644 cmd/proxygenerator/interceptor_test.go diff --git a/cmd/proxygenerator/interceptor.go b/cmd/proxygenerator/interceptor.go index e42375ecd..98eb3b953 100644 --- a/cmd/proxygenerator/interceptor.go +++ b/cmd/proxygenerator/interceptor.go @@ -6,6 +6,7 @@ import ( "go/format" "go/types" "os" + "slices" "strings" "text/template" @@ -677,6 +678,7 @@ type TypeRecord struct { Slice bool // The API refers to slices of this type Map bool // The API refers to maps with this type as the value Matches bool // We found methods on this type that can eventually lead to Payload(s) + children map[string]string } // isSlice returns true if a type is slice, false otherwise @@ -800,6 +802,10 @@ func containsMessage( } } } + // A cycle can reach a target through an ancestor that is still being checked. + // Only positive results can be reused after this traversal completes. + delete(memo, fullName) + return false } @@ -914,6 +920,22 @@ func gatherMatchesToTypeRecords( walk(targetTypes, directMatchTypes, types.NewPointer(t), &matchingRecords) } } + // Recursive getters may have been visited before their target was marked. + for changed := true; changed; { + changed = false + for _, record := range matchingRecords { + for method, child := range record.children { + if target := matchingRecords[child]; target != nil && target.Matches && !slices.Contains(record.Methods, method) { + record.Matches = true + record.Methods = append(record.Methods, method) + changed = true + } + } + } + } + for _, record := range matchingRecords { + slices.Sort(record.Methods) + } matchingRecords = pruneRecords(matchingRecords) return matchingRecords, nil } @@ -922,13 +944,12 @@ func gatherMatchesToTypeRecords( // desired type(s). The return type for each method on this type is walked recursively to decide // which methods can lead to the desired type. func walk(desired []types.Type, directMatchTypes []types.Type, typ types.Type, records *map[string]*TypeRecord) bool { - typeName := typeName(typ) + name := typeName(typ) // If this type is a slice then walk the underlying type and then make a note we need to encode slices of this type if isSlice(typ) { result := walk(desired, directMatchTypes, elemType(typ), records) - if result { - record := (*records)[typeName] + if record := (*records)[name]; record != nil { record.Slice = true } return result @@ -937,20 +958,19 @@ func walk(desired []types.Type, directMatchTypes []types.Type, typ types.Type, r // If this type is a map then walk the underlying type and then make a note we need to encode maps with values of this type if isMap(typ) { result := walk(desired, directMatchTypes, elemType(typ), records) - if result { - record := (*records)[typeName] + if record := (*records)[name]; record != nil { record.Map = true } return result } // If we've walked this type before, return the previous result - if record, ok := (*records)[typeName]; ok { + if record, ok := (*records)[name]; ok { return record.Matches } - record := TypeRecord{} - (*records)[typeName] = &record + record := TypeRecord{children: map[string]string{}} + (*records)[name] = &record // Look for all functions with this `typ` type for _, meth := range typeutil.IntuitiveMethodSet(elemType(typ), nil) { @@ -993,6 +1013,9 @@ func walk(desired []types.Type, directMatchTypes []types.Type, typ types.Type, r record.Matches = true record.Methods = append(record.Methods, methodName) } + if !typeMatches(resultType, desired...) { + record.children[methodName] = typeName(resultType) + } } // Return whether this Type can (eventually) lead to Payload(s) diff --git a/cmd/proxygenerator/interceptor_test.go b/cmd/proxygenerator/interceptor_test.go new file mode 100644 index 000000000..55ee4cab1 --- /dev/null +++ b/cmd/proxygenerator/interceptor_test.go @@ -0,0 +1,36 @@ +package main + +import ( + "testing" + + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/reflect/protodesc" + "google.golang.org/protobuf/reflect/protoreflect" + "google.golang.org/protobuf/types/descriptorpb" +) + +func TestContainsMessageRecursive(t *testing.T) { + field := func(name, typ string, number int32) *descriptorpb.FieldDescriptorProto { + return &descriptorpb.FieldDescriptorProto{ + Name: proto.String(name), Number: proto.Int32(number), TypeName: proto.String(typ), + Type: descriptorpb.FieldDescriptorProto_TYPE_MESSAGE.Enum(), Label: descriptorpb.FieldDescriptorProto_LABEL_OPTIONAL.Enum(), + } + } + file, err := protodesc.NewFile(&descriptorpb.FileDescriptorProto{ + Name: proto.String("recursive.proto"), Package: proto.String("recursive"), Syntax: proto.String("proto3"), + MessageType: []*descriptorpb.DescriptorProto{ + {Name: proto.String("A"), Field: []*descriptorpb.FieldDescriptorProto{field("b", ".recursive.B", 1), field("payload", ".recursive.Payload", 2)}}, + {Name: proto.String("B"), Field: []*descriptorpb.FieldDescriptorProto{field("a", ".recursive.A", 1)}}, + {Name: proto.String("Payload")}, + }, + }, nil) + if err != nil { + t.Fatal(err) + } + memo := map[protoreflect.FullName]bool{} + for _, name := range []protoreflect.Name{"A", "B"} { + if !containsMessage(file.Messages().ByName(name), []string{"recursive.Payload"}, memo) { + t.Fatalf("%s should reach Payload through the recursive graph", name) + } + } +} From a1732d72ee160f1d98fc9456a647c4467e94c992 Mon Sep 17 00:00:00 2001 From: Stephan Behnke Date: Mon, 23 Nov 2026 20:27:23 -0700 Subject: [PATCH 2/8] Run the proxy generator tests from make test --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 8b2165154..565616054 100644 --- a/Makefile +++ b/Makefile @@ -167,6 +167,7 @@ gomodtidy: # We need to ensure protos are up to date to test our UTF-8 post-processing test: copy-helpers go test -race -tags protolegacy ./... + go -C cmd/proxygenerator test ./... ##### Check ##### From 4eddebc9291b79398b5e59a24eb7c86fe71a716f Mon Sep 17 00:00:00 2001 From: Stephan Behnke Date: Mon, 23 Nov 2026 20:49:58 -0700 Subject: [PATCH 3/8] Run proxy generator tests with the race detector --- Makefile | 2 +- cmd/proxygenerator/interceptor_test.go | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 565616054..c761e54f7 100644 --- a/Makefile +++ b/Makefile @@ -167,7 +167,7 @@ gomodtidy: # We need to ensure protos are up to date to test our UTF-8 post-processing test: copy-helpers go test -race -tags protolegacy ./... - go -C cmd/proxygenerator test ./... + go -C cmd/proxygenerator test -race ./... ##### Check ##### diff --git a/cmd/proxygenerator/interceptor_test.go b/cmd/proxygenerator/interceptor_test.go index 55ee4cab1..2965eb6e9 100644 --- a/cmd/proxygenerator/interceptor_test.go +++ b/cmd/proxygenerator/interceptor_test.go @@ -12,8 +12,11 @@ import ( func TestContainsMessageRecursive(t *testing.T) { field := func(name, typ string, number int32) *descriptorpb.FieldDescriptorProto { return &descriptorpb.FieldDescriptorProto{ - Name: proto.String(name), Number: proto.Int32(number), TypeName: proto.String(typ), - Type: descriptorpb.FieldDescriptorProto_TYPE_MESSAGE.Enum(), Label: descriptorpb.FieldDescriptorProto_LABEL_OPTIONAL.Enum(), + Name: proto.String(name), + Number: proto.Int32(number), + TypeName: proto.String(typ), + Type: descriptorpb.FieldDescriptorProto_TYPE_MESSAGE.Enum(), + Label: descriptorpb.FieldDescriptorProto_LABEL_OPTIONAL.Enum(), } } file, err := protodesc.NewFile(&descriptorpb.FileDescriptorProto{ From f9f71e372479750e58989b930d35d209966753e0 Mon Sep 17 00:00:00 2001 From: Stephan Behnke Date: Mon, 23 Nov 2026 20:50:49 -0700 Subject: [PATCH 4/8] Show the proxy generator source in GitHub diffs --- .gitattributes | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitattributes b/.gitattributes index 68f90fe8c..0a876bb33 100644 --- a/.gitattributes +++ b/.gitattributes @@ -7,5 +7,6 @@ # for more info. *.pb.go linguist-generated *.mock.go linguist-generated +cmd/proxygenerator/interceptor.go -linguist-generated internal/protojson/** linguist-vendored internal/strcase/** linguist-vendored From f18d7bc4580832ab77c9276e363175141590696e Mon Sep 17 00:00:00 2001 From: Stephan Behnke Date: Mon, 23 Nov 2026 20:54:42 -0700 Subject: [PATCH 5/8] Test recursive payload getter discovery --- cmd/proxygenerator/interceptor_test.go | 29 +++++++++++++++++++ .../testdata/recursive/getters.go | 16 ++++++++++ 2 files changed, 45 insertions(+) create mode 100644 cmd/proxygenerator/testdata/recursive/getters.go diff --git a/cmd/proxygenerator/interceptor_test.go b/cmd/proxygenerator/interceptor_test.go index 2965eb6e9..2ed86f698 100644 --- a/cmd/proxygenerator/interceptor_test.go +++ b/cmd/proxygenerator/interceptor_test.go @@ -1,6 +1,7 @@ package main import ( + "slices" "testing" "google.golang.org/protobuf/proto" @@ -37,3 +38,31 @@ func TestContainsMessageRecursive(t *testing.T) { } } } + +func TestGatherMatchesKeepsRecursivePayloadGetter(t *testing.T) { + payloads, err := lookupTypes("go.temporal.io/api/cmd/proxygenerator/testdata/recursive", []string{"Payload"}) + if err != nil { + t.Fatal(err) + } + + file, err := protodesc.NewFile(&descriptorpb.FileDescriptorProto{ + Name: proto.String("recursive.proto"), + Package: proto.String("temporal.api.cmd.proxygenerator.testdata.recursive"), + MessageType: []*descriptorpb.DescriptorProto{ + {Name: proto.String("Node")}, + }, + }, nil) + if err != nil { + t.Fatal(err) + } + + records, err := gatherMatchesToTypeRecords([]protoreflect.MessageDescriptor{file.Messages().ByName("Node")}, payloads, payloads) + if err != nil { + t.Fatal(err) + } + + record := records["*recursive.Node"] + if record == nil || !slices.Contains(record.Methods, "GetChild") { + t.Fatal("Node.GetChild should be visited because the child can contain a Payload") + } +} diff --git a/cmd/proxygenerator/testdata/recursive/getters.go b/cmd/proxygenerator/testdata/recursive/getters.go new file mode 100644 index 000000000..fd7acc151 --- /dev/null +++ b/cmd/proxygenerator/testdata/recursive/getters.go @@ -0,0 +1,16 @@ +package recursive + +type Payload struct{} + +type Node struct { + Child *Node + Payload *Payload +} + +func (n *Node) GetChild() *Node { + return n.Child +} + +func (n *Node) GetPayload() *Payload { + return n.Payload +} From 9678731a6f27f98d3dd3f7baaf3c7e2be9e9baad Mon Sep 17 00:00:00 2001 From: Stephan Behnke Date: Mon, 23 Nov 2026 20:56:55 -0700 Subject: [PATCH 6/8] Document the recursive payload regression tests --- cmd/proxygenerator/interceptor_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmd/proxygenerator/interceptor_test.go b/cmd/proxygenerator/interceptor_test.go index 2ed86f698..309ab6a94 100644 --- a/cmd/proxygenerator/interceptor_test.go +++ b/cmd/proxygenerator/interceptor_test.go @@ -10,6 +10,7 @@ import ( "google.golang.org/protobuf/types/descriptorpb" ) +// TestContainsMessageRecursive checks that a recursive search can find a payload through a previously visited type. func TestContainsMessageRecursive(t *testing.T) { field := func(name, typ string, number int32) *descriptorpb.FieldDescriptorProto { return &descriptorpb.FieldDescriptorProto{ @@ -39,6 +40,7 @@ func TestContainsMessageRecursive(t *testing.T) { } } +// TestGatherMatchesKeepsRecursivePayloadGetter checks that the generator retains a recursive getter that can lead to a payload. func TestGatherMatchesKeepsRecursivePayloadGetter(t *testing.T) { payloads, err := lookupTypes("go.temporal.io/api/cmd/proxygenerator/testdata/recursive", []string{"Payload"}) if err != nil { From 354c4a1aaf1605014181fafff7d0df92c1b4689b Mon Sep 17 00:00:00 2001 From: Stephan Behnke Date: Mon, 23 Nov 2026 22:09:28 -0700 Subject: [PATCH 7/8] Find payload-containing descriptors with a backward walk --- cmd/proxygenerator/interceptor.go | 139 ++++++++++++------------- cmd/proxygenerator/interceptor_test.go | 40 +++++-- 2 files changed, 95 insertions(+), 84 deletions(-) diff --git a/cmd/proxygenerator/interceptor.go b/cmd/proxygenerator/interceptor.go index 98eb3b953..dd657229b 100644 --- a/cmd/proxygenerator/interceptor.go +++ b/cmd/proxygenerator/interceptor.go @@ -758,91 +758,80 @@ func pruneRecords(input map[string]*TypeRecord) map[string]*TypeRecord { return result } -// isMatchingMessage returns true if the message descriptor is one of the target types -func isMatchingMessage(md protoreflect.MessageDescriptor, targetNames []string) bool { - fullName := string(md.FullName()) - for _, targetName := range targetNames { - if fullName == targetName { - return true - } - } - return false -} - -// containsMessage recursively checks whether the given message descriptor (or any of its fields) -// contains (transitively) a target message. -func containsMessage( - md protoreflect.MessageDescriptor, +// gatherMessagesContainingTargets walks all proto file descriptors in the registry +// and returns messages that transitively contain a target type, excluding the targets themselves. +func gatherMessagesContainingTargets( + protoFiles *protoregistry.Files, targetMessages []string, - memo map[protoreflect.FullName]bool, -) bool { - fullName := md.FullName() - // If we've already computed for this message, return the cached result. - if res, ok := memo[fullName]; ok { - return res - } - // Mark this message as not containing a payload to break cycles. - memo[fullName] = false - - // Check every field of this message. - for i := 0; i < md.Fields().Len(); i++ { - field := md.Fields().Get(i) - // Only care about message-type fields. - if field.Kind() == protoreflect.MessageKind && field.Message() != nil { - child := field.Message() - // If the field is directly a payload (or Any) then mark and return true. - if isMatchingMessage(child, targetMessages) { - memo[fullName] = true - return true - } - // Otherwise, recursively check if the field's message type contains a payload. - if containsMessage(child, targetMessages, memo) { - memo[fullName] = true - return true +) ([]protoreflect.MessageDescriptor, error) { + referrers := make(map[protoreflect.FullName][]protoreflect.FullName) + indexed := make(map[protoreflect.FullName]bool) + var indexReferences func(protoreflect.MessageDescriptor) + indexReferences = func(message protoreflect.MessageDescriptor) { + name := message.FullName() + if indexed[name] { + return + } + indexed[name] = true + + fields := message.Fields() + for i := 0; i < fields.Len(); i++ { + field := fields.Get(i) + // Only care about message-type fields. + if child := field.Message(); field.Kind() == protoreflect.MessageKind && child != nil { + referrers[child.FullName()] = append(referrers[child.FullName()], name) + indexReferences(child) } } } - // A cycle can reach a target through an ancestor that is still being checked. - // Only positive results can be reused after this traversal completes. - delete(memo, fullName) - return false -} + var candidates []protoreflect.MessageDescriptor + var collectMessages func(protoreflect.MessageDescriptors) + collectMessages = func(messages protoreflect.MessageDescriptors) { + for i := 0; i < messages.Len(); i++ { + message := messages.Get(i) + candidates = append(candidates, message) + indexReferences(message) + collectMessages(message.Messages()) + } + } + protoFiles.RangeFiles(func(file protoreflect.FileDescriptor) bool { + collectMessages(file.Messages()) + return true + }) -// checkMessage examines the given message descriptor md and, if it (transitively) contains a -// payload, appends its result slice. -func checkMessage(md protoreflect.MessageDescriptor, - targetMessages []string, - memo map[protoreflect.FullName]bool, - result *[]protoreflect.MessageDescriptor, -) { - // Avoid reporting the target types directly - if !isMatchingMessage(md, targetMessages) && containsMessage(md, targetMessages, memo) { - *result = append(*result, md) + // Walk from the targets to every message that references them, marking each message once. + matches := make(map[protoreflect.FullName]bool) + pending := make([]protoreflect.FullName, 0, len(targetMessages)) + for _, target := range targetMessages { + name := protoreflect.FullName(target) + if !matches[name] { + matches[name] = true + pending = append(pending, name) + } } - nested := md.Messages() - for i := 0; i < nested.Len(); i++ { - checkMessage(nested.Get(i), targetMessages, memo, result) + for len(pending) > 0 { + name := pending[len(pending)-1] + pending = pending[:len(pending)-1] + for _, parent := range referrers[name] { + if !matches[parent] { + matches[parent] = true + pending = append(pending, parent) + } + } } -} -// gatherMessagesContainingTargets walks all proto file descriptors in the registry, -// and returns a slice of full message names that (transitively) contain the target message types. -// The excludedPathPrefixes are used to skip files that match the given prefixes. -func gatherMessagesContainingTargets( - protoFiles *protoregistry.Files, - targetMessages []string, -) ([]protoreflect.MessageDescriptor, error) { - messagesWithPayload := make([]protoreflect.MessageDescriptor, 0) - memo := make(map[protoreflect.FullName]bool) - protoFiles.RangeFiles(func(fd protoreflect.FileDescriptor) bool { - msgs := fd.Messages() - for i := 0; i < msgs.Len(); i++ { - checkMessage(msgs.Get(i), targetMessages, memo, &messagesWithPayload) + // Avoid reporting the target types directly. + for _, target := range targetMessages { + delete(matches, protoreflect.FullName(target)) + } + result := make([]protoreflect.MessageDescriptor, 0, len(matches)) + for _, message := range candidates { + if matches[message.FullName()] { + result = append(result, message) } - return true - }) - return messagesWithPayload, nil + } + return result, nil } // getProtoRegistryFromDescriptor reads a file descriptor set from the given path and returns a proto registry. diff --git a/cmd/proxygenerator/interceptor_test.go b/cmd/proxygenerator/interceptor_test.go index 309ab6a94..261c0e38c 100644 --- a/cmd/proxygenerator/interceptor_test.go +++ b/cmd/proxygenerator/interceptor_test.go @@ -7,11 +7,12 @@ import ( "google.golang.org/protobuf/proto" "google.golang.org/protobuf/reflect/protodesc" "google.golang.org/protobuf/reflect/protoreflect" + "google.golang.org/protobuf/reflect/protoregistry" "google.golang.org/protobuf/types/descriptorpb" ) -// TestContainsMessageRecursive checks that a recursive search can find a payload through a previously visited type. -func TestContainsMessageRecursive(t *testing.T) { +// TestGatherMessagesContainingTargetsRecursive checks that cyclic references can lead to a payload. +func TestGatherMessagesContainingTargetsRecursive(t *testing.T) { field := func(name, typ string, number int32) *descriptorpb.FieldDescriptorProto { return &descriptorpb.FieldDescriptorProto{ Name: proto.String(name), @@ -24,19 +25,40 @@ func TestContainsMessageRecursive(t *testing.T) { file, err := protodesc.NewFile(&descriptorpb.FileDescriptorProto{ Name: proto.String("recursive.proto"), Package: proto.String("recursive"), Syntax: proto.String("proto3"), MessageType: []*descriptorpb.DescriptorProto{ - {Name: proto.String("A"), Field: []*descriptorpb.FieldDescriptorProto{field("b", ".recursive.B", 1), field("payload", ".recursive.Payload", 2)}}, - {Name: proto.String("B"), Field: []*descriptorpb.FieldDescriptorProto{field("a", ".recursive.A", 1)}}, + {Name: proto.String("A"), Field: []*descriptorpb.FieldDescriptorProto{ + field("b", ".recursive.B", 1), + field("payload", ".recursive.Payload", 2), + }}, + {Name: proto.String("B"), Field: []*descriptorpb.FieldDescriptorProto{ + field("a", ".recursive.A", 1), + }}, + {Name: proto.String("NoPayload"), Field: []*descriptorpb.FieldDescriptorProto{ + field("first", ".recursive.Leaf", 1), + field("second", ".recursive.Leaf", 2), + }}, + {Name: proto.String("Leaf")}, {Name: proto.String("Payload")}, }, }, nil) if err != nil { t.Fatal(err) } - memo := map[protoreflect.FullName]bool{} - for _, name := range []protoreflect.Name{"A", "B"} { - if !containsMessage(file.Messages().ByName(name), []string{"recursive.Payload"}, memo) { - t.Fatalf("%s should reach Payload through the recursive graph", name) - } + + var files protoregistry.Files + if err := files.RegisterFile(file); err != nil { + t.Fatal(err) + } + matches, err := gatherMessagesContainingTargets(&files, []string{"recursive.Payload"}) + if err != nil { + t.Fatal(err) + } + + var names []protoreflect.Name + for _, match := range matches { + names = append(names, match.Name()) + } + if want := []protoreflect.Name{"A", "B"}; !slices.Equal(names, want) { + t.Fatalf("messages containing a payload = %v, want %v", names, want) } } From 7505ca03c65e4a7f0075de3dcc17b7e18b6d9848 Mon Sep 17 00:00:00 2001 From: Stephan Behnke Date: Tue, 24 Nov 2026 08:37:01 -0700 Subject: [PATCH 8/8] Clarify the recursive descriptor regression fixture --- cmd/proxygenerator/interceptor_test.go | 33 ++++++++++++++++---------- 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/cmd/proxygenerator/interceptor_test.go b/cmd/proxygenerator/interceptor_test.go index 261c0e38c..1664652aa 100644 --- a/cmd/proxygenerator/interceptor_test.go +++ b/cmd/proxygenerator/interceptor_test.go @@ -11,7 +11,7 @@ import ( "google.golang.org/protobuf/types/descriptorpb" ) -// TestGatherMessagesContainingTargetsRecursive checks that cyclic references can lead to a payload. +// TestGatherMessagesContainingTargetsRecursive checks that the descriptor scan finds B's path to the target Payload message through A. func TestGatherMessagesContainingTargetsRecursive(t *testing.T) { field := func(name, typ string, number int32) *descriptorpb.FieldDescriptorProto { return &descriptorpb.FieldDescriptorProto{ @@ -25,17 +25,26 @@ func TestGatherMessagesContainingTargetsRecursive(t *testing.T) { file, err := protodesc.NewFile(&descriptorpb.FileDescriptorProto{ Name: proto.String("recursive.proto"), Package: proto.String("recursive"), Syntax: proto.String("proto3"), MessageType: []*descriptorpb.DescriptorProto{ - {Name: proto.String("A"), Field: []*descriptorpb.FieldDescriptorProto{ - field("b", ".recursive.B", 1), - field("payload", ".recursive.Payload", 2), - }}, - {Name: proto.String("B"), Field: []*descriptorpb.FieldDescriptorProto{ - field("a", ".recursive.A", 1), - }}, - {Name: proto.String("NoPayload"), Field: []*descriptorpb.FieldDescriptorProto{ - field("first", ".recursive.Leaf", 1), - field("second", ".recursive.Leaf", 2), - }}, + { + Name: proto.String("A"), + Field: []*descriptorpb.FieldDescriptorProto{ + field("b", ".recursive.B", 1), + field("payload", ".recursive.Payload", 2), + }, + }, + { + Name: proto.String("B"), + Field: []*descriptorpb.FieldDescriptorProto{ + field("a", ".recursive.A", 1), + }, + }, + { + Name: proto.String("NoPayload"), + Field: []*descriptorpb.FieldDescriptorProto{ + field("first", ".recursive.Leaf", 1), + field("second", ".recursive.Leaf", 2), + }, + }, {Name: proto.String("Leaf")}, {Name: proto.String("Payload")}, },