Releases: jonasbb/serde_with
serde_with v3.5.1
Fixed
- The
serde_as
macro now better detects existingschemars
attributes on fields and incorporates them by @swlynch99 (#682)
This avoids errors on existing#[schemars(with = ...)]
annotations.
serde_with v3.5.0
Added
- Support for
schemars
integration added by @swlynch99 (#666)
The support uses a newSchema
top-level item which implementsJsonSchema
Theserde_as
macro can now detectschemars
usage and emits matching annotations for all fields withserde_as
attribute.
Many types of this crate come already with support for theschemars
, but support is not complete and will be extended over time.
serde_with v3.4.0
serde_with v3.3.0
Added
-
Support the
hashbrown
typeHashMap
andHashSet
(#636, #637)
Thanks to @OliverNChalk for raising the issue and submitting a PR.This extends the existing support for
HashMap
s andHashSet
s to thehashbrown
crate v0.14.
The same conversions as for thestd
andindexmap
types are available, like general support for#[serde_as]
and converting it to/from sequences or maps.
Changed
-
Generalize some trait bounds for
DeserializeAs
implementationsWhile working on #637 it came to light that some of the macros for generating
DeserializeAs
implementations were not as generic as they could.
This means they didn't work with custom hasher types, but only the default hashers.
This has now been fixed and custom hashers should work better, as long as they implementBuildHasher + Default
. -
(internal) Change how features are documented (#639)
This change moves the feature documentation into
Cargo.toml
in a format that can be read by lib.rs.
It will improve the generated features documentation there.
The page with all features remains in the guide but is now generated from theCargo.toml
information.
serde_with v3.2.0
Added
- Add optional support for indexmap v2 (#621)
Support for v1 is already available using theindexmap_1
feature.
This adds identical support for v2 of indexmap using theindexmap_2
feature.
Changed
- Bump MSRV to 1.64, since that is required for the indexmap v2 dependency.
Fixed
serde_with v3.1.0
Added
-
Add
FromIntoRef
andTryFromIntoRef
(#618)
Thanks to @oblique for submitting the PR.The new types are similar to the existing
FromInto
andTryFromInto
types.
They behave different during serialization, allowing the removal of theClone
bound on theirSerializeAs
trait implementation
Changed
- Improve documentation about cfg-gating
serde_as
(#607) - Bump MSRV to 1.61 because that is required by the crate
cfg_eval
.
serde_with v3.0.0
This breaking release should not impact most users.
It only affects custom character sets used for base64 of which there are no instances of on GitHub.
Changed
-
Upgrade base64 to v0.21 (#543)
Thanks to @jeff-hiner for submitting the PR.Remove support for custom character sets.
This is technically a breaking change.
A code search on GitHub revealed no instances of anyone using that, andserde_with
ships with many predefined character sets.
The removal means that future base64 upgrade will no longer be breaking changes.
serde_with v2.3.3
Changed
- Update
syn
to v2 anddarling
to v0.20 (#578)
Update proc-macro dependencies.
This change should have no impact on users, but now uses the same dependency asserde_derive
.
serde_with v2.3.2
Changed
-
Improve the error message when deserializing
OneOrMany
orPickFirst
fails.
It now includes the original error message for each of the individual variants.
This is possible by dropping untagged enums as the internal implementations, since they will likely never support this, as these old PRs show serde#2376 and serde#1544.The new errors look like:
OneOrMany could not deserialize any variant: One: invalid type: map, expected u32 Many: invalid type: map, expected a sequence
PickFirst could not deserialize any variant: First: invalid type: string "Abc", expected u32 Second: invalid digit found in string
Fixed
serde_with v2.3.1
Fixed
-
Undo the changes to the trait bound for
Seq
. (#570, #571)
The new implementation caused issues with serialization formats that require the sequence length beforehand.
It also caused problems, that certain attributes which worked before no longer worked, due to mismatching number of references.Thanks to @stefunctional for reporting and for @stephaneyfx for providing a test case.