swagger-api / swagger-api/swagger-codegen

[C#] BUG generate csharp client library

Open
#10,236 1 comment 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 are using Swagger-codegen version 3.0.19

I have a simple API for upload file.
When i generate the client library csharp, the code generated is not valid.
The parameters is byte[] but should be Stream

this is the link of the API https://gist.github.com/biasc/c910bf26b28a6d76e95d6bc25eed041a

I have tried to edit the type from string to file and the parameter is generated as Stream but then it is not addedd correctly to the localVarFormParams, it is added like a string and not file

Command line used for generation

-jar "%Folder%swagger-codegen-cli-3.0.19.jar" generate -i http://localhost/demoApi/swagger/v1/swagger.json -l csharp -o "%Folder%Generated"

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 Swagger/OpenAPI JSON linked in the issue and the C# client generated by the supplied swagger-codegen command; inspect how the upload parameter is represented and added to localVarFormParams. Done means the generated C# compiles and sends the upload as a Stream/file form value rather than an invalid byte[] or string.

Written by the indexing model from the issue text.

Assessment

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