You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As I understand, in proto3 all fields are 'optional' in sense
that sender can omit them. However, receiver will always have a message that has
all fields set: if field was not set by the sender, it will get a default value fitting it's type (null for message types, 0 for number, false for boolean etc). Is this correct?
Also, when using decorators, does protobufjs work in proto3 or proto2 mode?
The text was updated successfully, but these errors were encountered:
protobuf.js version: 7.10.1
Please describe the expected and actual behavior
If I create
Vector
message instance without setting fields, they will have default value for numbers -0
:However, if I change types to
uint32
, fields areundefined
:Is this intended?
P.S.
As I understand, in proto3 all fields are 'optional' in sense
that sender can omit them. However, receiver will always have a message that has
all fields set: if field was not set by the sender, it will get a default value fitting it's type (
null
for message types,0
for number,false
for boolean etc). Is this correct?Also, when using decorators, does
protobufjs
work in proto3 or proto2 mode?The text was updated successfully, but these errors were encountered: