-
-
Notifications
You must be signed in to change notification settings - Fork 484
Open
Labels
workaroundA workaround has been providedA workaround has been provided
Description
How can I configure the generation of an enum with UPPER_CASE keys?
"TaskType": {
"title": "TaskType",
"enum": [
"test_type_1",
"test_type_2",
"test_type_3",
"invalid_type",
],
"type": "string",
"description": "An enumeration."
}
The generated out is :
export type TaskType =
(typeof TaskType)[keyof typeof TaskType];
export const TaskType = {
test_type_1: "test_type_1",
test_type_2: "test_type_2",
test_type_3: "test_type_3",
invalid: "invalid"
} as const;
Expected enum:
export type TaskType =
(typeof TaskType)[keyof typeof TaskType];
export const TaskType = {
TEST_TYPE_1: "test_type_1",
TEST_TYPE_2: "test_type_2",
TEST_TYPE_3: "test_type_3",
INVALID: "invalid"
} as const;
Metadata
Metadata
Assignees
Labels
workaroundA workaround has been providedA workaround has been provided