NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
crates.io, #23 most downloaded on crates.io
Macros 1.1 implementation of #[derive(Serialize, Deserialize)]
Latest stable
1.0.229
Last release 4 months ago
18 Jul 2026
Ships unpredictably
gaps range from 2 weeks to 10 months
Nearly every release is documented
notes for 56 of the last 60 stable releases
1 version withdrawn
withdrawn after publishing
10 years old
271 releases · first in 2016
Drag across the ruler to compare, or tap a release to open it.
Support deriving Serialize impl for a repr(packed) struct (#1791, thanks @alvardes)
repr(packed) struct (#1791, thanks @alvardes)Allow adjacently tagged newtype variants containing Option to omit the content field when deserializing (#1553, #1706, thanks @zth0)
Option to omit the content field when deserializing (#1553, #1706, thanks @zth0)Provide a Serializer impl that can write primitives and unit variants to a &mut fmt::Formatter (#1705, thanks @jethrogb)
Your coding agent can read these notes before it upgrades. Set up the MCP server →
Provide a Serializer impl that can write primitives and unit variants to a &mut fmt::Formatter (#1705, thanks @jethrogb)
use serde::Serialize;
use std::fmt::{self, Display};
#[derive(Serialize)]
#[serde(rename_all = "kebab-case")]
pub enum MessageType {
StartRequest,
EndRequest,
}
impl Display for MessageType {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
self.serialize(f)
}
}
Fix panic during macro expansion when using serde(skip) and serde(other) in the same enum
serde(skip) and serde(other) in the same enum (#1804)Hide dummy const implementation detail from rustdoc when documenting a binary crate (#1768, thanks @robo9k)
Allow #\[serde(borrow)\] to work on non-standard Cow types (#1754, thanks @maciejhirsz)
Cow types (#1754, thanks @maciejhirsz)Revert stabilization of Serialize/Deserialize impls for ! to account for https://github.com/rust-lang/rust/pull/67224
! to account for https://github.com/rust-lang/rust/pull/67224Support deserializing untagged unit variants from formats that treat unit as None
Support deserializing PathBuf from bytes like &Path already did, and support deserializing Box (#1656, thanks @heftig)
PathBuf from bytes like &Path already did, and support deserializing Box<Path> (#1656, thanks @heftig)Report errors on malformed serde attributes, like #[serde(rename =)] -- the compiler used to reject these itself, but when the compiler relaxed its re
Report errors on malformed serde attributes, like #[serde(rename =)] -- the compiler used to reject these itself, but when the compiler relaxed its requirements on attribute syntax these malformed attributes began silently being ignored by serde_derive
Eliminate unused variable warning when using skip_serializing inside a tuple variant of an adjacently tagged enum (#1617, thanks @arilotter)
Support skip attribute inside of newtype variants (#1622, thanks @Xaeroxe)
Provide serde::StdError and serde::StdError which are either a re-export of std::Error (if Serde's "std" feature is enabled) or a new identical trait
Provide serde::ser::StdError and serde::de::StdError which are either a re-export of std::error::Error (if Serde's "std" feature is enabled) or a new identical trait (otherwise).
#[cfg(feature = "std")]
pub use std::error::Error as StdError;
#[cfg(not(feature = "std"))]
pub trait StdError: Debug + Display {
fn source(&self) -> Option<&(StdError + 'static)> { None }
}
Serde's error traits serde::ser::Error and serde::de::Error require std::error::Error as a supertrait, but only when Serde is built with "std" enabled. Data formats that don't care about no_std support should generally provide their error types with a std::error::Error impl directly:
#[derive(Debug)]
struct MySerError {...}
impl serde::ser::Error for MySerError {...}
impl std::fmt::Display for MySerError {...}
// We don't support no_std!
impl std::error::Error for MySerError {}
Data formats that do support no_std may either have a "std" feature of their own as has been required in the past:
[features]
std = ["serde/std"]
#[cfg(feature = "std")]
impl std::error::Error for MySerError {}
... or else now may provide the std Error impl unconditionally via Serde's re-export:
impl serde::ser::StdError for MySerError {}
*Note: This raises the minimum required compiler version for serde_derive from rustc 1.15 to rustc 1.31. The minimum required compiler version for ser
Update Syn dependency to 1.0.
Note: This raises the minimum required compiler version for serde_derive from rustc 1.15 to rustc 1.31. The minimum required compiler version for serde remains at rustc 1.13.
Add support for NonZeroI* types (#1589, thanks @Flaise)
Introduce serde(try_from = "...") attribute to derive Deserialize based on a given implementation of `std::TryFrom (#1526, thanks @fanzeyi)
Introduce serde(try_from = "...") attribute to derive Deserialize based on a given implementation of std::convert::TryFrom (#1526, thanks @fanzeyi)
#[derive(Deserialize)]
#[serde(try_from = "u32")]
enum N {
Zero,
One,
Two,
}
impl TryFrom<u32> for N {
type Error = String;
fn try_from(u: u32) -> Result<Self, Self::Error> {
match u {
0 => Ok(Self::Zero),
1 => Ok(Self::One),
2 => Ok(Self::Two),
other => Err(format!("out of range: {}", other)),
}
}
}
Implement serialization and deserialization for std::atomic types (#1572 and #1581, thanks @Roguelazer)
Nothing published for this version
Accept enums in input data when deserializing IgnoredAny
Allow integer keys in untagged flattened map
Support using serde(flatten) in no_std + alloc mode (#1543, thanks @jplatte)
serde(flatten) in no_std + alloc mode (#1543, thanks @jplatte)Support deserializing from MapAccessDeserializer into an enum
Add an attribute #[serde(crate = "path::serde")] which replaces the use of extern crate serde in the generated code; this is intended for crates that
Add an attribute #[serde(crate = "path::to::serde")] which replaces the use of extern crate serde in the generated code; this is intended for crates that invoke Serde derives from a macro and need to refer to serde through their own re-export rather than requiring callers to list Serde in Cargo.toml (#1499, thanks @sgrif)
#[derive(Deserialize)]
#[serde(crate = "__tw::codegen::serde")]
struct S { ... }
// expands to:
impl<'de> __tw::codegen::serde::Deserialize<'de> for S {
...
}
Implement Serialize and Deserialize for core::Reverse\ (#1486, thanks @vorot93)
Support flatten and skip_serializing / skip_deserializing attributes on the same field
flatten and skip_serializing / skip_deserializing attributes on the same fieldFix inclusion of tag in struct containing flattened fields (#1468, thanks @jwillbold)
Implement Serialize and Deserialize for core::Bound\ (#1466, thanks @0nkery)
Accept #[serde(alias = "...")] attribute on fields and variants which allows the same field or variant to be deserialized from any of multiple differe
Accept #[serde(alias = "...")] attribute on fields and variants which allows the same field or variant to be deserialized from any of multiple different names in the input (#1458, thanks @Lymia)
#[derive(Deserialize)]
struct S {
#[serde(alias = "old_name")]
new_name: String, // will deserialize from either of "old_name" or "new_name"
}
Update example code in documentation to 2018 edition
Support a rename_all specification that applies only to the Serialize impl or only to the Deserialize impl (#1447, thanks @vincascm)
Support a rename_all specification that applies only to the Serialize impl or only to the Deserialize impl (#1447, thanks @vincascm)
#[derive(Serialize, Deserialize)]
#[serde(rename_all(
serialize = "camelCase",
deserialize = "SCREAMING_SNAKE_CASE",
))]
struct S { /* ... */ }
Allow serializing struct name inside of structs with named fields (#1448, thanks @motu42)
#[derive(Serialize)]
#[serde(tag = "type")]
struct S { /* ... */ } // serializes as {"type":"S",...}
Support serde(default) attribute inside of tuple structs and tuple variants (#1442, thanks @tcr)
serde(default) attribute inside of tuple structs and tuple variants (#1442, thanks @tcr)Better error messages when using an invalid combination of serde attributes (#1424, thanks @hcpl)
Performance optimization for Vec::deserialize_in_place to deserialize elements in place
Vec::deserialize_in_place to deserialize elements in place (#1411)Add serde(other) variant attribute for deserializing any variant that is not one of the others
Add serde(other) variant attribute for deserializing any variant that is not one of the others (#1382)
#[derive(Deserialize)]
#[serde(tag = "variant")]
enum MyEnum {
A(ModelA),
B(ModelB),
#[serde(other)]
Unknown,
}
In this internally tagged enum the MyEnum::Unknown variant would be produced if the "variant" tag in the input is neither "A" nor "B".
This feature is currently limited to externally tagged and adjacently tagged enums in which the other variant is a unit variant.
Fix panic deserializing flattened Value after flattened struct
Fix internally tagged enum deserialization with unknown fields (#1376, thanks @dreid)
Provide impls for `NonZeroU128` (#1371, thanks @hcpl)
NonZeroU128 (#1371, thanks @hcpl)Adjust dependency version requirement to support building with -Z minimal-versions in CI
-Z minimal-versions in CI (#1367)Disable i128 integers on Emscripten targets (#1365, thanks @koute)
Fix the names of serialized fields when the Rust data structure uses a raw identifier
Fix compilation of default-features = false, features = ["alloc", "rc"] feature combination (#1359, thanks @Pratyush)
default-features = false, features = ["alloc", "rc"] feature combination (#1359, thanks @Pratyush)Provide impls for `core::RangeInclusive (#1347, thanks @c410-f3r)
core::ops::RangeInclusive (#1347, thanks @c410-f3r)core::ops::Range whether or not "std" feature is enabled (#1348)Update --features alloc to work with nightly-2018-07-07
--features alloc to work with nightly-2018-07-07 (#1335)Support Rust 2018 use_extern_macros
use_extern_macros (https://github.com/rust-lang/rust/pull/51496)Suppress 'extern crate' warning for rust 2018 (#1324, thanks @jechase)
Implement Serialize for core::Arguments
Implement Serialize and Deserialize for ! (#544, unstable)
! (#544, unstable)Do not panic when serializing a RefCell that is currently mutably borrowed (#1300, thanks @xfix)
Second attempt to work around docs.rs old compiler version
Workaround to get docs.rs successfully building our docs with its old compiler
Implement `IntoDeserializer` for i128 and u128
IntoDeserializer for i128 and u128 (#1280)Stabilize Deserialize impls for dynamically sized Rc / Arc
Add Serde impls for i128 and u128 when compiling with Rust 1.26+
Add a serde(transparent) container attribute to indicate that a struct serializes and deserializes the same as its only field -- analogous to repr(tra
serde(transparent) container attribute to indicate that a struct serializes and deserializes the same as its only field -- analogous to repr(transparent) (#1054)Fix generated code for deserializing untagged newtype variant
Remove unstable Serialize and Deserialize impls for NonZero which has been removed from the most recent nightly compiler
NonZero<T> which has been removed from the most recent nightly compiler (#1265)Add a Serde build.rs script for rustc version detection in preparation for adding i128 / u128 primitive support on sufficiently new compilers. Please
Support formats that want to deserialize flattened identifiers as bytes
Support flattened untagged Options in struct fields
Support deserializing flattened untagged enum
Allow overriding inferred bounds at the variant level using a bound attribute
bound attribute (#1149)skip_serializing attribute in tuple structs and variants (#1048)skip_serializing_if in computing tuple struct lengths (#1049)Option field (#1029)Fix the Deserialize implementation generated for an adjacently tagged enum with zero variants
'de lifetime (#893)#[serde(skip)] variant attribute to combine the skip_serializing and skip_deserializing variant attributes that already existedOne column per quarter.