Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default values #6

Open
ricardobeat opened this issue Jan 28, 2020 · 0 comments
Open

Default values #6

ricardobeat opened this issue Jan 28, 2020 · 0 comments

Comments

@ricardobeat
Copy link

Hi! The readme for this project states that

this library doesn't write out default values. This makes it possible to tell if a field has been written at all or not, which allows for efficient encoding of maps

My understanding is that the protocol itself makes this impossible, as default values will not be sent over the wire at all [1]:

for scalar message fields, once a message is parsed there's no way of telling whether a field was explicitly set to the default value (for example whether a boolean was set to false) or just not set at all: you should bear this in mind when defining your message types

How is this possible in this library?

[1] https://developers.google.com/protocol-buffers/docs/proto3#default

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant