Closed rowanwins closed 4 years ago
Hi Rowan, as far as I understand, there's no way to handle that with "packed" fields because they assume a batch of items of the same type (in this case varint). You'd have to either change the proto
schema somehow to acommodate arrays of messages that contain different fields, or designate some special integer value (e.g. -1
or Number.MAX_SAFE_INTEGER
) to treat as null
on the app side.
No worries, thanks @mourner - for the time being I'm using the Number.MAX_SAFE_INTEGER
approach.
I have an array of integers, which also happens to contain some
null
valuesI'm trying to use a
writePackedVarint
however it's converting my nulls into0
'sI'm not a protocol buffer guru by any stretch but is this expected behaviour? Is there an alternate way to handle
null
values?