From 4f6ec8a077ead4e465cb32976ad4b6f24a354032 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wojciech=20B=C5=82oszyk?= Date: Fri, 24 Jul 2020 18:12:53 +0200 Subject: [PATCH] Allow "friendsofsymfony/rest-bundle:^3.0" --- composer.json | 4 +- src/Controller/Api/BlockController.php | 21 +++--- src/Controller/Api/FOSRestController.php | 6 +- src/Controller/Api/PageController.php | 68 +++++++++---------- src/Controller/Api/SiteController.php | 39 ++++++----- src/Controller/Api/SnapshotController.php | 32 ++++----- src/Resources/config/routing/api.xml | 10 +-- src/Resources/config/routing/api/block.xml | 12 ++++ src/Resources/config/routing/api/page.xml | 33 +++++++++ src/Resources/config/routing/api/site.xml | 18 +++++ src/Resources/config/routing/api/snapshot.xml | 12 ++++ tests/App/config/config.yaml | 5 +- 12 files changed, 168 insertions(+), 92 deletions(-) create mode 100644 src/Resources/config/routing/api/block.xml create mode 100644 src/Resources/config/routing/api/page.xml create mode 100644 src/Resources/config/routing/api/site.xml create mode 100644 src/Resources/config/routing/api/snapshot.xml diff --git a/composer.json b/composer.json index 605495883..c2c1911b5 100644 --- a/composer.json +++ b/composer.json @@ -55,13 +55,13 @@ "twig/twig": "^2.12.1" }, "conflict": { - "friendsofsymfony/rest-bundle": "<2.1 || >=3.0", + "friendsofsymfony/rest-bundle": "<2.1", "jms/serializer": "<0.13", "sonata-project/core-bundle": "<3.20" }, "require-dev": { "doctrine/annotations": "1.10.3", - "friendsofsymfony/rest-bundle": "^2.1", + "friendsofsymfony/rest-bundle": "^2.1 || ^3.0", "jms/serializer-bundle": "^2.0 || ^3.0", "matthiasnoback/symfony-dependency-injection-test": "^4.1.1", "nelmio/api-doc-bundle": "^2.4", diff --git a/src/Controller/Api/BlockController.php b/src/Controller/Api/BlockController.php index b94bda047..eeab05251 100644 --- a/src/Controller/Api/BlockController.php +++ b/src/Controller/Api/BlockController.php @@ -13,7 +13,8 @@ namespace Sonata\PageBundle\Controller\Api; -use FOS\RestBundle\Controller\Annotations\View; +use FOS\RestBundle\Controller\Annotations as Rest; +use FOS\RestBundle\View\View; use Nelmio\ApiDocBundle\Annotation\ApiDoc; use Sonata\BlockBundle\Model\BlockInterface; use Sonata\BlockBundle\Model\BlockManagerInterface; @@ -48,7 +49,7 @@ public function __construct(BlockManagerInterface $blockManager, FormFactoryInte * @ApiDoc( * resource=true, * requirements={ - * {"name"="id", "dataType"="integer", "requirement"="\d+", "description"="block id"} + * {"name"="id", "dataType"="integer", "requirement"="\d+", "description"="Block identifier"} * }, * output={"class"="Sonata\PageBundle\Model\BlockInterface", "groups"={"sonata_api_read"}}, * statusCodes={ @@ -57,7 +58,7 @@ public function __construct(BlockManagerInterface $blockManager, FormFactoryInte * } * ) * - * @View(serializerGroups={"sonata_api_read"}, serializerEnableMaxDepthChecks=true) + * @Rest\View(serializerGroups={"sonata_api_read"}, serializerEnableMaxDepthChecks=true) * * @param $id * @@ -73,7 +74,7 @@ public function getBlockAction($id) * * @ApiDoc( * requirements={ - * {"name"="id", "dataType"="integer", "requirement"="\d+", "description"="block identifier"}, + * {"name"="id", "dataType"="integer", "requirement"="\d+", "description"="Block identifier"}, * }, * input={"class"="sonata_page_api_form_block", "name"="", "groups"={"sonata_api_write"}}, * output={"class"="Sonata\PageBundle\Model\Block", "groups"={"sonata_api_read"}}, @@ -84,10 +85,10 @@ public function getBlockAction($id) * } * ) * - * @View(serializerGroups={"sonata_api_read"}, serializerEnableMaxDepthChecks=true) + * @Rest\View(serializerGroups={"sonata_api_read"}, serializerEnableMaxDepthChecks=true) * - * @param int $id A Block identifier - * @param Request $request A Symfony request + * @param int $id Block identifier + * @param Request $request Symfony request * * @throws NotFoundHttpException * @@ -119,7 +120,7 @@ public function putBlockAction($id, Request $request) * * @ApiDoc( * requirements={ - * {"name"="id", "dataType"="integer", "requirement"="\d+", "description"="block identifier"} + * {"name"="id", "dataType"="integer", "requirement"="\d+", "description"="Block identifier"} * }, * statusCodes={ * 200="Returned when block is successfully deleted", @@ -128,11 +129,11 @@ public function putBlockAction($id, Request $request) * } * ) * - * @param int $id A Block identifier + * @param int $id Block identifier * * @throws NotFoundHttpException * - * @return \FOS\RestBundle\View\View + * @return View */ public function deleteBlockAction($id) { diff --git a/src/Controller/Api/FOSRestController.php b/src/Controller/Api/FOSRestController.php index 6ad3dbc1f..9a2b212af 100644 --- a/src/Controller/Api/FOSRestController.php +++ b/src/Controller/Api/FOSRestController.php @@ -16,7 +16,7 @@ use FOS\RestBundle\Context\Context; use FOS\RestBundle\Controller\Annotations\QueryParam; use FOS\RestBundle\Request\ParamFetcherInterface; -use FOS\RestBundle\View\View as FOSRestView; +use FOS\RestBundle\View\View; /** * @author Duchkina Anastasiya @@ -40,7 +40,7 @@ final protected function setMapForOrderByParam(ParamFetcherInterface $paramFetch /** * @param $entity * - * @return FOSRestView + * @return View */ final protected function serializeContext($entity, array $groups) { @@ -48,7 +48,7 @@ final protected function serializeContext($entity, array $groups) $context->setGroups($groups); $context->enableMaxDepth(); - $view = FOSRestView::create($entity); + $view = View::create($entity); $view->setContext($context); return $view; diff --git a/src/Controller/Api/PageController.php b/src/Controller/Api/PageController.php index 656287609..a48af1750 100644 --- a/src/Controller/Api/PageController.php +++ b/src/Controller/Api/PageController.php @@ -13,9 +13,9 @@ namespace Sonata\PageBundle\Controller\Api; -use FOS\RestBundle\Controller\Annotations\QueryParam; -use FOS\RestBundle\Controller\Annotations\View; +use FOS\RestBundle\Controller\Annotations as Rest; use FOS\RestBundle\Request\ParamFetcherInterface; +use FOS\RestBundle\View\View; use Nelmio\ApiDocBundle\Annotation\ApiDoc; use Sonata\BlockBundle\Model\BlockInterface; use Sonata\BlockBundle\Model\BlockManagerInterface; @@ -76,17 +76,17 @@ public function __construct(SiteManagerInterface $siteManager, PageManagerInterf * output={"class"="Sonata\DatagridBundle\Pager\PagerInterface", "groups"={"sonata_api_read"}} * ) * - * @QueryParam(name="page", requirements="\d+", default="1", description="Page for 'page' list pagination") - * @QueryParam(name="count", requirements="\d+", default="10", description="Number of pages by page") - * @QueryParam(name="enabled", requirements="0|1", nullable=true, strict=true, description="Enabled/Disabled pages filter") - * @QueryParam(name="edited", requirements="0|1", nullable=true, strict=true, description="Edited/Up to date pages filter") - * @QueryParam(name="internal", requirements="0|1", nullable=true, strict=true, description="Internal/Exposed pages filter") - * @QueryParam(name="root", requirements="0|1", nullable=true, strict=true, description="Filter pages having no parent id") - * @QueryParam(name="site", requirements="\d+", nullable=true, strict=true, description="Filter pages for a specific site's id") - * @QueryParam(name="parent", requirements="\d+", nullable=true, strict=true, description="Get pages being child of given page id") - * @QueryParam(name="orderBy", map=true, requirements="ASC|DESC", nullable=true, strict=true, description="Order by array (key is field, value is direction)") + * @Rest\QueryParam(name="page", requirements="\d+", default="1", description="Page for 'page' list pagination") + * @Rest\QueryParam(name="count", requirements="\d+", default="10", description="Number of pages by page") + * @Rest\QueryParam(name="enabled", requirements="0|1", nullable=true, strict=true, description="Enabled/Disabled pages filter") + * @Rest\QueryParam(name="edited", requirements="0|1", nullable=true, strict=true, description="Edited/Up to date pages filter") + * @Rest\QueryParam(name="internal", requirements="0|1", nullable=true, strict=true, description="Internal/Exposed pages filter") + * @Rest\QueryParam(name="root", requirements="0|1", nullable=true, strict=true, description="Filter pages having no parent id") + * @Rest\QueryParam(name="site", requirements="\d+", nullable=true, strict=true, description="Filter pages for a specific site's id") + * @Rest\QueryParam(name="parent", requirements="\d+", nullable=true, strict=true, description="Get pages being child of given page id") + * @Rest\QueryParam(name="orderBy", map=true, requirements="ASC|DESC", nullable=true, strict=true, description="Order by array (key is field, value is direction)") * - * @View(serializerGroups={"sonata_api_read"}, serializerEnableMaxDepthChecks=true) + * @Rest\View(serializerGroups={"sonata_api_read"}, serializerEnableMaxDepthChecks=true) * * @return PagerInterface */ @@ -128,7 +128,7 @@ public function getPagesAction(ParamFetcherInterface $paramFetcher) * * @ApiDoc( * requirements={ - * {"name"="id", "dataType"="integer", "requirement"="\d+", "description"="page id"} + * {"name"="id", "dataType"="integer", "requirement"="\d+", "description"="Page identifier"} * }, * output={"class"="Sonata\PageBundle\Model\PageInterface", "groups"={"sonata_api_read"}}, * statusCodes={ @@ -137,7 +137,7 @@ public function getPagesAction(ParamFetcherInterface $paramFetcher) * } * ) * - * @View(serializerGroups={"sonata_api_read"}, serializerEnableMaxDepthChecks=true) + * @Rest\View(serializerGroups={"sonata_api_read"}, serializerEnableMaxDepthChecks=true) * * @param $id * @@ -153,7 +153,7 @@ public function getPageAction($id) * * @ApiDoc( * requirements={ - * {"name"="id", "dataType"="integer", "requirement"="\d+", "description"="page id"} + * {"name"="id", "dataType"="integer", "requirement"="\d+", "description"="Page identifier"} * }, * output={"class"="Sonata\BlockBundle\Model\BlockInterface", "groups"={"sonata_api_read"}}, * statusCodes={ @@ -162,7 +162,7 @@ public function getPageAction($id) * } * ) * - * @View(serializerGroups={"sonata_api_read"}, serializerEnableMaxDepthChecks=true) + * @Rest\View(serializerGroups={"sonata_api_read"}, serializerEnableMaxDepthChecks=true) * * @param $id * @@ -178,7 +178,7 @@ public function getPageBlocksAction($id) * * @ApiDoc( * requirements={ - * {"name"="id", "dataType"="integer", "requirement"="\d+", "description"="page id"} + * {"name"="id", "dataType"="integer", "requirement"="\d+", "description"="Page identifier"} * }, * output={"class"="Sonata\BlockBundle\Model\BlockInterface", "groups"={"sonata_api_read"}}, * statusCodes={ @@ -187,7 +187,7 @@ public function getPageBlocksAction($id) * } * ) * - * @View(serializerGroups={"sonata_api_read"}, serializerEnableMaxDepthChecks=true) + * @Rest\View(serializerGroups={"sonata_api_read"}, serializerEnableMaxDepthChecks=true) * * @param $id * @@ -205,7 +205,7 @@ public function getPagePagesAction($id) * * @ApiDoc( * requirements={ - * {"name"="id", "dataType"="integer", "requirement"="\d+", "description"="page identifier"} + * {"name"="id", "dataType"="integer", "requirement"="\d+", "description"="Page identifier"} * }, * input={"class"="sonata_page_api_form_block", "name"="", "groups"={"sonata_api_write"}}, * output={"class"="Sonata\PageBundle\Model\Block", "groups"={"sonata_api_read"}}, @@ -216,10 +216,10 @@ public function getPagePagesAction($id) * } * ) * - * @View(serializerGroups={"sonata_api_read"}, serializerEnableMaxDepthChecks=true) + * @Rest\View(serializerGroups={"sonata_api_read"}, serializerEnableMaxDepthChecks=true) * - * @param int $id A Page identifier - * @param Request $request A Symfony request + * @param int $id Page identifier + * @param Request $request Symfony request * * @throws NotFoundHttpException * @@ -260,7 +260,7 @@ public function postPageBlockAction($id, Request $request) * } * ) * - * @param Request $request A Symfony request + * @param Request $request Symfony request * * @throws NotFoundHttpException * @@ -276,7 +276,7 @@ public function postPageAction(Request $request) * * @ApiDoc( * requirements={ - * {"name"="id", "dataType"="integer", "requirement"="\d+", "description"="page identifier"} + * {"name"="id", "dataType"="integer", "requirement"="\d+", "description"="Page identifier"} * }, * input={"class"="sonata_page_api_form_page", "name"="", "groups"={"sonata_api_write"}}, * output={"class"="Sonata\PageBundle\Model\Page", "groups"={"sonata_api_read"}}, @@ -287,8 +287,8 @@ public function postPageAction(Request $request) * } * ) * - * @param int $id A Page identifier - * @param Request $request A Symfony request + * @param int $id Page identifier + * @param Request $request Symfony request * * @throws NotFoundHttpException * @@ -304,7 +304,7 @@ public function putPageAction($id, Request $request) * * @ApiDoc( * requirements={ - * {"name"="id", "dataType"="integer", "requirement"="\d+", "description"="page identifier"} + * {"name"="id", "dataType"="integer", "requirement"="\d+", "description"="Page identifier"} * }, * statusCodes={ * 200="Returned when page is successfully deleted", @@ -313,11 +313,11 @@ public function putPageAction($id, Request $request) * } * ) * - * @param int $id A Page identifier + * @param int $id Page identifier * * @throws NotFoundHttpException * - * @return \FOS\RestBundle\View\View + * @return View */ public function deletePageAction($id) { @@ -333,7 +333,7 @@ public function deletePageAction($id) * * @ApiDoc( * requirements={ - * {"name"="id", "dataType"="integer", "requirement"="\d+", "description"="page identifier"} + * {"name"="id", "dataType"="integer", "requirement"="\d+", "description"="Page identifier"} * }, * statusCodes={ * 200="Returned when snapshots are successfully queued for creation", @@ -342,11 +342,11 @@ public function deletePageAction($id) * } * ) * - * @param int $id A Page identifier + * @param int $id Page identifier * * @throws NotFoundHttpException * - * @return \FOS\RestBundle\View\View + * @return View */ public function postPageSnapshotAction($id) { @@ -371,7 +371,7 @@ public function postPageSnapshotAction($id) * * @throws NotFoundHttpException * - * @return \FOS\RestBundle\View\View + * @return View */ public function postPagesSnapshotsAction() { @@ -430,7 +430,7 @@ protected function getBlock($id) * Write a page, this method is used by both POST and PUT action methods. * * @param Request $request Symfony request - * @param int|null $id A page identifier + * @param int|null $id Page identifier * * @return FormInterface */ diff --git a/src/Controller/Api/SiteController.php b/src/Controller/Api/SiteController.php index f03319964..8b38f8c2f 100644 --- a/src/Controller/Api/SiteController.php +++ b/src/Controller/Api/SiteController.php @@ -13,10 +13,9 @@ namespace Sonata\PageBundle\Controller\Api; -use FOS\RestBundle\Controller\Annotations\QueryParam; -use FOS\RestBundle\Controller\Annotations\View; +use FOS\RestBundle\Controller\Annotations as Rest; use FOS\RestBundle\Request\ParamFetcherInterface; -use FOS\RestBundle\View\View as FOSRestView; +use FOS\RestBundle\View\View; use Nelmio\ApiDocBundle\Annotation\ApiDoc; use Sonata\PageBundle\Model\SiteInterface; use Sonata\PageBundle\Model\SiteManagerInterface; @@ -54,13 +53,13 @@ public function __construct(SiteManagerInterface $siteManager, FormFactoryInterf * output={"class"="Sonata\DatagridBundle\Pager\PagerInterface", "groups"={"sonata_api_read"}} * ) * - * @QueryParam(name="page", requirements="\d+", default="1", description="Page for site list pagination") - * @QueryParam(name="count", requirements="\d+", default="10", description="Maximum number of sites per page") - * @QueryParam(name="enabled", requirements="0|1", nullable=true, strict=true, description="Enabled/Disabled sites filter") - * @QueryParam(name="is_default", requirements="0|1", nullable=true, strict=true, description="Default sites filter") - * @QueryParam(name="orderBy", map=true, requirements="ASC|DESC", nullable=true, strict=true, description="Order by array (key is field, value is direction)") + * @Rest\QueryParam(name="page", requirements="\d+", default="1", description="Page for site list pagination") + * @Rest\QueryParam(name="count", requirements="\d+", default="10", description="Maximum number of sites per page") + * @Rest\QueryParam(name="enabled", requirements="0|1", nullable=true, strict=true, description="Enabled/Disabled sites filter") + * @Rest\QueryParam(name="is_default", requirements="0|1", nullable=true, strict=true, description="Default sites filter") + * @Rest\QueryParam(name="orderBy", map=true, requirements="ASC|DESC", nullable=true, strict=true, description="Order by array (key is field, value is direction)") * - * @View(serializerGroups={"sonata_api_read"}, serializerEnableMaxDepthChecks=true) + * @Rest\View(serializerGroups={"sonata_api_read"}, serializerEnableMaxDepthChecks=true) * * @return PagerInterface */ @@ -99,7 +98,7 @@ public function getSitesAction(ParamFetcherInterface $paramFetcher) * @ApiDoc( * resource=true, * requirements={ - * {"name"="id", "dataType"="integer", "requirement"="\d+", "description"="site id"} + * {"name"="id", "dataType"="integer", "requirement"="\d+", "description"="Site identifier"} * }, * output={"class"="Sonata\PageBundle\Model\SiteInterface", "groups"={"sonata_api_read"}}, * statusCodes={ @@ -108,7 +107,7 @@ public function getSitesAction(ParamFetcherInterface $paramFetcher) * } * ) * - * @View(serializerGroups={"sonata_api_read"}, serializerEnableMaxDepthChecks=true) + * @Rest\View(serializerGroups={"sonata_api_read"}, serializerEnableMaxDepthChecks=true) * * @param $id * @@ -131,7 +130,7 @@ public function getSiteAction($id) * } * ) * - * @param Request $request A Symfony request + * @param Request $request Symfony request * * @throws NotFoundHttpException * @@ -147,7 +146,7 @@ public function postSiteAction(Request $request) * * @ApiDoc( * requirements={ - * {"name"="id", "dataType"="integer", "requirement"="\d+", "description"="site id"}, + * {"name"="id", "dataType"="integer", "requirement"="\d+", "description"="Site identifier"}, * }, * input={"class"="sonata_page_api_form_site", "name"="", "groups"={"sonata_api_write"}}, * output={"class"="Sonata\PageBundle\Model\Site", "groups"={"sonata_api_read"}}, @@ -158,8 +157,8 @@ public function postSiteAction(Request $request) * } * ) * - * @param int $id A Site identifier - * @param Request $request A Symfony request + * @param int $id Site identifier + * @param Request $request Symfony request * * @throws NotFoundHttpException * @@ -175,7 +174,7 @@ public function putSiteAction($id, Request $request) * * @ApiDoc( * requirements={ - * {"name"="id", "dataType"="integer", "requirement"="\d+", "description"="site id"} + * {"name"="id", "dataType"="integer", "requirement"="\d+", "description"="Site identifier"} * }, * statusCodes={ * 200="Returned when site is successfully deleted", @@ -184,11 +183,11 @@ public function putSiteAction($id, Request $request) * } * ) * - * @param int $id A Site identifier + * @param int $id Site identifier * * @throws NotFoundHttpException * - * @return \FOS\RestBundle\View\View + * @return View */ public function deleteSiteAction($id) { @@ -223,9 +222,9 @@ protected function getSite($id) * Write a site, this method is used by both POST and PUT action methods. * * @param Request $request Symfony request - * @param int|null $id A post identifier + * @param int|null $id Site identifier * - * @return FormInterface|FOSRestView + * @return FormInterface|View */ protected function handleWriteSite($request, $id = null) { diff --git a/src/Controller/Api/SnapshotController.php b/src/Controller/Api/SnapshotController.php index 25f13f89e..70cada112 100644 --- a/src/Controller/Api/SnapshotController.php +++ b/src/Controller/Api/SnapshotController.php @@ -13,9 +13,9 @@ namespace Sonata\PageBundle\Controller\Api; -use FOS\RestBundle\Controller\Annotations\QueryParam; -use FOS\RestBundle\Controller\Annotations\View; +use FOS\RestBundle\Controller\Annotations as Rest; use FOS\RestBundle\Request\ParamFetcherInterface; +use FOS\RestBundle\View\View; use Nelmio\ApiDocBundle\Annotation\ApiDoc; use Sonata\DatagridBundle\Pager\PagerInterface; use Sonata\PageBundle\Model\SnapshotInterface; @@ -45,16 +45,16 @@ public function __construct(SnapshotManagerInterface $snapshotManager) * output={"class"="Sonata\DatagridBundle\Pager\PagerInterface", "groups"={"sonata_api_read"}} * ) * - * @QueryParam(name="page", requirements="\d+", default="1", description="Page for snapshots list pagination") - * @QueryParam(name="count", requirements="\d+", default="10", description="Maximum number of snapshots per page") - * @QueryParam(name="site", requirements="\d+", nullable=true, strict=true, description="Filter snapshots for a specific site's id") - * @QueryParam(name="page_id", requirements="\d+", nullable=true, strict=true, description="Filter snapshots for a specific page's id") - * @QueryParam(name="root", requirements="0|1", nullable=true, strict=true, description="Filter snapshots having no parent id") - * @QueryParam(name="parent", requirements="\d+", nullable=true, strict=true, description="Get snapshots being child of given snapshots id") - * @QueryParam(name="enabled", requirements="0|1", nullable=true, strict=true, description="Enabled/Disabled snapshots filter") - * @QueryParam(name="orderBy", map=true, requirements="ASC|DESC", nullable=true, strict=true, description="Order by array (key is field, value is direction)") + * @Rest\QueryParam(name="page", requirements="\d+", default="1", description="Page for snapshots list pagination") + * @Rest\QueryParam(name="count", requirements="\d+", default="10", description="Maximum number of snapshots per page") + * @Rest\QueryParam(name="site", requirements="\d+", nullable=true, strict=true, description="Filter snapshots for a specific site's id") + * @Rest\QueryParam(name="page_id", requirements="\d+", nullable=true, strict=true, description="Filter snapshots for a specific page's id") + * @Rest\QueryParam(name="root", requirements="0|1", nullable=true, strict=true, description="Filter snapshots having no parent id") + * @Rest\QueryParam(name="parent", requirements="\d+", nullable=true, strict=true, description="Get snapshots being child of given snapshots id") + * @Rest\QueryParam(name="enabled", requirements="0|1", nullable=true, strict=true, description="Enabled/Disabled snapshots filter") + * @Rest\QueryParam(name="orderBy", map=true, requirements="ASC|DESC", nullable=true, strict=true, description="Order by array (key is field, value is direction)") * - * @View(serializerGroups={"sonata_api_read"}, serializerEnableMaxDepthChecks=true) + * @Rest\View(serializerGroups={"sonata_api_read"}, serializerEnableMaxDepthChecks=true) * * @return PagerInterface */ @@ -96,7 +96,7 @@ public function getSnapshotsAction(ParamFetcherInterface $paramFetcher) * @ApiDoc( * resource=true, * requirements={ - * {"name"="id", "dataType"="integer", "requirement"="\d+", "description"="snapshot id"} + * {"name"="id", "dataType"="integer", "requirement"="\d+", "description"="Snapshot identifier"} * }, * output={"class"="Sonata\PageBundle\Model\SnapshotInterface", "groups"={"sonata_api_read"}}, * statusCodes={ @@ -105,7 +105,7 @@ public function getSnapshotsAction(ParamFetcherInterface $paramFetcher) * } * ) * - * @View(serializerGroups={"sonata_api_read"}, serializerEnableMaxDepthChecks=true) + * @Rest\View(serializerGroups={"sonata_api_read"}, serializerEnableMaxDepthChecks=true) * * @param $id * @@ -121,7 +121,7 @@ public function getSnapshotAction($id) * * @ApiDoc( * requirements={ - * {"name"="id", "dataType"="integer", "requirement"="\d+", "description"="snapshot id"} + * {"name"="id", "dataType"="integer", "requirement"="\d+", "description"="Snapshot identifier"} * }, * statusCodes={ * 200="Returned when snapshots is successfully deleted", @@ -130,11 +130,11 @@ public function getSnapshotAction($id) * } * ) * - * @param int $id A Snapshot identifier + * @param int $id Snapshot identifier * * @throws NotFoundHttpException * - * @return \FOS\RestBundle\View\View + * @return View */ public function deleteSnapshotAction($id) { diff --git a/src/Resources/config/routing/api.xml b/src/Resources/config/routing/api.xml index 935140022..e270d4900 100644 --- a/src/Resources/config/routing/api.xml +++ b/src/Resources/config/routing/api.xml @@ -1,7 +1,7 @@ - - - - - + + + + + diff --git a/src/Resources/config/routing/api/block.xml b/src/Resources/config/routing/api/block.xml new file mode 100644 index 000000000..cae8ea969 --- /dev/null +++ b/src/Resources/config/routing/api/block.xml @@ -0,0 +1,12 @@ + + + + json|xml|html + + + json|xml|html + + + json|xml|html + + diff --git a/src/Resources/config/routing/api/page.xml b/src/Resources/config/routing/api/page.xml new file mode 100644 index 000000000..11a715cd5 --- /dev/null +++ b/src/Resources/config/routing/api/page.xml @@ -0,0 +1,33 @@ + + + + json|xml|html + + + json|xml|html + + + json|xml|html + + + json|xml|html + + + json|xml|html + + + json|xml|html + + + json|xml|html + + + json|xml|html + + + json|xml|html + + + json|xml|html + + diff --git a/src/Resources/config/routing/api/site.xml b/src/Resources/config/routing/api/site.xml new file mode 100644 index 000000000..6ca0d2e64 --- /dev/null +++ b/src/Resources/config/routing/api/site.xml @@ -0,0 +1,18 @@ + + + + json|xml|html + + + json|xml|html + + + json|xml|html + + + json|xml|html + + + json|xml|html + + diff --git a/src/Resources/config/routing/api/snapshot.xml b/src/Resources/config/routing/api/snapshot.xml new file mode 100644 index 000000000..ba3044faf --- /dev/null +++ b/src/Resources/config/routing/api/snapshot.xml @@ -0,0 +1,12 @@ + + + + json|xml|html + + + json|xml|html + + + json|xml|html + + diff --git a/tests/App/config/config.yaml b/tests/App/config/config.yaml index bc57f5e76..eca8abfdc 100644 --- a/tests/App/config/config.yaml +++ b/tests/App/config/config.yaml @@ -5,7 +5,7 @@ imports: framework: test: true - secret: secret + secret: '50n474.U53r' session: handler_id: session.handler.native_file storage_id: session.storage.mock_file @@ -20,4 +20,5 @@ framework: engines: [twig] twig: - form_themes: + exception_controller: null + strict_variables: '%kernel.debug%'