-
Notifications
You must be signed in to change notification settings - Fork 56
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
feat(controller): support receiving MultipartFile
s
#3165
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3165 +/- ##
=======================================
Coverage 92.65% 92.65%
=======================================
Files 85 85
Lines 3187 3187
Branches 778 778
=======================================
Hits 2953 2953
Misses 182 182
Partials 52 52
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
MultipartFile
s to objectsMultipartFile
s to objects
To be clear, this also works for top-level parameters: public String uploadAvatar(String user, MultipartFile file) {
return String.format("The avatar for %s is %d bytes.\n", user, file.getSize());
} Request follows:
|
MultipartFile
s to objectsMultipartFile
s
Quality Gate passedIssues Measures |
Multipart requests are supposed to contain some files (with name) and one JSON part named "hilla_body_part", which contains the ordinary data.
The part names for files must be named according to the JSON syntax for accessing a JSON object. So, for example, if a method has a parameter named
uploadedFile
, the corresponding path will be/uploadedFile
. But paths can also point anywhere in the object, like/orders/1/invoice
.Closes #3130