OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
When generating the Api class for RestAssured and creating methods for composing and adding data to the RequestSpecBuilder, the generated method for adding a list of files (List<java.io.File>) to the reqSpec creates code that is unable to compile.
The generated code tries to pass the list directly to reqSpec.addMultiPart(java.io.File file) which only accepts a single file.
Description
When generating the Api class for RestAssured and creating methods for composing and adding data to the
RequestSpecBuilder
, the generated method for adding a list of files (List<java.io.File>
) to thereqSpec
creates code that is unable to compile.The generated code tries to pass the list directly to
reqSpec.addMultiPart(java.io.File file)
which only accepts a single file.openapi-generator version
4.3.1
OpenAPI declaration file content or url
Command line used for generation
Java version: 11.0.7-amzn Gradle version: 6.8.3
build.gradle
:CLI:
gradle :openApiGenerate
or./gradlew :openApiGenerate
Steps to reproduce
build.gradle
file withopenApiGenerate
task as pasted abovegradle :openApiGenerate
filesMultiPart
)Related issues/PRs
Suggest a fix/enhancement
Generated method
filesMultiPart
should iterate over the list of files, adding each individually: