serde_with
serde_with copied to clipboard
Consider format when deserializing OneOrMany
During serialization, the format (e.g. PreferOne or PreferMany) is being used to determine preference, but in de-serialization, it's attempting to de-serialize one and then many if it fails. The format should be considered there too to allow for more flexibility.
I'm not sure I understand the request here and what you want to achieve. You want that with OneOrMany<_, PreferOne> it tries to deserialize the single variant first and only if that fails to move to the many, but OneOrMany<_, PreferMany> should operate the opposite and attempt the many form first? What flexibility do you want to achieve with this?