fix: encoding form decode field mask from well-know (#2285)

Co-authored-by: Astone <caliburn_marco@163.com>
pull/2290/head
Astone 2 years ago committed by GitHub
parent bdfeb4bf78
commit 205aa88d86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      encoding/form/proto_decode.go

@ -12,11 +12,11 @@ import (
"google.golang.org/protobuf/encoding/protojson"
"google.golang.org/protobuf/types/known/structpb"
"google.golang.org/genproto/protobuf/field_mask"
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/reflect/protoreflect"
"google.golang.org/protobuf/reflect/protoregistry"
"google.golang.org/protobuf/types/known/durationpb"
"google.golang.org/protobuf/types/known/fieldmaskpb"
"google.golang.org/protobuf/types/known/timestamppb"
"google.golang.org/protobuf/types/known/wrapperspb"
)
@ -289,7 +289,7 @@ func parseMessage(md protoreflect.MessageDescriptor, value string) (protoreflect
}
msg = wrapperspb.Bytes(v)
case "google.protobuf.FieldMask":
fm := &field_mask.FieldMask{}
fm := &fieldmaskpb.FieldMask{}
for _, fv := range strings.Split(value, ",") {
fm.Paths = append(fm.Paths, jsonSnakeCase(fv))
}

Loading…
Cancel
Save