swagger-api / swagger-api/swagger-codegen
[C#] BUG generate csharp client library
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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