fullstorydev / grpcurl

Like cURL, but for gRPC: Command-line tool for interacting with gRPC servers
MIT License
10.36k stars 497 forks source link

JSON protobuf encoding doesn't respect the proper format for field masks #393

Open RichieAHB opened 1 year ago

RichieAHB commented 1 year ago

The encoding and decoding for protobuf field masks via gRPCurl is incorrect.

The protobuf reference defines a comma separate list of strings for field masks, whereas gRPCurl just maps between the JSON and protobuf as if it were any other proto and expects an array of strings under a paths field in an object (i.e. repeated string paths).

This cause problems when piping JSON decoded protos into gRPCurl.

It looks like the reason for this is that gRPCurl uses jsonpb, a deprecated library that doesn't feature FieldMask in its switch for well known types when decoding. Whereas the more modern protobuf-go library does.

Would you be open to updating the encoding to protobuf-go given this would be a relatively notable breaking change?