I need help I last time create the controller with the single file upload with an object and it's work for me like
My POJO class
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({ "file", "data" })
public class FileWithObject<T> {
@JsonProperty("file")
private MultipartFile file;
@JsonRawValue
@JsonProperty("data")
private T data;
}
MY REST CONTOLLER
@RequestMapping(value="/filestore/{bucket-uuid}/appsport.com/singleFileUploadWithObject/{folder}",
method = RequestMethod.POST)
@ResponseBody
// api work
public String singleFileUploadWithObject(
@PathVariable(name="bucket-uuid", required = true) String bucketUUId,
@PathVariable(name="folder", required = false) String folder,
FileWithObject rawData) {
return pingResponse;
}
My Postman result
That's all work for me. How to send the list of the objects through the postman or is possible to handle that way request like below rest controller
@RequestMapping(value="/filestore/{bucket-uuid}/appsport.com/listOfObjectsWithSingleFile/{folder}", method = RequestMethod.POST)
@ResponseBody
public String listOfObjectsWithSingleFile(
@PathVariable(name="bucket-uuid", required = true) String bucketUUId,
@PathVariable(name="folder", required = false) String folder,
Set<FileWithObject> rawData) {
return pingResponse;
}
How to handle list of objects
[{
"file": fileobject,
"data": "zyz"
},{
"file": fileobject,
"data": "zyz"
}]
I'm trying to creating the api for this blow task




rawDatamethod parameter with@RequestParamand in Postman name the file parameteresrawData.file. As a generic hint the request parameters names should match the object structure of the server side objects which will receive the valuesList<MultipartFile>in theFileWithObject. Something similar with@JsonProperty("file") private MultipartFile file;but the type should be a collection and the name of@JsonPropertyshould be something different thenfile