Skip to content

Feature request: Emit string enums instead of string literal unions #200

Closed
@rkdrnf

Description

I hope enums of string

{
    "title": "TestEnum",
   "type": "string",
    "enum": [
         "A",
         "B"
    ]
}

to be converted as typescript string enum like below.

enum TestEnum {
A = "A",
B = "B"
}

Is there any way to do this?

I need this because I want to reference this enum in other json file as a string,
and also in code, I don't want to use raw string to reference these enum values.

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions