Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.

Commit

Permalink
Update Swagger definition in order to be compatible with string ident…
Browse files Browse the repository at this point in the history
…ifiers (#634)
  • Loading branch information
wbloszyk authored Sep 1, 2020
1 parent 058c6fd commit 3822ff4
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
10 changes: 5 additions & 5 deletions src/Controller/Api/CommentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function __construct(CommentManagerInterface $commentManager)
* @ApiDoc(
* resource=true,
* requirements={
* {"name"="id", "dataType"="integer", "requirement"="\d+", "description"="Comment identifier"}
* {"name"="id", "dataType"="string", "description"="Comment identifier"}
* },
* output={"class"="Sonata\NewsBundle\Model\Comment", "groups"={"sonata_api_read"}},
* statusCodes={
Expand All @@ -55,7 +55,7 @@ public function __construct(CommentManagerInterface $commentManager)
*
* @REST\View(serializerGroups={"sonata_api_read"}, serializerEnableMaxDepthChecks=true)
*
* @param int $id Comment identifier
* @param string $id Comment identifier
*
* @throws NotFoundHttpException
*
Expand All @@ -71,7 +71,7 @@ public function getCommentAction($id)
*
* @ApiDoc(
* requirements={
* {"name"="id", "dataType"="integer", "requirement"="\d+", "description"="Comment identifier"}
* {"name"="id", "dataType"="string", "description"="Comment identifier"}
* },
* statusCodes={
* 200="Returned when comment is successfully deleted",
Expand All @@ -80,7 +80,7 @@ public function getCommentAction($id)
* }
* )
*
* @param int $id Comment identifier
* @param string $id Comment identifier
*
* @throws NotFoundHttpException
*
Expand All @@ -102,7 +102,7 @@ public function deleteCommentAction($id)
/**
* Returns a comment entity instance.
*
* @param int $id Comment identifier
* @param string $id Comment identifier
*
* @throws NotFoundHttpException
*
Expand Down
34 changes: 17 additions & 17 deletions src/Controller/Api/PostController.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public function getPostsAction(ParamFetcherInterface $paramFetcher)
*
* @ApiDoc(
* requirements={
* {"name"="id", "dataType"="integer", "requirement"="\d+", "description"="Post identifier"}
* {"name"="id", "dataType"="string", "description"="Post identifier"}
* },
* output={"class"="sonata_news_api_form_post", "groups"={"sonata_api_read"}},
* statusCodes={
Expand All @@ -117,7 +117,7 @@ public function getPostsAction(ParamFetcherInterface $paramFetcher)
*
* @REST\View(serializerGroups={"sonata_api_read"}, serializerEnableMaxDepthChecks=true)
*
* @param int $id A post identifier
* @param string $id Post identifier
*
* @return Post
*/
Expand Down Expand Up @@ -154,7 +154,7 @@ public function postPostAction(Request $request)
*
* @ApiDoc(
* requirements={
* {"name"="id", "dataType"="integer", "requirement"="\d+", "description"="Post identifier"}
* {"name"="id", "dataType"="string", "description"="Post identifier"}
* },
* input={"class"="sonata_news_api_form_post", "name"="", "groups"={"sonata_api_write"}},
* output={"class"="sonata_news_api_form_post", "groups"={"sonata_api_read"}},
Expand All @@ -165,7 +165,7 @@ public function postPostAction(Request $request)
* }
* )
*
* @param int $id Post identifier
* @param string $id Post identifier
* @param Request $request Symfony request
*
* @throws NotFoundHttpException
Expand All @@ -182,7 +182,7 @@ public function putPostAction($id, Request $request)
*
* @ApiDoc(
* requirements={
* {"name"="id", "dataType"="integer", "requirement"="\d+", "description"="Post identifier"}
* {"name"="id", "dataType"="string", "description"="Post identifier"}
* },
* statusCodes={
* 200="Returned when post is successfully deleted",
Expand All @@ -191,7 +191,7 @@ public function putPostAction($id, Request $request)
* }
* )
*
* @param int $id Post identifier
* @param string $id Post identifier
*
* @throws NotFoundHttpException
*
Expand All @@ -215,7 +215,7 @@ public function deletePostAction($id)
*
* @ApiDoc(
* requirements={
* {"name"="id", "dataType"="integer", "requirement"="\d+", "description"="Post identifier"}
* {"name"="id", "dataType"="string", "description"="Post identifier"}
* },
* output={"class"="Sonata\DatagridBundle\Pager\PagerInterface", "groups"={"sonata_api_read"}},
* statusCodes={
Expand All @@ -229,7 +229,7 @@ public function deletePostAction($id)
*
* @REST\View(serializerGroups={"sonata_api_read"}, serializerEnableMaxDepthChecks=true)
*
* @param int $id Post identifier
* @param string $id Post identifier
*
* @return PagerInterface
*/
Expand All @@ -254,7 +254,7 @@ public function getPostCommentsAction($id, ParamFetcherInterface $paramFetcher)
*
* @ApiDoc(
* requirements={
* {"name"="id", "dataType"="integer", "requirement"="\d+", "description"="Post identifier"}
* {"name"="id", "dataType"="string", "description"="Post identifier"}
* },
* input={"class"="sonata_news_api_form_comment", "name"="", "groups"={"sonata_api_write"}},
* output={"class"="Sonata\NewsBundle\Model\Comment", "groups"={"sonata_api_read"}},
Expand All @@ -268,7 +268,7 @@ public function getPostCommentsAction($id, ParamFetcherInterface $paramFetcher)
*
* @REST\View(serializerGroups={"sonata_api_read"}, serializerEnableMaxDepthChecks=true)
*
* @param int $id Post identifier
* @param string $id Post identifier
*
* @throws HttpException
*
Expand Down Expand Up @@ -310,8 +310,8 @@ public function postPostCommentsAction($id, Request $request)
*
* @ApiDoc(
* requirements={
* {"name"="postId", "dataType"="integer", "requirement"="\d+", "description"="Post identifier"},
* {"name"="commentId", "dataType"="integer", "requirement"="\d+", "description"="Comment identifier"}
* {"name"="postId", "dataType"="string", "description"="Post identifier"},
* {"name"="commentId", "dataType"="string", "description"="Comment identifier"}
* },
* input={"class"="sonata_news_api_form_comment", "name"="", "groups"={"sonata_api_write"}},
* output={"class"="Sonata\NewsBundle\Model\Comment", "groups"={"sonata_api_read"}},
Expand All @@ -324,8 +324,8 @@ public function postPostCommentsAction($id, Request $request)
*
* @REST\View(serializerGroups={"sonata_api_read"}, serializerEnableMaxDepthChecks=true)
*
* @param int $postId Post identifier
* @param int $commentId Comment identifier
* @param string $postId Post identifier
* @param string $commentId Comment identifier
* @param Request $request Symfony request
*
* @throws NotFoundHttpException
Expand Down Expand Up @@ -399,7 +399,7 @@ protected function filterCriteria(ParamFetcherInterface $paramFetcher)
/**
* Retrieves post with id $id or throws an exception if it doesn't exist.
*
* @param int $id Post identifier
* @param string $id Post identifier
*
* @throws NotFoundHttpException
*
Expand All @@ -419,8 +419,8 @@ protected function getPost($id)
/**
* Write a post, this method is used by both POST and PUT action methods.
*
* @param Request $request Symfony request
* @param int|null $id Post identifier
* @param Request $request Symfony request
* @param string|null $id Post identifier
*
* @return View|FormInterface
*/
Expand Down

0 comments on commit 3822ff4

Please sign in to comment.