From 8c71270c6612424acad7ca907769bd3ebcfeb76a Mon Sep 17 00:00:00 2001 From: Ener-Getick Date: Thu, 4 Aug 2016 22:36:20 +0200 Subject: [PATCH] Update the extension --- DependencyInjection/EXSystApiDocExtension.php | 4 ++++ RouteDescriber/FosRestDescriber.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/DependencyInjection/EXSystApiDocExtension.php b/DependencyInjection/EXSystApiDocExtension.php index 3e0e4f4..87758eb 100644 --- a/DependencyInjection/EXSystApiDocExtension.php +++ b/DependencyInjection/EXSystApiDocExtension.php @@ -11,6 +11,7 @@ namespace EXSyst\Bundle\ApiDocBundle\DependencyInjection; +use FOS\RestBundle\Controller\Annotations\ParamInterface; use Nelmio\ApiDocBundle\Annotation\ApiDoc; use phpDocumentor\Reflection\DocBlockFactory; use Swagger\Annotations\Swagger; @@ -49,6 +50,9 @@ class EXSystApiDocExtension extends Extension if (class_exists(Swagger::class)) { $loader->load('swagger_php.xml'); } + if (interface_exists(ParamInterface::class)) { + $loader->load('fos_rest.xml'); + } $bundles = $container->getParameter('kernel.bundles'); // ApiPlatform support diff --git a/RouteDescriber/FosRestDescriber.php b/RouteDescriber/FosRestDescriber.php index 6dbace7..7da508f 100644 --- a/RouteDescriber/FosRestDescriber.php +++ b/RouteDescriber/FosRestDescriber.php @@ -32,7 +32,7 @@ class FosRestDescriber implements RouteDescriberInterface public function describe(Swagger $api, Route $route, \ReflectionMethod $reflectionMethod) { - $annotations = $this->annotationReader->getMethodAnnotations(); + $annotations = $this->annotationReader->getMethodAnnotations($reflectionMethod); $annotations = array_filter($annotations, function ($value) { return $value instanceof RequestParam || $value instanceof QueryParam; });