[REQ][CSHARP][GENERICHOST] Support stream for binary response#21677
[REQ][CSHARP][GENERICHOST] Support stream for binary response#21677wing328 merged 7 commits intoOpenAPITools:masterfrom
Conversation
|
Very cool, thanks! Can you add something to the petstore and build the samples? |
|
@devhl-labs Thank you! Looks like I got some work to do for backwards compatibility. |
f08f62d to
58259f2
Compare
|
@alec-petersen thanks for the pr @devhl-labs is this PR ready? if yes, i will get it merged asap |
| {{/responses}} | ||
| {{#responses}} | ||
| {{#isBinary}} | ||
| {{#-first}} |
There was a problem hiding this comment.
I guess you want the first response which is a binary, but i don't think this first will filter the way you want.
There was a problem hiding this comment.
How do ya mean? And yeah the goal here is just to add the section if there is a binary response, there may be a better way of accomplishing that in a more mustachey way haha
There was a problem hiding this comment.
I think the first will get rendered every time. Pretty sure we can only use first like this on arrays.
There was a problem hiding this comment.
There is a first lambda besides the one you used here but it requires a two space delimiter which is not ideal for a multiline string.
There was a problem hiding this comment.
It seems to have the effect I intended, I'd need to understand the failure scenario maybe.
|
Lets just send it. My concern can be fixed in a another pr. |
…ITools#21677) * Add ContentStream property to ApiResponse * Add a constructor which sets ContentStream * Create and use a memory stream for binary model types * Remove extra space * Update samples * Add {{nrt?}} to support older versions * Remove public modifier for interface property
Fixes #21676
Creates a switch statement on the HttpStatusCode to determine how to create the ApiResponse.
PR checklist
Commit all changed files.
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*.IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
master(upcoming7.x.0minor release - breaking changes with fallbacks),8.0.x(breaking changes without fallbacks)"fixes #123"present in the PR description)