diff --git a/Extractor/Handler/JmsSecurityExtraHandler.php b/Extractor/Handler/JmsSecurityExtraHandler.php index 87dfdc2..4302ee5 100644 --- a/Extractor/Handler/JmsSecurityExtraHandler.php +++ b/Extractor/Handler/JmsSecurityExtraHandler.php @@ -11,6 +11,7 @@ namespace Nelmio\ApiDocBundle\Extractor\Handler; +use JMS\SecurityExtraBundle\Annotation\PreAuthorize; use Nelmio\ApiDocBundle\Extractor\HandlerInterface; use Nelmio\ApiDocBundle\Annotation\ApiDoc; use Symfony\Component\Routing\Route; @@ -21,7 +22,7 @@ class JmsSecurityExtraHandler implements HandlerInterface public function handle(ApiDoc $annotation, array $annotations, Route $route, \ReflectionMethod $method) { foreach ($annotations as $annot) { - if ($annot instanceof Secure) { + if ($annot instanceof Secure || $annot instanceof PreAuthorize) { $annotation->setAuthentication(true); } }