OpenAPITools / OpenAPITools/openapi-generator

[BUG] [Typescript] Add option to fallback to legacy enum naming

Open
#20,940 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue: Bug
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

Bug Report Checklist
  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • Have you tested with the latest master to confirm the issue still exists?
  • Have you searched for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

The enum value generation has changed in 7.7.0 to add underscores to all generated enum values by default, which breaks backward compatibility of generated code.
This makes it practically infeasible to adopt the latest version of the Typescript generator in my codebase because it contains hundreds of such references.

There have been a number of bug reports on that like https://github.com/OpenAPITools/openapi-generator/issues/19066
and a legacy value for enumPropertyNaming flag has been introduced for the Java generator with https://github.com/OpenAPITools/openapi-generator/pull/20172

The goal of this issue is to port the same flag to the Typescript generator too.

openapi-generator version

7.7.0 - latest (7.12.0)

Related issues/PRs

https://github.com/OpenAPITools/openapi-generator/issues/19066
https://github.com/OpenAPITools/openapi-generator/pull/20172

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Inspect the TypeScript generator's enum naming handling and compare it with the Java generator's legacy enumPropertyNaming support described in pull request #20172. Use issue #19066 for compatibility context; done means the TypeScript generator offers the requested legacy naming option alongside its current behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.