As noted in the Django REST Framework docs [1], views that support
multiple methods can and should split their documentation using
'method:' style delimiters. Do just this.
[1] https://www.django-rest-framework.org/topics/documenting-your-api/#documenting-your-views
Signed-off-by: Stephen Finucane <stephen@that.guru>
class CheckListCreate(CheckMixin, ListCreateAPIView):
- """List or create checks."""
+ """
+ get:
+ List checks.
+
+ post:
+ Create a check.
+ """
lookup_url_kwarg = 'patch_id'
ordering = 'id'
class IndexView(APIView):
def get(self, request, *args, **kwargs):
+ """List API resources."""
return Response({
'projects': reverse('api-project-list', request=request),
'users': reverse('api-user-list', request=request),
class PatchDetail(RetrieveUpdateAPIView):
- """Show a patch."""
+ """
+ get:
+ Show a patch.
+
+ patch:
+ Update a patch.
+ put:
+ Update a patch.
+ """
permission_classes = (PatchworkPermission,)
serializer_class = PatchDetailSerializer
class ProjectDetail(ProjectMixin, RetrieveUpdateAPIView):
- """Show a project."""
+ """
+ get:
+ Show a project.
+
+ patch:
+ Update a project.
+
+ put:
+ Update a project.
+ """
pass
class UserDetail(UserMixin, RetrieveUpdateAPIView):
- """Show a user."""
+ """
+ get:
+ Show a user.
+
+ patch:
+ Update a user.
+
+ put:
+ Update a user.
+ """
pass