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
The lwpb C library doesn't apply default values for optional fields when decoding. This is by design. It would require another recursive pass over all the fields in the message descriptor to see if any were omitted in the encoded message. It would also require tracking which fields have been seen and which haven't, which is a departure from the callback design of lwpb_decoder_decode, where caller is responsible for actually populating the decoded message.
Since default values are a questionable and less frequently used feature of protobuf, and since applying them imposes a penalty in decoding, this should be an optional feature of the python decoder that you must explicitly request.
The text was updated successfully, but these errors were encountered:
The lwpb C library doesn't apply default values for optional fields when decoding. This is by design. It would require another recursive pass over all the fields in the message descriptor to see if any were omitted in the encoded message. It would also require tracking which fields have been seen and which haven't, which is a departure from the callback design of lwpb_decoder_decode, where caller is responsible for actually populating the decoded message.
Since default values are a questionable and less frequently used feature of protobuf, and since applying them imposes a penalty in decoding, this should be an optional feature of the python decoder that you must explicitly request.
The text was updated successfully, but these errors were encountered: