aboutsummaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
authorGravatar Hasan-Ahmad <[email protected]>2018-10-20 10:44:16 +0100
committerGravatar Hasan-Ahmad <[email protected]>2018-10-20 10:44:16 +0100
commit01bbe1af142b9c94a11a567d04a5c908a7589ec5 (patch)
tree061a745626085b70a2446ebe7344fe31e34eb722 /api
parentAdded snake idioms api (diff)
Added Snake idioms documentation, fixed docs for snake facts
Diffstat (limited to 'api')
-rw-r--r--api/viewsets.py20
1 files changed, 19 insertions, 1 deletions
diff --git a/api/viewsets.py b/api/viewsets.py
index a9294109..0025d736 100644
--- a/api/viewsets.py
+++ b/api/viewsets.py
@@ -181,7 +181,7 @@ class SnakeFactViewSet(ListModelMixin, GenericViewSet):
View providing snake facts created by the Pydis community in the first code jam.
## Routes
- ### GET /bot/snake-fact/<fact>
+ ### GET /bot/snake-facts
Returns a snake fact in the database.
#### Response format
@@ -202,6 +202,24 @@ class SnakeFactViewSet(ListModelMixin, GenericViewSet):
class SnakeIdiomViewSet(ListModelMixin, GenericViewSet):
+ """
+ View providing snake idioms for the snake cog.
+
+ ## Routes
+ ### GET /bot/snake-idioms
+ Returns a snake idiom in the database.
+
+ #### Response format
+ >>> [
+ ... {'idiom': 'Sneky snek'},
+ ... {'idiom': 'Snooky Snake'}
+ ... ]
+ #### Status codes
+ - 200: returned on success
+ ## Authentication
+ Requires and API token
+ """
+
serializer_class = SnakeIdiomSerializer
queryset = SnakeIdiom.objects.all()