use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\JsonResponse;
+use Symfony\Component\HttpFoundation\Response;
use Wallabag\CoreBundle\Entity\Entry;
use Wallabag\CoreBundle\Entity\Tag;
use Wallabag\CoreBundle\Service\Extractor;
/**
* Retrieve salt for a giver user.
*
- * @ApiDoc(
- * parameters={
- * {"name"="username", "dataType"="string", "required"=true, "description"="username"}
- * }
- * )
+ * @ApiDoc()
* @return array
*/
- public function getSaltAction(Request $request)
+ public function getSaltAction($username)
{
$user = $this
->getDoctrine()
->getRepository('WallabagCoreBundle:User')
- ->findOneByUsername($request->query->get('username'));
+ ->findOneByUsername($username);
if (is_null($user)) {
throw $this->createNotFoundException();
$json = $this->get('serializer')->serialize($entry->getTags(), 'json');
- return new JsonResponse($json, 200);
+ return new Response($json, 200, array('application/json'));
}
/**