Skip to content

Equal naming for asPascalConst enum constants and types #2491

@julian99m

Description

@julian99m

PR #2467 changed the behavior of the generated enum types and constants.

While the constants have the expected name, the corresponding types always have the Key suffix. This can be undesirable (and even a breaking change) for users who relied on the type and constant names being equal. Equal naming of the type and constant can be very convenient / easy to read for users.

New behavior:

export const GetPetsStatusEnum = { available: "available", ... } as const
export type GetPetsStatusEnumKey = (typeof GetPetsStatusEnum)[keyof typeof GetPetsStatusEnum]

Previous and desired behavior:

export const GetPetsStatusEnum = { available: "available", ... } as const
export type GetPetsStatusEnum = (typeof GetPetsStatusEnum)[keyof typeof GetPetsStatusEnum]

Metadata

Metadata

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions