NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
crates.io · #330 most downloaded on crates.io
Custom de/serialization functions for Rust's serde
Last release 4 days ago
26 Sep 2026
Release timing varies
gaps range from 2 weeks to 3 months
Nearly every release is documented
notes for 60 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
9 years old
78 releases · first in 2017
Add DefaultOnNull as the equivalent for rust::default_on_null but for the serde_as system.
Add DefaultOnNull as the equivalent for rust::default_on_null but for the serde_as system.
Support specifying a path to the serde_with crate for the serde_as and derive macros.
This is useful when using crate renaming in Cargo.toml or while re-exporting the macros.
Many thanks to @tobz1000 for raising the issue and contributing fixes.
Depend on serde with the derive feature enabled. The derive feature is required to deserialize untagged enums which are used in the DefaultOnError hel
derive feature enabled.
The derive feature is required to deserialize untagged enums which are used in the DefaultOnError helpers.
This fixes compilation of serde_with in scenarios where no other crate enables the derive feature.One column per quarter.
Added sets_last_value_wins as a replacement for sets_first_value_wins which is deprecated now. The default behavior of serde is to prefer the first va…
The largest addition to this release is the addition of the serde_as de/serialization scheme.
Its goal is to be a more flexible replacement to serde's with annotation, by being more composable than before.
No longer is it a problem to add a custom de/serialization adapter is the type is within an Option or a Vec.
Thanks to @markazmierczak for the design of the trait without whom this wouldn't be possible.
More details about this new scheme can be found in the also new user guide
This release also features a detailed user guide.
The guide focuses more on how to use this crate by providing examples.
For example, it includes a section about the available feature flags of this crate and how you can migrate to the shiny new serde_as scheme.
The crate now features de/serialization adaptors for the std and chrono Duration types. #56 #104
Add a hex module, which allows formatting bytes (i.e. Vec<u8>) as a hexadecimal string.
The formatting supports different arguments how the formatting is happening.
Add two derive macros, SerializeDisplay and DeserializeFromStr, which implement the Serialize/Deserialize traits based on Display and FromStr.
This is in addition to the already existing methods like DisplayFromStr, which act locally, whereas the derive macros provide the traits expected by the rest of the ecosystem.
This is part of serde_with_macros v1.2.0.
Added some serialize functions to modules which previously had none.
This makes it easier to use the conversion when also deriving Serialize.
The functions simply pass through to the underlying Serialize implementation.
This affects sets_duplicate_value_is_error, maps_duplicate_key_is_error, maps_first_key_wins, default_on_error, and default_on_null.
Added sets_last_value_wins as a replacement for sets_first_value_wins which is deprecated now.
The default behavior of serde is to prefer the first value of a set, so the opposite is taking the last value.
Added #[serde_as] compatible conversion methods for serializing durations and timestamps as numbers.
The four types DurationSeconds, DurationSecondsWithFrac, TimestampSeconds, TimestampSecondsWithFrac provide the serialization conversion with optional sub-second precision.
There is support for std::time::Duration, chrono::Duration, std::time::SystemTime and chrono::DateTime.
Timestamps are serialized as durations since the UNIX epoch.
The serialization can be customized.
It supports multiple formats, such as i64, f64, or String, and the deserialization can be tweaked if it should be strict or lenient when accepting formats.
with_prefix!. #101with_prefix! macro, to add a string prefixes during serialization, now also works with unit variant enum types. #115 #116serde_as macro now supports serde attributes and no longer panic on unrecognized values in the attribute.
This is part of serde_with_macros v1.2.0.sets_first_value_wins.
The default behavior of serde is to take the first value, so this module is not necessary.Add a hex module, which allows formatting bytes (i.e. Vec ) as a hexadecimal string. The formatting supports different arguments how the formatting is
Add a hex module, which allows formatting bytes (i.e. Vec<u8>) as a hexadecimal string.
The formatting supports different arguments how the formatting is happening.
Add two derive macros, SerializeDisplay and DeserializeFromStr, which implement the Serialize/Deserialize traits based on Display and FromStr.
This is in addition to the already existing methods like DisplayFromStr, which act locally, whereas the derive macros provide the traits expected by the rest of the ecosystem.
This is part of serde_with_macros v1.2.0-alpha.3.
serde_as macro now supports serde attributes and no longer panic on unrecognized values in the attribute.
This is part of serde_with_macros v1.2.0-alpha.2.The largest addition to this release is the addition of the serde_as de/serialization scheme. Its goal is to be a more flexible replacement to serde's
The largest addition to this release is the addition of the serde_as de/serialization scheme.
Its goal is to be a more flexible replacement to serde's with annotation, by being more composable than before.
No longer is it a problem to add a custom de/serialization adapter is the type is within an Option or a Vec.
Thanks to @markazmierczak for the design of the trait without whom this wouldn't be possible.
More details about this new scheme can be found in the also new user guide
This release also features a detailed user guide.
The guide focuses more on how to use this crate by providing examples.
For example, it includes a section about the available feature flags of this crate and how you can migrate to the shiny new serde_as scheme.
The crate now features de/serialization adaptors for the std and chrono's Duration types. #56 #104
with_prefix!. #101with_prefix! macro, to add a string prefixes during serialization, now also works with unit variant enum types. #115 #116Add a helper to deserialize a Vec from String
Vec<u8> from String (#35)default_on_error helper, which turns errors into Defaults of the typedefault_on_null helper, which turns null values into Defaults of the typecargo audit and tarpaulin in all configurations now.Use serde_with_macros with proper dependencies specified.
serde_with_macros with proper dependencies specified.Add skip_serializing_none attribute, which adds #[serde(skip_serializing_if = "Option::is_none")] for each Option in a struct. This is helpful for API
skip_serializing_none attribute, which adds #[serde(skip_serializing_if = "Option::is_none")] for each Option in a struct.
This is helpful for APIs which have many optional fields.
The effect of can be negated by adding serialize_always on those fields, which should always be serialized.
Existing skip_serializing_if will never be modified and those fields keep their behavior.Add macro helper to support deserializing values with nested or flattened syntax #38
Serialize HashMap/BTreeMap as a list of tuples
Bumped version number to indicate the stability of the library.
Helper which deserializes an empty string as None and otherwise uses FromStr and AsRef .
None and otherwise uses FromStr and AsRef<str>.De/Serialize sequences by using Display and FromStr implementations on each element. Contributed by @katyo
Display and FromStr implementations on each element. Contributed by @katyoAdd missing docs and enable deny missing_docs
unwrap_or_skip allows to transparently serialize the inner part of a Some(T)
unwrap_or_skip allows to transparently serialize the inner part of a Some(T)Double Option pattern to differentiate between missing, unset, or existing value
with_prefix! macro, which puts a prefix on every struct fieldAdd chrono support: Deserialize timestamps from int, float, and string
Display and FromStr implementationsDisplay and FromStr, allows deserializing "#foo,#bar"### Added * Reserve name on crates.io
Your coding agent can read these notes before it upgrades. Set up the MCP server →