3 namespace Wallabag\ApiBundle\Controller
;
5 use JMS\Serializer\SerializationContext
;
6 use JMS\Serializer\SerializerBuilder
;
7 use Nelmio\ApiDocBundle\Annotation\ApiDoc
;
8 use Symfony\Component\HttpFoundation\Response
;
10 class TaggingRuleRestController
extends WallabagRestController
13 * Export all tagging rules as a json file.
19 public function getTaggingruleExportAction()
21 $this->validateAuthentication();
23 $data = SerializerBuilder
::create()->build()->serialize(
24 $this->getUser()->getConfig()->getTaggingRules(),
26 SerializationContext
::create()->setGroups(['export_tagging_rule'])
29 return Response
::create(
33 'Content-type' => 'application/json',
34 'Content-Disposition' => 'attachment; filename="tagging_rules_' . $this->getUser()->getUsername() . '.json"',
35 'Content-Transfer-Encoding' => 'UTF-8',