-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Setting the default value to a string field causes a bad result #1357
Comments
The result was valid . I have noticed that the encoded values give the same decoded value. |
In https://developers.google.com/protocol-buffers/docs/proto3#default I found the following sentence.
I think the result 0a0568656c6c6f1200 should be 0a0568656c6c6f . |
Thank you for pointing this out. I agree this is a bug in the encoder. The same problem exist at least for numbers as well. |
This is pretty much a duplicate of #1118 (just for string instead of bool) |
Thank you for showing #1118. I agree that this issue is a duplicate of that, so I close this issue. |
protobuf.js version: +-- [email protected]
When the default value for string, empty string represented by '' or "" is set to a string field,
the serialized result is different from the one the value is not set.
tmp.protoc
poi.js
Output is the following
The text was updated successfully, but these errors were encountered: