From f9c080447501baf988f027aa719abd77c4676724 Mon Sep 17 00:00:00 2001 From: Ambroise Maupate Date: Tue, 8 Feb 2022 12:56:23 +0100 Subject: [PATCH] feat: set real _api_resource_class for GetWebResponseByPathController --- src/Api/Controller/GetWebResponseByPathController.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Api/Controller/GetWebResponseByPathController.php b/src/Api/Controller/GetWebResponseByPathController.php index 4ca48b2e..3cf0a575 100644 --- a/src/Api/Controller/GetWebResponseByPathController.php +++ b/src/Api/Controller/GetWebResponseByPathController.php @@ -55,6 +55,7 @@ public function __invoke(): ?WebResponseInterface (string) $this->requestStack->getMainRequest()->query->get('path') ); $this->requestStack->getMainRequest()->attributes->set('data', $resource); + $this->requestStack->getMainRequest()->attributes->set('_api_resource_class', get_class($resource)); return $this->webResponseDataTransformer->transform($resource, WebResponseInterface::class); } catch (ResourceNotFoundException $exception) { throw new NotFoundHttpException($exception->getMessage(), $exception);