-
|
I basically want this: #[serde_as]
pub struct A {
#[serde_as(as = "HashMap<String, OneOrMany<_>>")]
pub keys: HashMap<String, Vec<OtherStruct>>,
}I get an error: |
Beta Was this translation helpful? Give feedback.
Answered by
jonasbb
Jul 12, 2024
Replies: 1 comment
-
|
I think the issue is your use of |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
jonasbb
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think the issue is your use of
Stringin the attribute. Try replacing it with a_like#[serde_as(as = "HashMap<_, OneOrMany<_>>")]. Unfortunately if you want to use the normal serialization behavior of a type you have to use_since just writing the type will lead to the error you report.