I am writing a web service. I use @RestController . For example, there is a method that returns the user by id:
@RequestMapping(value = "/{id}", method = RequestMethod.GET) public ResponseEntity userById(@PathVariable("id") Long id) { return new ResponseEntity(entityConverter.userToDTO(userService.getById(id)), HttpStatus.OK); } I use Intellij Idea. This method works as it should, but the IDE writes a warning:
Warning: (35, 28) Unchecked call to 'ResponseEntity (T, HttpStatus)' as a member of raw type 'org.springframework.http.ResponseEntity'
How to handle it correctly?