Closed elaberge closed 10 years ago
Required nullable fields such as strings should throw an exception instead of being serialized as the "null" string.
it("Should throw an exception when required fields are null", function() { var objWithNull = { "name": null, "n64": 123 } assert.throws(function() { var buffer = pb.serialize(objWithNull, "Test") }, Error) })
Yes, this is planned enhancement. Actually it will also throw if required field is not present at all.
@elaberge missing required fields now throw an exception. Nulls too.
Required nullable fields such as strings should throw an exception instead of being serialized as the "null" string.