Closed elaberge closed 10 years ago
I created bug #33 in reference to the null required fields behaviour. I only use optional fields, so the current fix is enough for me.
Thank you, that's clearly a bug, null values on optional fields should not be serialized as of current protobuf version. There's a reference here: https://code.google.com/p/protobuf/issues/detail?id=57
node-protobuf currently serializes null strings as "null". I think this is error prone and a better solution would be to ignore such a field.
Unfortunately (unless I am mistaken), protobuf does not have a semantic for null values, making this solution only valid for optional fields.
This fix does not handle required fields. I suppose the correct behaviour would be to throw an exception in case a required field is set to null.