title: API Platform - Create new Ressource without an Entity
body: <p>Hi I'm using <a href="https://api-platform.com/" rel="nofollow noreferrer">API Platform</a>. An API framework based on symfony.</p>
  
  <p>I have created Entities and exposed them with the <code>@ApiResource</code> annotation, so I can see them in the API doc for CRUD. </p>
  
  <p>I would like to add a custom Controller in the swagger api doc. For example my authentification Controller. </p>
  
  <p>How can I do that? </p>
  
  <p>My TokenController:</p>
  
  <pre><code>class TokenController extends Controller
  {
      /**
       * @Route(path="/auth", name="auth")
       *
       * @param Request $request
       * @return JsonResponse
       * @throws \Lexik\Bundle\JWTAuthenticationBundle\Exception\JWTEncodeFailureException
       */
      public function tokenAction(Request $request)
      {
          $em = $this-&gt;getDoctrine()-&gt;getManager();
          $user = $em-&gt;getRepository(User::class)-&gt;findOneBy(array(
              'username' =&gt; $request-&gt;getUser(),
          ));
  
          if(!$user){
              throw $this-&gt;createNotFoundException('No user');
          }
  
          $isValid = $this-&gt;get('security.password_encoder')-&gt;isPasswordValid($user, $request-&gt;getPassword());
  
          if(!$isValid){
              throw new BadCredentialsException();
          }
  
          $token = $this-&gt;get('lexik_jwt_authentication.encoder')-&gt;encode(array(
              'id' =&gt; $user-&gt;getId(),
              'username' =&gt; $user-&gt;getUsername(),
              'roles' =&gt; $user-&gt;getRoles(),
          ));
  
          return new JsonResponse(array(
              'token' =&gt; $token
          ));
      }
  }
  </code></pre>