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
execute the codegen-generate command on a file with multipart/form-data and what you get is: ResponseEntity<UUID> create(@Parameter(in = ParameterIn.DEFAULT, description = "",schema=@Schema()) @RequestParam(value="name", required=false) String name, @Parameter(description = "file detail") @Valid @RequestPart("file") MultipartFile graphic);
Description
When generating code for Spring for file upload, it's not possible to make the file optional and not mandatory and the name is fixed to 'file'
Swagger-codegen version
3.0.35
Swagger declaration file content or url
Command line used for generation
swagger-codegen generate -i api.yml -l spring
Steps to reproduce
execute the codegen-generate command on a file with multipart/form-data and what you get is:
ResponseEntity<UUID> create(@Parameter(in = ParameterIn.DEFAULT, description = "",schema=@Schema()) @RequestParam(value="name", required=false) String name, @Parameter(description = "file detail") @Valid @RequestPart("file") MultipartFile graphic);
it should be:
ResponseEntity<UUID> create(@Parameter(in = ParameterIn.DEFAULT, description = "",schema=@Schema()) @RequestParam(value="name", required=false) String name, @Parameter(description = "file detail") @Valid @RequestPart("graphic", required=false) MultipartFile graphic);
Related issues/PRs
It's the same issue as this one: #9250
The text was updated successfully, but these errors were encountered: