How to Define Streaming for Swagger Codegen for Large JSON Fields and File Uploads in .NET 8 Service?

Hey everyone, I’m working on a .NET 8 service that takes in JSON data. Most of the time, the JSON is small, but occasionally, some fields can get way too large — like 100MB big. I’m thinking of streaming these fields to avoid memory issues.

Additionally, I have an endpoint for file uploads that needs to take in binary data, and I want to enable streaming for that as well.

The challenge is figuring out how to define my service so that Swagger can generate clients in different languages that correctly handle streaming.

Has anyone done something similar? How do you define the service so that Swagger Codegen generates clients with streaming support? Or is there a way for the clients to handle streaming internally without explicitly defining it?

Is my approach flawed, or is there a better way to handle this?