-
Notifications
You must be signed in to change notification settings - Fork 25
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
Why don't write when enum field value is 0 #77
Comments
To simulate it on the wire, mark the field |
Wouldn't this mean the value would not be written if not explicitly set? This would cause a well formatted proto3 message to fail when being decoded in proto2. Consider:
As far as typechecks are considered |
Agreed, but there's no other way to ensure the value is written onto the wire in proto3. Consider this: syntax = "proto3"
message Hop {
enum Type {
RESERVE = 0;
...
}
Type type;
} With this definition It's better to upgrade everyone to proto3 and not use Where that isn't possible the only thing you can do is mark it |
related with these pr: |
protons/packages/protons/src/index.ts
Line 405 in 51746ec
When I protons this proto, it will gnenerate the code like this:
This will cause the wrong binary data(MALFORM) when I encode the HopMessage with type value is RESERVE when the relay node is kubo
The text was updated successfully, but these errors were encountered: