OpenAPITools / OpenAPITools/openapi-generator

[REQ][C#] FileStream is assumed for multi-part form data - should not assume this as files could be memory based

Open
#9,504 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement: Feature
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

https://github.com/OpenAPITools/openapi-generator/blob/2f2e250ab2d75129fc9f4e21b4225d7fb1acca85/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Client/ApiClient.cs#L276-L288

The seems to indicate that the expectation is to have a FileStream.

Expectation is the ability to upload files that are purely in-memory and have no filesystem backing.

A MemoryStream would work, but then the filename is lost. Needs a way to define the filename of the stream for non-filestream.s

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 samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Client/ApiClient.cs lines 276-288 to inspect where multipart uploads assume FileStream. Verify how a stream-backed file can retain a filename without filesystem backing; done means in-memory uploads work while the filename is preserved.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
api
Issue type
Feature
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.