Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JavaSpring] Fix template to handle multipart/form-data operations correctly #1099

Merged
merged 2 commits into from
Nov 5, 2023

Conversation

radarsh
Copy link
Contributor

@radarsh radarsh commented Jan 26, 2023

This addresses a number of issues, mainly around the handling of multipart/form-data for OpenAPI operations.

  1. Fixes [spring] [v3] @RequestPart should use "{{basename}}" instead of "file" and observe "required" attribute swagger-codegen#11935
  2. Fixes [JavaSpring] Usage of multipart/form-data with multiplefile lead to unrunnable code #1081
  3. Resolves [JavaSpring] Is there an ETA to implement file uploads in version 3? #836 (I think)

I've also changed @RequestParam to @RequestPart if the codegen parameter is a multipart one as not doing so will lead to Spring exceptions about missing converter service.

Please help merge this PR as it's quite an annoyance otherwise to live with this issue.

…ectly

Replace hardcoded name 'file' in RequestPart with baseName
Respect required flag for RequestPart
Use RequestPart instead of RequestParam for multipart operations
@HugoMario HugoMario mentioned this pull request Nov 5, 2023
@HugoMario HugoMario merged commit f31e101 into swagger-api:master Nov 5, 2023
3 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants