Skip to content

Can json payloads be strongly typed? Or should all the fields be String? #2130

Discussion options

You must be logged in to vote

Ok for posterity, my issue is that the underlying crate expands the the type in an unexpected way.

The solution to this is to annotate the field in the struct with the problematic type with #[serde(deserialize_with = "my_deserialize_fn")]

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@matthiasdebernardini
Comment options

@davidpdrsn
Comment options

@matthiasdebernardini
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by matthiasdebernardini
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