mirror of
https://github.com/wallabag/wallabag.git
synced 2024-11-26 19:11:07 +00:00
Merge pull request #6095 from wallabag/fix/deprecation-fos-rest
Remove deprecated options from FOSRest
This commit is contained in:
commit
827ba15255
14 changed files with 86 additions and 27 deletions
|
@ -112,14 +112,8 @@ fos_rest:
|
||||||
pdf: true
|
pdf: true
|
||||||
epub: true
|
epub: true
|
||||||
mobi: true
|
mobi: true
|
||||||
templating_formats:
|
|
||||||
html: false
|
|
||||||
force_redirects:
|
|
||||||
html: true
|
|
||||||
failed_validation: HTTP_BAD_REQUEST
|
failed_validation: HTTP_BAD_REQUEST
|
||||||
default_engine: twig
|
routing_loader: false
|
||||||
routing_loader:
|
|
||||||
default_format: json
|
|
||||||
format_listener:
|
format_listener:
|
||||||
enabled: true
|
enabled: true
|
||||||
rules:
|
rules:
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
wallabag_annotation:
|
wallabag_annotation:
|
||||||
type : rest
|
resource: "@WallabagAnnotationBundle/Controller/"
|
||||||
resource: "@WallabagAnnotationBundle/Resources/config/routing_annotations.yml"
|
type: annotation
|
||||||
|
prefix: /
|
||||||
|
|
||||||
wallabag_import:
|
wallabag_import:
|
||||||
resource: "@WallabagImportBundle/Controller/"
|
resource: "@WallabagImportBundle/Controller/"
|
||||||
|
@ -25,11 +26,6 @@ doc-api:
|
||||||
resource: "@NelmioApiDocBundle/Resources/config/routing/swaggerui.xml"
|
resource: "@NelmioApiDocBundle/Resources/config/routing/swaggerui.xml"
|
||||||
prefix: /api/doc
|
prefix: /api/doc
|
||||||
|
|
||||||
rest :
|
|
||||||
type : rest
|
|
||||||
resource : "routing_rest.yml"
|
|
||||||
prefix : /api
|
|
||||||
|
|
||||||
homepage:
|
homepage:
|
||||||
path: "/{page}"
|
path: "/{page}"
|
||||||
defaults:
|
defaults:
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
Rest_Wallabag:
|
|
||||||
type : rest
|
|
||||||
resource: "@WallabagApiBundle/Resources/config/routing_rest.yml"
|
|
|
@ -159,6 +159,9 @@ services:
|
||||||
calls:
|
calls:
|
||||||
- ["addSubscriber", ["@bd_guzzle_site_authenticator.authenticator_subscriber"]]
|
- ["addSubscriber", ["@bd_guzzle_site_authenticator.authenticator_subscriber"]]
|
||||||
|
|
||||||
|
RulerZ\RulerZ:
|
||||||
|
alias: rulerz
|
||||||
|
|
||||||
Wallabag\CoreBundle\Operator\PHP\Matches:
|
Wallabag\CoreBundle\Operator\PHP\Matches:
|
||||||
tags:
|
tags:
|
||||||
- { name: rulerz.operator, target: native, operator: matches }
|
- { name: rulerz.operator, target: native, operator: matches }
|
||||||
|
|
|
@ -8,6 +8,7 @@ use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
|
||||||
use Symfony\Component\Form\FormFactoryInterface;
|
use Symfony\Component\Form\FormFactoryInterface;
|
||||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
use Symfony\Component\Routing\Annotation\Route;
|
||||||
use Wallabag\AnnotationBundle\Entity\Annotation;
|
use Wallabag\AnnotationBundle\Entity\Annotation;
|
||||||
use Wallabag\AnnotationBundle\Form\EditAnnotationType;
|
use Wallabag\AnnotationBundle\Form\EditAnnotationType;
|
||||||
use Wallabag\AnnotationBundle\Form\NewAnnotationType;
|
use Wallabag\AnnotationBundle\Form\NewAnnotationType;
|
||||||
|
@ -20,6 +21,8 @@ class WallabagAnnotationController extends AbstractFOSRestController
|
||||||
*
|
*
|
||||||
* @see Wallabag\ApiBundle\Controller\WallabagRestController
|
* @see Wallabag\ApiBundle\Controller\WallabagRestController
|
||||||
*
|
*
|
||||||
|
* @Route("/annotations/{entry}.{_format}", methods={"GET"}, name="annotations_get_annotations", defaults={"_format": "json"})
|
||||||
|
*
|
||||||
* @return JsonResponse
|
* @return JsonResponse
|
||||||
*/
|
*/
|
||||||
public function getAnnotationsAction(Entry $entry)
|
public function getAnnotationsAction(Entry $entry)
|
||||||
|
@ -39,9 +42,11 @@ class WallabagAnnotationController extends AbstractFOSRestController
|
||||||
/**
|
/**
|
||||||
* Creates a new annotation.
|
* Creates a new annotation.
|
||||||
*
|
*
|
||||||
* @return JsonResponse
|
|
||||||
*
|
|
||||||
* @see Wallabag\ApiBundle\Controller\WallabagRestController
|
* @see Wallabag\ApiBundle\Controller\WallabagRestController
|
||||||
|
*
|
||||||
|
* @Route("/annotations/{entry}.{_format}", methods={"POST"}, name="annotations_post_annotation", defaults={"_format": "json"})
|
||||||
|
*
|
||||||
|
* @return JsonResponse
|
||||||
*/
|
*/
|
||||||
public function postAnnotationAction(Request $request, Entry $entry)
|
public function postAnnotationAction(Request $request, Entry $entry)
|
||||||
{
|
{
|
||||||
|
@ -74,6 +79,7 @@ class WallabagAnnotationController extends AbstractFOSRestController
|
||||||
*
|
*
|
||||||
* @see Wallabag\ApiBundle\Controller\WallabagRestController
|
* @see Wallabag\ApiBundle\Controller\WallabagRestController
|
||||||
*
|
*
|
||||||
|
* @Route("/annotations/{annotation}.{_format}", methods={"PUT"}, name="annotations_put_annotation", defaults={"_format": "json"})
|
||||||
* @ParamConverter("annotation", class="Wallabag\AnnotationBundle\Entity\Annotation")
|
* @ParamConverter("annotation", class="Wallabag\AnnotationBundle\Entity\Annotation")
|
||||||
*
|
*
|
||||||
* @return JsonResponse
|
* @return JsonResponse
|
||||||
|
@ -106,6 +112,7 @@ class WallabagAnnotationController extends AbstractFOSRestController
|
||||||
*
|
*
|
||||||
* @see Wallabag\ApiBundle\Controller\WallabagRestController
|
* @see Wallabag\ApiBundle\Controller\WallabagRestController
|
||||||
*
|
*
|
||||||
|
* @Route("/annotations/{annotation}.{_format}", methods={"DELETE"}, name="annotations_delete_annotation", defaults={"_format": "json"})
|
||||||
* @ParamConverter("annotation", class="Wallabag\AnnotationBundle\Entity\Annotation")
|
* @ParamConverter("annotation", class="Wallabag\AnnotationBundle\Entity\Annotation")
|
||||||
*
|
*
|
||||||
* @return JsonResponse
|
* @return JsonResponse
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
annotations:
|
|
||||||
type: rest
|
|
||||||
resource: 'Wallabag\AnnotationBundle\Controller\WallabagAnnotationController'
|
|
||||||
name_prefix: annotations_
|
|
|
@ -7,6 +7,7 @@ use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
|
||||||
use Swagger\Annotations as SWG;
|
use Swagger\Annotations as SWG;
|
||||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
use Symfony\Component\Routing\Annotation\Route;
|
||||||
use Wallabag\AnnotationBundle\Entity\Annotation;
|
use Wallabag\AnnotationBundle\Entity\Annotation;
|
||||||
use Wallabag\CoreBundle\Entity\Entry;
|
use Wallabag\CoreBundle\Entity\Entry;
|
||||||
|
|
||||||
|
@ -32,6 +33,8 @@ class AnnotationRestController extends WallabagRestController
|
||||||
* )
|
* )
|
||||||
* )
|
* )
|
||||||
*
|
*
|
||||||
|
* @Route("/api/annotations/{entry}.{_format}", methods={"GET"}, name="api_get_annotations", defaults={"_format": "json"})
|
||||||
|
*
|
||||||
* @return JsonResponse
|
* @return JsonResponse
|
||||||
*/
|
*/
|
||||||
public function getAnnotationsAction(Entry $entry)
|
public function getAnnotationsAction(Entry $entry)
|
||||||
|
@ -88,6 +91,8 @@ class AnnotationRestController extends WallabagRestController
|
||||||
* )
|
* )
|
||||||
* )
|
* )
|
||||||
*
|
*
|
||||||
|
* @Route("/api/annotations/{entry}.{_format}", methods={"POST"}, name="api_post_annotation", defaults={"_format": "json"})
|
||||||
|
*
|
||||||
* @return JsonResponse
|
* @return JsonResponse
|
||||||
*/
|
*/
|
||||||
public function postAnnotationAction(Request $request, Entry $entry)
|
public function postAnnotationAction(Request $request, Entry $entry)
|
||||||
|
@ -120,6 +125,7 @@ class AnnotationRestController extends WallabagRestController
|
||||||
* )
|
* )
|
||||||
* )
|
* )
|
||||||
*
|
*
|
||||||
|
* @Route("/api/annotations/{annotation}.{_format}", methods={"PUT"}, name="api_put_annotation", defaults={"_format": "json"})
|
||||||
* @ParamConverter("annotation", class="Wallabag\AnnotationBundle\Entity\Annotation")
|
* @ParamConverter("annotation", class="Wallabag\AnnotationBundle\Entity\Annotation")
|
||||||
*
|
*
|
||||||
* @return JsonResponse
|
* @return JsonResponse
|
||||||
|
@ -154,6 +160,7 @@ class AnnotationRestController extends WallabagRestController
|
||||||
* )
|
* )
|
||||||
* )
|
* )
|
||||||
*
|
*
|
||||||
|
* @Route("/api/annotations/{annotation}.{_format}", methods={"DELETE"}, name="api_delete_annotation", defaults={"_format": "json"})
|
||||||
* @ParamConverter("annotation", class="Wallabag\AnnotationBundle\Entity\Annotation")
|
* @ParamConverter("annotation", class="Wallabag\AnnotationBundle\Entity\Annotation")
|
||||||
*
|
*
|
||||||
* @return JsonResponse
|
* @return JsonResponse
|
||||||
|
|
|
@ -7,6 +7,7 @@ use JMS\Serializer\SerializerInterface;
|
||||||
use Nelmio\ApiDocBundle\Annotation\Operation;
|
use Nelmio\ApiDocBundle\Annotation\Operation;
|
||||||
use Swagger\Annotations as SWG;
|
use Swagger\Annotations as SWG;
|
||||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||||
|
use Symfony\Component\Routing\Annotation\Route;
|
||||||
|
|
||||||
class ConfigRestController extends WallabagRestController
|
class ConfigRestController extends WallabagRestController
|
||||||
{
|
{
|
||||||
|
@ -22,6 +23,8 @@ class ConfigRestController extends WallabagRestController
|
||||||
* )
|
* )
|
||||||
* )
|
* )
|
||||||
*
|
*
|
||||||
|
* @Route("/api/config.{_format}", methods={"GET"}, name="api_get_config", defaults={"_format": "json"})
|
||||||
|
*
|
||||||
* @return JsonResponse
|
* @return JsonResponse
|
||||||
*/
|
*/
|
||||||
public function getConfigAction()
|
public function getConfigAction()
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
namespace Wallabag\ApiBundle\Controller;
|
namespace Wallabag\ApiBundle\Controller;
|
||||||
|
|
||||||
use Hateoas\Configuration\Route;
|
use Hateoas\Configuration\Route as HateoasRoute;
|
||||||
use Hateoas\Representation\Factory\PagerfantaFactory;
|
use Hateoas\Representation\Factory\PagerfantaFactory;
|
||||||
use Nelmio\ApiDocBundle\Annotation\Operation;
|
use Nelmio\ApiDocBundle\Annotation\Operation;
|
||||||
use Pagerfanta\Pagerfanta;
|
use Pagerfanta\Pagerfanta;
|
||||||
|
@ -13,6 +13,7 @@ use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
|
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
|
||||||
use Symfony\Component\HttpKernel\Exception\HttpException;
|
use Symfony\Component\HttpKernel\Exception\HttpException;
|
||||||
|
use Symfony\Component\Routing\Annotation\Route;
|
||||||
use Wallabag\CoreBundle\Entity\Entry;
|
use Wallabag\CoreBundle\Entity\Entry;
|
||||||
use Wallabag\CoreBundle\Entity\Tag;
|
use Wallabag\CoreBundle\Entity\Tag;
|
||||||
use Wallabag\CoreBundle\Event\EntryDeletedEvent;
|
use Wallabag\CoreBundle\Event\EntryDeletedEvent;
|
||||||
|
@ -80,6 +81,8 @@ class EntryRestController extends WallabagRestController
|
||||||
* )
|
* )
|
||||||
* )
|
* )
|
||||||
*
|
*
|
||||||
|
* @Route("/api/entries/exists.{_format}", methods={"GET"}, name="api_get_entries_exists", defaults={"_format": "json"})
|
||||||
|
*
|
||||||
* @return JsonResponse
|
* @return JsonResponse
|
||||||
*/
|
*/
|
||||||
public function getEntriesExistsAction(Request $request)
|
public function getEntriesExistsAction(Request $request)
|
||||||
|
@ -272,6 +275,8 @@ class EntryRestController extends WallabagRestController
|
||||||
* )
|
* )
|
||||||
* )
|
* )
|
||||||
*
|
*
|
||||||
|
* @Route("/api/entries.{_format}", methods={"GET"}, name="api_get_entries", defaults={"_format": "json"})
|
||||||
|
*
|
||||||
* @return JsonResponse
|
* @return JsonResponse
|
||||||
*/
|
*/
|
||||||
public function getEntriesAction(Request $request)
|
public function getEntriesAction(Request $request)
|
||||||
|
@ -314,7 +319,7 @@ class EntryRestController extends WallabagRestController
|
||||||
$pagerfantaFactory = new PagerfantaFactory('page', 'perPage');
|
$pagerfantaFactory = new PagerfantaFactory('page', 'perPage');
|
||||||
$paginatedCollection = $pagerfantaFactory->createRepresentation(
|
$paginatedCollection = $pagerfantaFactory->createRepresentation(
|
||||||
$pager,
|
$pager,
|
||||||
new Route(
|
new HateoasRoute(
|
||||||
'api_get_entries',
|
'api_get_entries',
|
||||||
[
|
[
|
||||||
'archive' => $isArchived,
|
'archive' => $isArchived,
|
||||||
|
@ -355,6 +360,8 @@ class EntryRestController extends WallabagRestController
|
||||||
* )
|
* )
|
||||||
* )
|
* )
|
||||||
*
|
*
|
||||||
|
* @Route("/api/entries/{entry}.{_format}", methods={"GET"}, name="api_get_entry", defaults={"_format": "json"})
|
||||||
|
*
|
||||||
* @return JsonResponse
|
* @return JsonResponse
|
||||||
*/
|
*/
|
||||||
public function getEntryAction(Entry $entry)
|
public function getEntryAction(Entry $entry)
|
||||||
|
@ -393,6 +400,8 @@ class EntryRestController extends WallabagRestController
|
||||||
* )
|
* )
|
||||||
* )
|
* )
|
||||||
*
|
*
|
||||||
|
* @Route("/api/entries/{entry}/export.{_format}", methods={"GET"}, name="api_get_entry_export", defaults={"_format": "json"})
|
||||||
|
*
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function getEntryExportAction(Entry $entry, Request $request)
|
public function getEntryExportAction(Entry $entry, Request $request)
|
||||||
|
@ -426,6 +435,8 @@ class EntryRestController extends WallabagRestController
|
||||||
* )
|
* )
|
||||||
* )
|
* )
|
||||||
*
|
*
|
||||||
|
* @Route("/api/entries/list.{_format}", methods={"DELETE"}, name="api_delete_entries_list", defaults={"_format": "json"})
|
||||||
|
*
|
||||||
* @return JsonResponse
|
* @return JsonResponse
|
||||||
*/
|
*/
|
||||||
public function deleteEntriesListAction(Request $request)
|
public function deleteEntriesListAction(Request $request)
|
||||||
|
@ -483,6 +494,8 @@ class EntryRestController extends WallabagRestController
|
||||||
* )
|
* )
|
||||||
* )
|
* )
|
||||||
*
|
*
|
||||||
|
* @Route("/api/entries/lists.{_format}", methods={"POST"}, name="api_post_entries_list", defaults={"_format": "json"})
|
||||||
|
*
|
||||||
* @throws HttpException When limit is reached
|
* @throws HttpException When limit is reached
|
||||||
*
|
*
|
||||||
* @return JsonResponse
|
* @return JsonResponse
|
||||||
|
@ -666,6 +679,8 @@ class EntryRestController extends WallabagRestController
|
||||||
* )
|
* )
|
||||||
* )
|
* )
|
||||||
*
|
*
|
||||||
|
* @Route("/api/entries.{_format}", methods={"POST"}, name="api_post_entries", defaults={"_format": "json"})
|
||||||
|
*
|
||||||
* @return JsonResponse
|
* @return JsonResponse
|
||||||
*/
|
*/
|
||||||
public function postEntriesAction(Request $request)
|
public function postEntriesAction(Request $request)
|
||||||
|
@ -869,6 +884,8 @@ class EntryRestController extends WallabagRestController
|
||||||
* )
|
* )
|
||||||
* )
|
* )
|
||||||
*
|
*
|
||||||
|
* @Route("/api/entries/{entry}.{_format}", methods={"PATCH"}, name="api_patch_entries", defaults={"_format": "json"})
|
||||||
|
*
|
||||||
* @return JsonResponse
|
* @return JsonResponse
|
||||||
*/
|
*/
|
||||||
public function patchEntriesAction(Entry $entry, Request $request)
|
public function patchEntriesAction(Entry $entry, Request $request)
|
||||||
|
@ -985,6 +1002,8 @@ class EntryRestController extends WallabagRestController
|
||||||
* )
|
* )
|
||||||
* )
|
* )
|
||||||
*
|
*
|
||||||
|
* @Route("/api/entries/{entry}/reload.{_format}", methods={"PATCH"}, name="api_patch_entries_reload", defaults={"_format": "json"})
|
||||||
|
*
|
||||||
* @return JsonResponse
|
* @return JsonResponse
|
||||||
*/
|
*/
|
||||||
public function patchEntriesReloadAction(Entry $entry)
|
public function patchEntriesReloadAction(Entry $entry)
|
||||||
|
@ -1041,6 +1060,8 @@ class EntryRestController extends WallabagRestController
|
||||||
* )
|
* )
|
||||||
* )
|
* )
|
||||||
*
|
*
|
||||||
|
* @Route("/api/entries/{entry}.{_format}", methods={"DELETE"}, name="api_delete_entries", defaults={"_format": "json"})
|
||||||
|
*
|
||||||
* @return JsonResponse
|
* @return JsonResponse
|
||||||
*/
|
*/
|
||||||
public function deleteEntriesAction(Entry $entry, Request $request)
|
public function deleteEntriesAction(Entry $entry, Request $request)
|
||||||
|
@ -1091,6 +1112,8 @@ class EntryRestController extends WallabagRestController
|
||||||
* )
|
* )
|
||||||
* )
|
* )
|
||||||
*
|
*
|
||||||
|
* @Route("/api/entries/{entry}/tags.{_format}", methods={"GET"}, name="api_get_entries_tags", defaults={"_format": "json"})
|
||||||
|
*
|
||||||
* @return JsonResponse
|
* @return JsonResponse
|
||||||
*/
|
*/
|
||||||
public function getEntriesTagsAction(Entry $entry)
|
public function getEntriesTagsAction(Entry $entry)
|
||||||
|
@ -1131,6 +1154,8 @@ class EntryRestController extends WallabagRestController
|
||||||
* )
|
* )
|
||||||
* )
|
* )
|
||||||
*
|
*
|
||||||
|
* @Route("/api/entries/{entry}/tags.{_format}", methods={"POST"}, name="api_post_entries_tags", defaults={"_format": "json"})
|
||||||
|
*
|
||||||
* @return JsonResponse
|
* @return JsonResponse
|
||||||
*/
|
*/
|
||||||
public function postEntriesTagsAction(Request $request, Entry $entry)
|
public function postEntriesTagsAction(Request $request, Entry $entry)
|
||||||
|
@ -1178,6 +1203,8 @@ class EntryRestController extends WallabagRestController
|
||||||
* )
|
* )
|
||||||
* )
|
* )
|
||||||
*
|
*
|
||||||
|
* @Route("/api/entries/{entry}/tags/{tag}.{_format}", methods={"DELETE"}, name="api_delete_entries_tags", defaults={"_format": "json"})
|
||||||
|
*
|
||||||
* @return JsonResponse
|
* @return JsonResponse
|
||||||
*/
|
*/
|
||||||
public function deleteEntriesTagsAction(Entry $entry, Tag $tag)
|
public function deleteEntriesTagsAction(Entry $entry, Tag $tag)
|
||||||
|
@ -1212,6 +1239,8 @@ class EntryRestController extends WallabagRestController
|
||||||
* )
|
* )
|
||||||
* )
|
* )
|
||||||
*
|
*
|
||||||
|
* @Route("/api/entries/tags/list.{_format}", methods={"DELETE"}, name="api_delete_entries_tags_list", defaults={"_format": "json"})
|
||||||
|
*
|
||||||
* @return JsonResponse
|
* @return JsonResponse
|
||||||
*/
|
*/
|
||||||
public function deleteEntriesTagsListAction(Request $request)
|
public function deleteEntriesTagsListAction(Request $request)
|
||||||
|
@ -1280,6 +1309,8 @@ class EntryRestController extends WallabagRestController
|
||||||
* )
|
* )
|
||||||
* )
|
* )
|
||||||
*
|
*
|
||||||
|
* @Route("/api/entries/tags/lists.{_format}", methods={"POST"}, name="api_post_entries_tags_list", defaults={"_format": "json"})
|
||||||
|
*
|
||||||
* @return JsonResponse
|
* @return JsonResponse
|
||||||
*/
|
*/
|
||||||
public function postEntriesTagsListAction(Request $request)
|
public function postEntriesTagsListAction(Request $request)
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
namespace Wallabag\ApiBundle\Controller;
|
namespace Wallabag\ApiBundle\Controller;
|
||||||
|
|
||||||
use Hateoas\Configuration\Route;
|
use Hateoas\Configuration\Route as HateoasRoute;
|
||||||
use Hateoas\Representation\Factory\PagerfantaFactory;
|
use Hateoas\Representation\Factory\PagerfantaFactory;
|
||||||
use Nelmio\ApiDocBundle\Annotation\Operation;
|
use Nelmio\ApiDocBundle\Annotation\Operation;
|
||||||
use Pagerfanta\Doctrine\ORM\QueryAdapter as DoctrineORMAdapter;
|
use Pagerfanta\Doctrine\ORM\QueryAdapter as DoctrineORMAdapter;
|
||||||
|
@ -10,6 +10,7 @@ use Pagerfanta\Pagerfanta;
|
||||||
use Swagger\Annotations as SWG;
|
use Swagger\Annotations as SWG;
|
||||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
use Symfony\Component\Routing\Annotation\Route;
|
||||||
use Wallabag\CoreBundle\Repository\EntryRepository;
|
use Wallabag\CoreBundle\Repository\EntryRepository;
|
||||||
|
|
||||||
class SearchRestController extends WallabagRestController
|
class SearchRestController extends WallabagRestController
|
||||||
|
@ -53,6 +54,8 @@ class SearchRestController extends WallabagRestController
|
||||||
* )
|
* )
|
||||||
* )
|
* )
|
||||||
*
|
*
|
||||||
|
* @Route("/api/search.{_format}", methods={"GET"}, name="api_get_search", defaults={"_format": "json"})
|
||||||
|
*
|
||||||
* @return JsonResponse
|
* @return JsonResponse
|
||||||
*/
|
*/
|
||||||
public function getSearchAction(Request $request)
|
public function getSearchAction(Request $request)
|
||||||
|
@ -79,7 +82,7 @@ class SearchRestController extends WallabagRestController
|
||||||
$pagerfantaFactory = new PagerfantaFactory('page', 'perPage');
|
$pagerfantaFactory = new PagerfantaFactory('page', 'perPage');
|
||||||
$paginatedCollection = $pagerfantaFactory->createRepresentation(
|
$paginatedCollection = $pagerfantaFactory->createRepresentation(
|
||||||
$pager,
|
$pager,
|
||||||
new Route(
|
new HateoasRoute(
|
||||||
'api_get_search',
|
'api_get_search',
|
||||||
[
|
[
|
||||||
'term' => $term,
|
'term' => $term,
|
||||||
|
|
|
@ -7,6 +7,7 @@ use Nelmio\ApiDocBundle\Annotation\Operation;
|
||||||
use Swagger\Annotations as SWG;
|
use Swagger\Annotations as SWG;
|
||||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
use Symfony\Component\Routing\Annotation\Route;
|
||||||
use Wallabag\CoreBundle\Entity\Entry;
|
use Wallabag\CoreBundle\Entity\Entry;
|
||||||
use Wallabag\CoreBundle\Entity\Tag;
|
use Wallabag\CoreBundle\Entity\Tag;
|
||||||
|
|
||||||
|
@ -24,6 +25,8 @@ class TagRestController extends WallabagRestController
|
||||||
* )
|
* )
|
||||||
* )
|
* )
|
||||||
*
|
*
|
||||||
|
* @Route("/api/tags.{_format}", methods={"GET"}, name="api_get_tags", defaults={"_format": "json"})
|
||||||
|
*
|
||||||
* @return JsonResponse
|
* @return JsonResponse
|
||||||
*/
|
*/
|
||||||
public function getTagsAction()
|
public function getTagsAction()
|
||||||
|
@ -59,6 +62,8 @@ class TagRestController extends WallabagRestController
|
||||||
* )
|
* )
|
||||||
* )
|
* )
|
||||||
*
|
*
|
||||||
|
* @Route("/api/tag/label.{_format}", methods={"DELETE"}, name="api_delete_tag_label", defaults={"_format": "json"})
|
||||||
|
*
|
||||||
* @return JsonResponse
|
* @return JsonResponse
|
||||||
*/
|
*/
|
||||||
public function deleteTagLabelAction(Request $request)
|
public function deleteTagLabelAction(Request $request)
|
||||||
|
@ -107,6 +112,8 @@ class TagRestController extends WallabagRestController
|
||||||
* )
|
* )
|
||||||
* )
|
* )
|
||||||
*
|
*
|
||||||
|
* @Route("/api/tags/label.{_format}", methods={"DELETE"}, name="api_delete_tags_label", defaults={"_format": "json"})
|
||||||
|
*
|
||||||
* @return JsonResponse
|
* @return JsonResponse
|
||||||
*/
|
*/
|
||||||
public function deleteTagsLabelAction(Request $request)
|
public function deleteTagsLabelAction(Request $request)
|
||||||
|
@ -152,6 +159,8 @@ class TagRestController extends WallabagRestController
|
||||||
* )
|
* )
|
||||||
* )
|
* )
|
||||||
*
|
*
|
||||||
|
* @Route("/api/tags/{tag}.{_format}", methods={"DELETE"}, name="api_delete_tag", defaults={"_format": "json"})
|
||||||
|
*
|
||||||
* @return JsonResponse
|
* @return JsonResponse
|
||||||
*/
|
*/
|
||||||
public function deleteTagAction(Tag $tag)
|
public function deleteTagAction(Tag $tag)
|
||||||
|
|
|
@ -7,6 +7,7 @@ use JMS\Serializer\SerializerBuilder;
|
||||||
use Nelmio\ApiDocBundle\Annotation\Operation;
|
use Nelmio\ApiDocBundle\Annotation\Operation;
|
||||||
use Swagger\Annotations as SWG;
|
use Swagger\Annotations as SWG;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
|
use Symfony\Component\Routing\Annotation\Route;
|
||||||
|
|
||||||
class TaggingRuleRestController extends WallabagRestController
|
class TaggingRuleRestController extends WallabagRestController
|
||||||
{
|
{
|
||||||
|
@ -22,6 +23,8 @@ class TaggingRuleRestController extends WallabagRestController
|
||||||
* )
|
* )
|
||||||
* )
|
* )
|
||||||
*
|
*
|
||||||
|
* @Route("/api/taggingrule/export.{_format}", methods={"GET"}, name="api_get_taggingrule_export", defaults={"_format": "json"})
|
||||||
|
*
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function getTaggingruleExportAction()
|
public function getTaggingruleExportAction()
|
||||||
|
|
|
@ -13,6 +13,7 @@ use Swagger\Annotations as SWG;
|
||||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
use Symfony\Component\Routing\Annotation\Route;
|
||||||
use Symfony\Component\Translation\TranslatorInterface;
|
use Symfony\Component\Translation\TranslatorInterface;
|
||||||
use Wallabag\ApiBundle\Entity\Client;
|
use Wallabag\ApiBundle\Entity\Client;
|
||||||
use Wallabag\UserBundle\Entity\User;
|
use Wallabag\UserBundle\Entity\User;
|
||||||
|
@ -32,6 +33,8 @@ class UserRestController extends WallabagRestController
|
||||||
* )
|
* )
|
||||||
* )
|
* )
|
||||||
*
|
*
|
||||||
|
* @Route("/api/user.{_format}", methods={"GET"}, name="api_get_user", defaults={"_format": "json"})
|
||||||
|
*
|
||||||
* @return JsonResponse
|
* @return JsonResponse
|
||||||
*/
|
*/
|
||||||
public function getUserAction()
|
public function getUserAction()
|
||||||
|
@ -83,6 +86,8 @@ class UserRestController extends WallabagRestController
|
||||||
*
|
*
|
||||||
* @todo Make this method (or the whole API) accessible only through https
|
* @todo Make this method (or the whole API) accessible only through https
|
||||||
*
|
*
|
||||||
|
* @Route("/api/user.{_format}", methods={"PUT"}, name="api_put_user", defaults={"_format": "json"})
|
||||||
|
*
|
||||||
* @return JsonResponse
|
* @return JsonResponse
|
||||||
*/
|
*/
|
||||||
public function putUserAction(Request $request)
|
public function putUserAction(Request $request)
|
||||||
|
|
|
@ -8,6 +8,7 @@ use JMS\Serializer\SerializerInterface;
|
||||||
use Nelmio\ApiDocBundle\Annotation\Operation;
|
use Nelmio\ApiDocBundle\Annotation\Operation;
|
||||||
use Swagger\Annotations as SWG;
|
use Swagger\Annotations as SWG;
|
||||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||||
|
use Symfony\Component\Routing\Annotation\Route;
|
||||||
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
||||||
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
|
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
|
||||||
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
|
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
|
||||||
|
@ -28,6 +29,8 @@ class WallabagRestController extends AbstractFOSRestController
|
||||||
*
|
*
|
||||||
* @deprecated Should use info endpoint instead
|
* @deprecated Should use info endpoint instead
|
||||||
*
|
*
|
||||||
|
* @Route("/api/version.{_format}", methods={"GET"}, name="api_get_version", defaults={"_format": "json"})
|
||||||
|
*
|
||||||
* @return JsonResponse
|
* @return JsonResponse
|
||||||
*/
|
*/
|
||||||
public function getVersionAction()
|
public function getVersionAction()
|
||||||
|
@ -50,6 +53,8 @@ class WallabagRestController extends AbstractFOSRestController
|
||||||
* )
|
* )
|
||||||
* )
|
* )
|
||||||
*
|
*
|
||||||
|
* @Route("/api/info.{_format}", methods={"GET"}, name="api_get_info", defaults={"_format": "json"})
|
||||||
|
*
|
||||||
* @return JsonResponse
|
* @return JsonResponse
|
||||||
*/
|
*/
|
||||||
public function getInfoAction()
|
public function getInfoAction()
|
||||||
|
|
Loading…
Reference in a new issue