Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
1.11.3
Description
(Full code examples in unit tests of attached PR).
Want to be able to serde to/from an enum containing structs for a union schema containing record(s):
{ "name": "C", "type": "record", "fields": [ ... {"name": "field_union", "type": ["A", "B"]}, ... ] }
With code like:
struct A {...} struct B {...} #[serde(untagged)] enum UnionAB { A(A), B(B)} struct C { ... field_union: UnionAB, ... }
Likewise, want to be able to serde where the schema includes null:
{ "name": "E", "type": "record", "fields": [ ... {"name": "field_union", "type": ["A", "null", "B"]}, ... ] }
#[serde(untagged)] enum UnionANoneB { A(A), None, B(B), }
Attachments
Issue Links
- links to