Open amrk7 opened 7 years ago
@amrk7 thanks for the suggestion. Do you mind submitting a PR so that we can review the change more easily?
If you need help on which file to start, please let us know.
Yes that will be helpful. Which module should I start?
On Feb 26, 2017 3:04 PM, "wing328" notifications@github.com wrote:
@amrk7 https://github.com/amrk7 thanks for the suggestion. Do you mind submitting a PR so that we can review the change more easily?
If you need help on which file to start, please let us know.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/swagger-api/swagger-codegen/issues/4831#issuecomment-282544063, or mute the thread https://github.com/notifications/unsubscribe-auth/AWdlU3i6IAIMSXwP9o4RwpulMeuL-W-dks5rgUcrgaJpZM4MINih .
Description
If the media type is APPLICATION_OCTET_STREAM and the response is a javax.ws.rs.core.StreamingOutput, it would be nice to get an InputStream of bytes at the client side.
Currently the behaviour is, swagger generates its own StreamingOutput model which is apparently useless to do anything.
Swagger-codegen version
Swagger declaration file content or url
Relevant portion of swagger json spec
Command line used for generation
I am generating the spec myself as a part of maven goal through this
Used the following maven plugin artifact to generate code from spec
Steps to reproduce
Return a javax.ws.rs.core.StreamingOutput with media type as APPLICATION_OCTET_STREAM. Jersey streams the data to the client. We need to have client side models that can provide an input stream to consume this.
Suggest a Fix
We can probably return the InputStream from OkHttp if the PRODUCES is APPLICATION_OCTET_STREAM
InputStream is = response.body().byteStream();