I’m thrilled to announce Serde 0.7.0!
It’s been a long time coming, and has a number of long awaited new features,
breaking changes, and other notable changes. Serde 0.6.x is now deprecated,
and while I’ll try to keep serde_codegen and serde_macros while projects
switch over to 0.7, I’m going to shift more to a pull-based approach, so please
file a bug ticket if a nightly release has broken you.
On to the list on the major changes!
Removed the word Error from serde::de::Error variants.
Renamed visit_ methods to serialize_ and deserialize_.
Renamed serde::de::Error::syntax to serde::de::Error::custom.
Serde Codegen and Macros
Serde now by default ignores unknown fields when deserializing. The previous
behavior, where Serde will report unknown fields as an error, can be
opted in with the container annotation #[serde(deny_unknown_fields)],
Added the variantl annotation #[serde(rename="...")] to rename
variants, as in:
Added rename annotation #[serde(rename(serialize="...", deserialize="..."))]
that supports crazy schemas like AWS that expect serialized fields with the
first character lower case, and the deserialized response with the first
character upper cased.
Removed support for the unused format-specific rename support.
Added the field annotation #[serde(default="$path")], where $path is a
reference to some function that returns a default value for a field if it’s
not present when deserializing. For example: