You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Our Swagger 2.0 specs include several services that pass and receive binary data in the body (type="string, format="byte"), represented by content-type application/octet-stream (with respective consumes and produces clauses).
When generating Java for these services, code generator treats input and output as String, which is not suitable for binary data.
It would be advisable to generate byte[] parameter, and also avoid serialization treatment.
I would consider contributing this code (for Java only), if you find this appropriate.
Activity
fehguy commentedon Apr 21, 2015
Would like this implantation especially with tests. Thank you!
mgvirtzm commentedon Apr 28, 2015
The following workaround worked for me, and currently I'm not planning to modify the codegen sources.
Preconditions:
binary body is defined in Swagger JSON as follows (might occur in multiple paths; 'binaryData' name is mandatory):
The following overriding class is placed at appropriate location in the source tree:
Each time after generating the code, run the following commands:
I'm not closing the issue (anyway, preferred to implement it without workaround).
wing328 commentedon Jan 23, 2016
Java API client now supports
binaryformat via #1898