Closed dtolnay closed 2 years ago
#[derive(Serialize, Deserialize)] struct Struct { #[serde(with = "serde_yaml::with::singleton_map")] e: Enum, }
will represent that field as a 1-element map variant: {contents} instead of the default tag-based representation !variant {contents}.
variant: {contents}
!variant {contents}
I am already using #[serde(serialize_with = "some_function"] and #[serde(deserialize_with = "some_other_function"]. How can I still use this feature?
#[serde(serialize_with = "some_function"]
#[serde(deserialize_with = "some_other_function"]
will represent that field as a 1-element map
variant: {contents}
instead of the default tag-based representation!variant {contents}
.