X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FApiBundle%2FController%2FUserRestController.php;h=a1378fc54e35e522259a71ee1d190d66cc6a175f;hb=f40c88eb1fa349aab600f9c1c94364f317fe62dd;hp=7471f5f62bea79c1d211fd9d1a926dfb2cb42701;hpb=679aaf08366c265b29d0e4b2e59919314cf338f9;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/ApiBundle/Controller/UserRestController.php b/src/Wallabag/ApiBundle/Controller/UserRestController.php index 7471f5f6..a1378fc5 100644 --- a/src/Wallabag/ApiBundle/Controller/UserRestController.php +++ b/src/Wallabag/ApiBundle/Controller/UserRestController.php @@ -6,10 +6,10 @@ use FOS\UserBundle\Event\UserEvent; use FOS\UserBundle\FOSUserEvents; use JMS\Serializer\SerializationContext; use Nelmio\ApiDocBundle\Annotation\ApiDoc; -use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\JsonResponse; -use Wallabag\UserBundle\Entity\User; +use Symfony\Component\HttpFoundation\Request; use Wallabag\ApiBundle\Entity\Client; +use Wallabag\UserBundle\Entity\User; class UserRestController extends WallabagRestController { @@ -46,7 +46,7 @@ class UserRestController extends WallabagRestController public function putUserAction(Request $request) { if (!$this->getParameter('fosuser_registration') || !$this->get('craue_config')->get('api_user_registration')) { - $json = $this->get('serializer')->serialize(['error' => "Server doesn't allow registrations"], 'json'); + $json = $this->get('jms_serializer')->serialize(['error' => "Server doesn't allow registrations"], 'json'); return (new JsonResponse()) ->setJson($json) @@ -92,7 +92,7 @@ class UserRestController extends WallabagRestController $errors['password'] = $this->translateErrors($data['plainPassword']['children']['first']['errors']); } - $json = $this->get('serializer')->serialize(['error' => $errors], 'json'); + $json = $this->get('jms_serializer')->serialize(['error' => $errors], 'json'); return (new JsonResponse()) ->setJson($json) @@ -127,7 +127,7 @@ class UserRestController extends WallabagRestController */ private function sendUser(User $user, $group = 'user_api', $status = JsonResponse::HTTP_OK) { - $json = $this->get('serializer')->serialize( + $json = $this->get('jms_serializer')->serialize( $user, 'json', SerializationContext::create()->setGroups([$group])