Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enums with numeric discriminants #106

Open
HHogg opened this issue Apr 19, 2023 · 2 comments
Open

Enums with numeric discriminants #106

HHogg opened this issue Apr 19, 2023 · 2 comments
Assignees
Labels
improvement Improvement to an already-existing feature.

Comments

@HHogg
Copy link

HHogg commented Apr 19, 2023

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",
}
@CerulanLumina CerulanLumina added the improvement Improvement to an already-existing feature. label May 2, 2023
@CerulanLumina
Copy link
Collaborator

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

@flukejones
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Improvement to an already-existing feature.
Projects
None yet
Development

No branches or pull requests

4 participants