Skip to content

Commit

Permalink
feat: set real _api_resource_class for GetWebResponseByPathController
Browse files Browse the repository at this point in the history
  • Loading branch information
ambroisemaupate committed Feb 8, 2022
1 parent e2f1a57 commit f9c0804
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/Api/Controller/GetWebResponseByPathController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f9c0804

Please sign in to comment.