swagger-api / swagger-api/swagger-codegen

[C#] Getting extra models during client export

Open
#6,447 2 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

Enter the following JSON into https://editor.swagger.io/ and generate a csharp client. In the models folder are Model.cs and Model1.cs. These look to be duplicates of MfdMemberViewModel but I'm not sure what is causing them to be created. Tests are also being created for these models.

Swagger-codegen version: 2.0
JSON gist: https://gist.github.com/evenflow58/801c6570ef36c1bdeafb958e48f9d5de

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

Reproduce the export in https://editor.swagger.io/ using the JSON gist and generate the C# client. Inspect the generated models folder and tests, especially Model.cs, Model1.cs, and MfdMemberViewModel, to identify why duplicates are created; done means the unintended models and their tests are no longer generated.

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.