typeshare icon indicating copy to clipboard operation
typeshare copied to clipboard

Enums with numeric discriminants

Open HHogg opened this issue 1 year ago • 2 comments

For typescript generation, I'd have expected this

#[derive(Deserialize, Serialize)]
#[typeshare]
enum Enum {
    Foo = 3,
    Bar = 2,
    Baz = 1,
}

to be output as ...

export enum Enum {
    Foo = 3,
    Bar = 2,
    Baz = 1,
}

but it is output as

export enum Enum {
    Foo = "Foo",
    Bar = "Bar",
    Baz = "Baz",
}

HHogg avatar Apr 19 '23 20:04 HHogg

Hello, and thank you for submitting an issue! We will be investigating this soon.

LuminaSapphira avatar May 02 '23 20:05 LuminaSapphira

This is the exact issue I was looking to solve with changing from ts-rs. Any status updates?

flukejones avatar Jun 27 '23 06:06 flukejones