]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/ApiBundle/Controller/WallabagRestController.php
Merge pull request #1761 from wallabag/v2-API-version
[github/wallabag/wallabag.git] / src / Wallabag / ApiBundle / Controller / WallabagRestController.php
index 35a90edde12bee3bc8b923edda9fa7311a4ff963..29cab1f4df0f6b4f465a949bda377cfb3f1e5811 100644 (file)
@@ -340,6 +340,21 @@ class WallabagRestController extends FOSRestController
 
         return $this->renderJsonResponse($json);
     }
+    /**
+     * Retrieve version number.
+     *
+     * @ApiDoc()
+     *
+     * @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.