-
-
Notifications
You must be signed in to change notification settings - Fork 547
Open
Description
I have the problem that Enum don't seem to be exported in the schema + the transformation of enum to union could be heavily improved.
Current situation
Models:
export type TypeEnum = 'ONE' | 'TWO' | 'THREE';Schemas:
export const $TypeEnum = {
type: 'Enum',
} as const;Improved code
Models:
export const TypeEnum = {
ONE: 'ONE',
TWO: 'TWO',
THREE: 'THREE',
} as const;
export type TypeEnum = typeof TypeEnum[keyof typeof TypeEnum];Schemas:
export const $TypeEnum = {
type: 'Enum',
items: ['ONE', 'TWO', 'THREE'],
} as const;See also https://maxheiber.medium.com/alternatives-to-typescript-enums-50e4c16600b1 and maybe this is also an improvement for #988
alexander-eltsov, lucsky, galah92 and guyyst
Metadata
Metadata
Assignees
Labels
No labels