]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/ApiBundle/Controller/WallabagRestController.php
Merge remote-tracking branch 'origin/master' into 2.2
[github/wallabag/wallabag.git] / src / Wallabag / ApiBundle / Controller / WallabagRestController.php
index e927a8903a26af16f796fa8016e6dad7322d5b5a..544c1ea936718413658758b5d2507d71c3566a18 100644 (file)
@@ -8,6 +8,20 @@ use Wallabag\CoreBundle\Entity\Entry;
 
 class WallabagRestController extends FOSRestController
 {
+    /**
+     * Retrieve version number.
+     *
+     * @ApiDoc()
+     *
+     * @return JsonResponse
+     */
+    public function getVersionAction()
+    {
+        $version = $this->container->getParameter('wallabag_core.version');
+        $json = $this->get('serializer')->serialize($version, 'json');
+        return (new JsonResponse())->setJson($json);
+    }
+
     protected function validateAuthentication()
     {
         if (false === $this->get('security.authorization_checker')->isGranted('IS_AUTHENTICATED_FULLY')) {