Currently, File type is employed in generated codes from oas v3 with format binary.
I think InputStream type is more suitable for it.
I locally test with jersey, and found that jersey accepts File type as request body entity, but it internally writes the binary stream to local disk, and passes the wrote file to the resource class argument.
It is not good for performance, so I think we should change type into InputStream
current master (abe741f)
https://gist.github.com/fujigon/dd00a99b79a2bc811761b29e63e08a39#file-openapi-yaml
# git clone, etc
mvn package
java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -i openapi.yaml -g jaxrs-jersey
execute the command, and it successfully runs.
I get
https://github.com/fujigon/openapi-generator/tree/feature/fix-primitive-type-resolve
I would like to +1 this idea. My scenario is slightly different in that I could use an InputStream on the Java client side. The client generated method returns a File object. I want the bytes to be streamed and read in, so it's inefficient to write the bytes to disk then immediately read them back into memory.
This seems to be related to #6715
File is replaced with Resource for the resttemplate
Any update this?
Most helpful comment
I would like to +1 this idea. My scenario is slightly different in that I could use an InputStream on the Java client side. The client generated method returns a File object. I want the bytes to be streamed and read in, so it's inefficient to write the bytes to disk then immediately read them back into memory.