struct Foo; があるときに serde_json で Option<Foo> を serialize すると null になるの辛い
-
Show this thread
-
Replying to @gifnksm
#[serde(skip_serializing_if = "Option::is_none")] で省略できなかったでしたっけ https://serde.rs/field-attrs.html#skip_serializing_if …
1 reply 0 retweets 0 likes -
Replying to @ubnt_intrepid
ライブラリ側実装の都合で、残念ながらそれではだめそうです。 struct Foo; 側の Serialize/Deserialize を手動で実装することにしました。。。
1 reply 0 retweets 0 likes
Replying to @gifnksm
あぁなるほど…(確かにこれだとフィールド単位でしか制御できない)
8:05 AM - 1 Mar 2020
0 replies
0 retweets
1 like
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.