serde_with icon indicating copy to clipboard operation
serde_with copied to clipboard

Consider format when deserializing OneOrMany

Open abdelq opened this issue 1 year ago • 1 comments

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.

abdelq avatar Aug 27 '24 16:08 abdelq

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?

jonasbb avatar Aug 27 '24 19:08 jonasbb