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
The official Swagger 2.0 documentation states binary string arrays as the workaround for specifying a multipart/form-data upload with multiple files in one field (like a file array).
However, uploading an arbitrary number of files (an array of files) is not supported. There is an open feature request at OAI/OpenAPI-Specification#254. For now, you can use a binary string array as a workaround for uploading an arbitrary number of files:
type: arrayitems:
type: stringformat: binary
Swagger UI already has problems correctly rendering this type, but code generation (for Java okhttp-gson and Swift5 at least) "fails" as well. The code generation itself is done without errors, but the request isn't formed correctly.
Swagger-codegen version
2.4.9
Swagger declaration file content or url
parameters:
- in: formDataname: imagesdescription: Image files for the posttype: arrayitems:
type: stringformat: binary
The codegen templates for Java with okhttp-gson and Swift5 (Alamofire) should interpret arrays with binary strings as file parameters. Like swagger-codegen for the normal Java client does.
The text was updated successfully, but these errors were encountered:
Description
The official Swagger 2.0 documentation states binary string arrays as the workaround for specifying a multipart/form-data upload with multiple files in one field (like a file array).
Swagger UI already has problems correctly rendering this type, but code generation (for Java okhttp-gson and Swift5 at least) "fails" as well. The code generation itself is done without errors, but the request isn't formed correctly.
Swagger-codegen version
2.4.9
Swagger declaration file content or url
Command line used for generation
Java (okhttp-gson):
java -jar swagger-codegen-cli.jar generate -DhideGenerationTimestamp=true -DartifactId="android-client" -DartifactVersion="0.1" -i openApi.yml -l java --library=okhttp-gson -o build/
Swift5:
java -jar swagger-codegen-cli.jar generate -i openApi.yml -l swift5 -o build/
Steps to reproduce
Related issues/PRs
OAI/OpenAPI-Specification#254
swagger-api/swagger-codegen-generators#150
PR: #9840
Suggest a fix/enhancement
The codegen templates for Java with okhttp-gson and Swift5 (Alamofire) should interpret arrays with binary strings as file parameters. Like swagger-codegen for the normal Java client does.
The text was updated successfully, but these errors were encountered: