swagger-api / swagger-api/swagger-codegen

[C#] Generated Csharp SDK enum names have '_' missing

Open
#8,987 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description

We generated Csharp SDK using swagger codegen and we had some enums in our JSON having names eg FIRST_ENUM . Now when the SDK got generated we see the Enum name changed to FIRSTENUM . It reduces the readability of our SDK . Why is that so ?

Swagger-codegen version

Swagger Codegen version: 2.3.1-SNAPSHOT

Command line used for generation

java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate -i json/sample.json -l csharp -o ~/Desktop/SDK/CSharpSDK -DdateLibrary=legacy

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

Start by reproducing the issue with the documented swagger-codegen-cli.jar command, using json/sample.json and the csharp generator. Compare enum names in the input JSON with those in the generated CSharpSDK. Done means generated enum names retain the underscores without reducing other identifier conversions.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
tooling
Issue type
Bug
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.