You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The struct above fails to serialize: "cannot serialize tagged newtype variant Test::A containing an integer", line: 0, column: 0, I would have expected it to serialize to {"type": "A", "x": 123}. Deserialization fails similarly.
Changing it to a struct with named fields works fine:
The
#[serde(rename)]
attribute does not seem to work on unnamed fields of internally tagged enums.The struct above fails to serialize:
"cannot serialize tagged newtype variant Test::A containing an integer", line: 0, column: 0
, I would have expected it to serialize to{"type": "A", "x": 123}
. Deserialization fails similarly.Changing it to a struct with named fields works fine:
Versions
serde: 1.0.210
serde_json: 1.0.132
rust: 1.81.0
The text was updated successfully, but these errors were encountered: