]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/ApiBundle/Controller/WallabagRestController.php
Add version in API
[github/wallabag/wallabag.git] / src / Wallabag / ApiBundle / Controller / WallabagRestController.php
index 35a90edde12bee3bc8b923edda9fa7311a4ff963..5f342825f08c3ca12c891df01ee0ae0f313e3e75 100644 (file)
@@ -340,6 +340,19 @@ class WallabagRestController extends FOSRestController
 
         return $this->renderJsonResponse($json);
     }
+    /**
+     * Retrive version.
+     *
+     * @return Response
+     */
+    public function getVersionAction()
+    {
+        $version = $this->container->getParameter('wallabag_core.version');
+
+        $json = $this->get('serializer')->serialize($version, 'json');
+
+        return $this->renderJsonResponse($json);
+    }
 
     /**
      * Validate that the first id is equal to the second one.