I try to use the nelmioapidocbundle :
namespace App\Controller;
use App\Entity\User;
use Lexik\Bundle\JWTAuthenticationBundle\Services\JWTTokenManagerInterface;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface;
use Symfony\Component\Security\Core\User\UserInterface;
use App\Service\UserService;
use Nelmio\ApiDocBundle\Annotation as Doc;
use Symfony\Component\Routing\Annotation\Route;
t works when I use the config description like this
paths:
/api/login_check:
post:
tags:
- Login
description: Login into the api.
produces:
- application/json
parameters:
- name: username
description: User to login
in: body
required: true
schema:
type: object
properties:
_username:
type: string
_password:
type: string
responses:
'200':
description: Login successful
schema:
type: object
properties:
token:
type: string
but when I use annotations (with is installed, I can use @Route without any problem, I get this error :
[Semantical Error] The annotation "@Nelmio\ApiDocBundle\Annotation\ApiDoc" in method App\Controller\AuthController::register() was never imported. Did you maybe forget to add a "use" statement for this annotation? in /Sites/symfony/guest/config/routes/../../src/Controller/ (which is being imported from "Sites/symfony/guest/config/routes/annotations.yaml"). Make sure annotations are installed and enabled.
Any idea ?