Protobuf: is it true that when an empty protobuf object is sent, it's converted to null object?

1.5k views Asked by At

I'm a new user of protobuf. I found out some weird behaviour.

I have two services that communicate by protobuf. When the first service sends an empty protobuf object to the other service, the other service doesn't get an empty protobuf, but a null.

Have you experienced this? If yes, do you know how to resolve it? I want the other service to get an empty object.

1

There are 1 answers

2
Marc Gravell On

Protobuf has no concept of null; it can send a zero length payload, and that should deserialize as an empty object (because an empty object is zero length), but it is possible that some implementation is returning null. Frankly I'd argue that is a bug in the deserializer, but a full minimal repro would help.