Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the OneOrMany doctest to test serialization too #728 #730

Merged
merged 1 commit into from
Apr 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions serde_with/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1662,9 +1662,9 @@ pub struct Bytes;
/// # #[derive(Debug, PartialEq)]
/// #[derive(Deserialize, serde::Serialize)]
/// struct Data {
/// #[serde_as(deserialize_as = "OneOrMany<_, PreferOne>")]
/// #[serde_as(as = "OneOrMany<_, PreferOne>")]
/// countries: Vec<String>,
/// #[serde_as(deserialize_as = "OneOrMany<_, PreferMany>")]
/// #[serde_as(as = "OneOrMany<_, PreferMany>")]
/// cities: Vec<String>,
/// }
///
Expand Down Expand Up @@ -1693,7 +1693,7 @@ pub struct Bytes;
/// "countries": "Spain",
/// "cities": ["Berlin"],
/// });
/// assert_eq!(data, serde_json::from_value(j).unwrap());
/// assert_eq!(serde_json::to_value(data).unwrap(), j);
/// # }
/// ```
#[cfg(feature = "alloc")]
Expand Down
Loading