My understanding is request parameters is the required id for the method to pass while path variable says this variable should be found in the request process
@PreAuthorize("hasRole('ROLE_COACH')")
@PostMapping(value = "/courses/{courseId}/background/update")
@ResponseStatus(HttpStatus.ACCEPTED)
@ResponseBody
public CourseLiteInfo updateBackground(@RequestParam("file") MultipartFile file,
@PathVariable(value = "courseId") Long courseId) throws IOException {
return new CourseLiteInfo(courseService.updateBackground(courseId, file));
}