Serde JSON serialization breaks for `Any` types without `#[serde(default)]`
rnbguy opened this issue · 0 comments
rnbguy commented
Going through the serialize function, I realized, it calls try_unpack()
prost-wkt/wkt-types/src/pbany.rs
Lines 138 to 140 in 190d4d3
which may fail because "value"
is assigned to {}
in this block and the Message
type may not derive #[serde(default)]
.
prost-wkt/wkt-types/src/pbany.rs
Lines 113 to 119 in 190d4d3
In such cases, serialization defaults to {"@type": ..., "value": ...}
.
prost-wkt/wkt-types/src/pbany.rs
Lines 142 to 143 in 190d4d3
This breaks the protobuf serialization to JSON for the Any types without #[serde(default)]
.