Skip to content

serde_as fails for identity transformations #201

Answered by jonasbb
sergiimk asked this question in Q&A
Discussion options

You must be logged in to vote

Hi, you are quite close. The correct annotation on map is #[serde_as(as = "BTreeMap<_, ADef>")].

As you noticed identity transforms do not work. A blanked implementation is not possible as it would overlap with other implementations. Instead you need to use _ or Same.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by jonasbb
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #201 on December 16, 2020 20:19.