title: Spring Boot \ JWT: The method ok(T) in the type ResponseEntity is not applicable for the arguments (JwtResponse)
body: <p>I have this method below.</p>
  <p>JwtResponse is a simple POJO.</p>
  <p>Why do I get the error in subject on</p>
  <pre><code>ResponseEntity.ok(new JwtResponse...
  </code></pre>
  <p>and how to fix it?</p>
  <pre><code>@PostMapping(&quot;/signin&quot;)
  public ResponseEntity&lt;?&gt; authenticateUser(@Valid @RequestBody LoginRequest loginRequest) {
  
      Authentication authentication = authenticationManager.authenticate(
              new UsernamePasswordAuthenticationToken(loginRequest.getUsername(), loginRequest.getPassword()));
  
      SecurityContextHolder.getContext().setAuthentication(authentication);
      String jwt = jwtUtils.generateJwtToken(authentication);
      
      UserDetailsImpl userDetails = (UserDetailsImpl) authentication.getPrincipal();      
      List&lt;String&gt; roles = userDetails.getAuthorities().stream()
              .map(item -&gt; item.getAuthority())
              .collect(Collectors.toList());
  
      return ResponseEntity.ok(new JwtResponse(jwt, 
                                               userDetails.getId(), 
                                               userDetails.getUsername(), 
                                               userDetails.getEmail(), 
                                               roles));
  }
  </code></pre>