I tried implementing this way, but I get 415 Error
if I send the request. I don't want to split it into two different request. I'm not sure what I am doing wrong.
@ResponseStatus(value = HttpStatus.CREATED)
@PostMapping(value = "/file/new",
consumes = {MediaType.APPLICATION_JSON_VALUE, MediaType.MULTIPART_FORM_DATA_VALUE})
public ResponseEntity<DefaultResponseDto<Object>> createFile(HttpServletRequest servletRequest,
@RequestBody @Valid
PortfolioFileSaveRequestDto request,
@RequestPart MultipartFile file) {
List<String> tokenInfo = jwtProvider.authorizeJwt(servletRequest.getHeader(AUTHORIZATION));
...
Portfolio portfolio = portfolioService.saveFile(request, user.getUsername(), profile, file);
...
}