mirror of
https://github.com/wallabag/wallabag.git
synced 2025-06-05 23:18:47 +00:00
Add version in API
This commit is contained in:
parent
1e5a4b36ab
commit
2b4770301c
2 changed files with 14 additions and 0 deletions
|
@ -53,6 +53,7 @@ security:
|
||||||
|
|
||||||
access_control:
|
access_control:
|
||||||
- { path: ^/api/doc, roles: IS_AUTHENTICATED_ANONYMOUSLY }
|
- { path: ^/api/doc, roles: IS_AUTHENTICATED_ANONYMOUSLY }
|
||||||
|
- { path: ^/api/version, roles: IS_AUTHENTICATED_ANONYMOUSLY }
|
||||||
- { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY }
|
- { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY }
|
||||||
- { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY }
|
- { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY }
|
||||||
- { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
|
- { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
|
||||||
|
|
|
@ -340,6 +340,19 @@ class WallabagRestController extends FOSRestController
|
||||||
|
|
||||||
return $this->renderJsonResponse($json);
|
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.
|
* Validate that the first id is equal to the second one.
|
||||||
|
|
Loading…
Reference in a new issue