Closed moogstuart closed 2 years ago
Stumbled into the same issue. @dtolnay, may I ask you for the help with this issue? I'm interested in implementing it.
I'd prefer not to build this into serde_derive, but anyone should feel free to write a Serialize
/Deserialize
derive macro that implements this representation. That shouldn't require changes in the serde crate.
It would be great to have support for the following enum representation which is kind of a combination of externally and adjacently tagged e.g. externally_with_adjacent (terrible name but I can't think of a good one at the moment).
Would be represented as:-
Although the Request part is duplicated in the adjacent tag and the first part of the nested keys this allows for receiving json with just the message type and no extra fields (for this example that might not make sense but for other it could be useful.