hey-api / openapi-ts

🚀 The OpenAPI to TypeScript codegen. Generate clients, SDKs, validators, and more. Support: @mrlubos
https://heyapi.dev
Other
1.39k stars 107 forks source link

Experinemtal parser generates inconsistent operation enum naming #1315

Open mariusch opened 1 day ago

mariusch commented 1 day ago

Description

Description

The experimental OpenAPI parser is generating inconsistent naming patterns for operation enums compared to the previous parser.

Previous: export const Operation = { EQUALS: "Equals", NOT_EQUALS: "NotEquals", IN: "In", NOT_IN: "NotIn", GREATER_THEN: "GreaterThen", LESS_THAN: "LessThan", BETWEEN: "Between", EMPTY: "Empty", NOT_EMPTY: "NotEmpty", NONE: "None", } as const;

Current: export const Operation = { EQUALS: "Equals", NOTEQUALS: "NotEquals", IN: "In", NOTIN: "NotIn", GREATERTHEN: "GreaterThen", LESSTHAN: "LessThan", BETWEEN: "Between", EMPTY: "Empty", NOTEMPTY: "NotEmpty", NONE: "None", } as const;

This breaks existing code that references these enum values and introduces inconsistency in the naming convention.

Expected Behavior

Operation enum values should maintain consistent underscore-separated naming (e.g., NOT_EQUALS) as in the previous parser.

Current Behavior

Operation enum values are generated without underscores (e.g., NOTEQUALS), breaking existing code references.

Reproducible example or configuration

No response

OpenAPI specification (optional)

No response

System information (optional)

No response

mrlubos commented 1 day ago

Yep! https://github.com/hey-api/openapi-ts/issues/1244