swagger-api / swagger-api/swagger-codegen

Where can I find the CSharp generator class in branch 3.0.0 so I can edit it?

Open
#11,644 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

I'm using the latest version from branch 3.0.0 (3.0.32 (current stable)) and wanted to make modifications to the CSharp generator. I noticed that unlike V2 there's no longer a languages folder where I can find the language-specific classes and that it was moved to a separate repo.

Since I'm not a Java expert, I'm not sure how the generator gets the language-specific classes in runtime when running the following command locally (Is it possible they're embedded somewhere in the jar?):

c:\source\oas3-migration\swagger-codegen>java --add-opens=java.base/java.util=ALL-UNNAMED -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate -l csharp -i C:/source/openapi/spec.json -o /tmp/dotnet -t C:\source\oas3-migration\dotnet-swagger-templates -c my-config.json

So, how/where can I find and edit the default CSharp generator classes (i.e. CSharpClientCodegen.java) in the current project? What command/param should I run/use to tell the generator to use the "override" of CSharpClientCodegen?

Thanks in advance!

Swagger-codegen version

I'm using the latest version from branch 3.0.0 (3.0.32 (current stable))

Swagger declaration file content or URL

N/A

Command line used for generation
c:\source\oas3-migration\swagger-codegen>java --add-opens=java.base/java.util=ALL-UNNAMED -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate -l csharp -i C:/source/openapi/spec.json -o /tmp/dotnet -t C:\source\oas3-migration\dotnet-swagger-templates -c my-config.json
Steps to reproduce
  • Get the latest version from branch 3.0.0
  • Run mvn clean install -DskipTests
  • Generate client running the command specified above
Related issues/PRs
Suggest a fix/enhancement

It'd be great if we could expand the documentation with the scenario described in this issue.

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 with the CLI command in the issue and inspect the swagger-codegen-generators repository alongside the CSharpClientCodegen.java reference. Document where the default C# generator is located, how it is loaded at runtime, and which command or parameter supports an override; the documentation is done when this workflow is explained clearly.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, java
Domain
documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 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.