Open matrixguy opened 4 years ago
have the same issue in 5.3.0
Any workarounds?
Still have the same issue in the latest plugin 6.2.1. Any suggestions or workarounds for this issue?
I'm also using version 6.2.1 and ran into the same bug today. The only fix I could find was to replace the annotation after code generation.
I'm now using the suggested workaround using the com.google.code.maven-replacer-plugin to replace the generated @RequestParam annotation with @RequestPart.
Add <templateDirectory>${project.basedir}/src/main/resources/custom</templateDirectory>
to your maven config of a openapi generator inside configuration tag.
Add custom package inside resources
Copy and paste https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/resources/JavaSpring/formParams.mustache inside there
Edit RequestParam to RequestPart
Bug Report Checklist
Description
Spring-cloud generator(feign client) adding @RequestParam instead of @RequestPart for MultipartFile
openapi-generator version
4.3.0
OpenAPI declaration file content or url
Generated Code
Command line used for generation
Generated using gradle task.
Suggest a fix
Generate @RequestPart instead of @RequestParam , may require changes in template.