Skip to content

Commit 0b8a00c

Browse files
authored
Fix expected field paths for groups in conformance tests (#443)
1 parent 3705a4e commit 0b8a00c

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

  • tools/protovalidate-conformance/internal/fieldpath

tools/protovalidate-conformance/internal/fieldpath/fieldpath.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,17 +83,24 @@ func Unmarshal(
8383
}
8484
descriptor = extension.TypeDescriptor()
8585
} else {
86-
descriptor = message.Fields().ByTextName(name)
86+
descriptor = message.Fields().ByName(protoreflect.Name(name))
8787
oneOf = message.Oneofs().ByName(protoreflect.Name(name))
8888
}
8989
var element *validate.FieldPathElement
9090
switch {
91-
case descriptor != nil:
91+
case isExt:
92+
9293
element = &validate.FieldPathElement{
9394
FieldNumber: proto.Int32(int32(descriptor.Number())),
9495
FieldName: proto.String(descriptor.TextName()),
9596
FieldType: descriptorpb.FieldDescriptorProto_Type(descriptor.Kind()).Enum(),
9697
}
98+
case descriptor != nil:
99+
element = &validate.FieldPathElement{
100+
FieldNumber: proto.Int32(int32(descriptor.Number())),
101+
FieldName: proto.String(string(descriptor.Name())),
102+
FieldType: descriptorpb.FieldDescriptorProto_Type(descriptor.Kind()).Enum(),
103+
}
97104
case oneOf != nil:
98105
element = &validate.FieldPathElement{
99106
FieldName: proto.String(string(oneOf.Name())),

0 commit comments

Comments
 (0)