💡 Feature description
It would be cool if we could use fat enum (type unions) as a first-class citizen with dynomite. For example, serde_dynamodb supports this via serde, but I am not sure how we should go about this in dynomite
💻 Basic example
#[derive(Item, Clone)]
struct Shape {
#[dynomite(partition_key)]
id: Uuid,
display_name: String,
#[dynomite(flatten)]
kind: ShapeKind,
}
#[derive(Attributes)]
#[dynomite(tag = "shape_kind")] // tag for internally-tagged enum
enum ShapeKind {
Square {
width: u32,
height: u32,
}
Circle {
radius: u32
},
}
I would expect it to be represented as:
With a flat structure (so that it is possible to use enum properties as partition/sort keys.
💡 Feature description
It would be cool if we could use fat
enum(type unions) as a first-class citizen with dynomite. For example,serde_dynamodbsupports this viaserde, but I am not sure how we should go about this indynomite💻 Basic example
I would expect it to be represented as:
{ "id": "8e4a34e5-dcab-4462-9e81-b8181195b69f", "display_name": "bruh", "shape_kind": "Square", "width": 42, "height": 65, } { "id": "8e4a34e5-dcab-4462-9e81-b8181195b69f", "display_name": "bruh", "shape_kind": "Circle", "radius": 43, }With a flat structure (so that it is possible to use enum properties as partition/sort keys.