-
Notifications
You must be signed in to change notification settings - Fork 584
Description
I'll be honest, I'm not 100% certain if this is a prost issue of an issue with the Javascript library, but since I'm using the one included in Google's own tree:
https://github.com/google/protobuf/tree/master/js
I'm inclined to try here first. The issue is with the following code:
message Foo {
map<string, int> bar = 1;
}In Rust
let mut x = Foo::default();
x.bar.insert("val", 0);Now encode and send it somewhere. Prost appears to only write the key, and not the subsequent value of 0. At least in Javascript, this causes a panic due to receiving a key with a missing value, leading me to have to use string types and conversions back and forth from numbers in order to bypass this.
This applies to all zero types, floats/doubles do this on 0.0, bools do this on false.
It's possible the specification allows this and the Javascript is in error, but again, I'm trying here first since I think this is more likely a prost bug.