From ca19852a00e6e0af3f12d9dd36726b5319f361f2 Mon Sep 17 00:00:00 2001 From: Toxantron Date: Tue, 6 Jun 2017 19:08:19 +0200 Subject: [PATCH] Endpoint to get configured card sets - closes #58. --- doc/swagger.yaml | 16 ++++++++++++++++ src/controllers/session-controller.php | 7 +++++++ 2 files changed, 23 insertions(+) diff --git a/doc/swagger.yaml b/doc/swagger.yaml index 74625f7..7e97146 100644 --- a/doc/swagger.yaml +++ b/doc/swagger.yaml @@ -191,6 +191,22 @@ paths: description: Boolean if the password was correct schema: $ref: '#/definitions/BoolResponse' + /session/cardsets: + get: + tags: + - session + summary: Get all configured cardsets + produces: + - application/json + responses: + '200': + description: Arrays with the face values of each card + schema: + type: array + items: + type: array + items: + type: string '/session/cardset/{id}': get: tags: diff --git a/src/controllers/session-controller.php b/src/controllers/session-controller.php index ce092de..4d4e986 100644 --- a/src/controllers/session-controller.php +++ b/src/controllers/session-controller.php @@ -158,6 +158,13 @@ public function cardset($id) $session = $this->getSession($id); return $this->getCardSet($session); } + + // Get the card set of this session + // URL: /api/session/cardsets + public function cardsets() + { + return $this->cardSets; + } } return new SessionController($entityManager, $cardSets);