diff --git a/apps/booking/views.py b/apps/booking/views.py index b3f85bff..211fa957 100644 --- a/apps/booking/views.py +++ b/apps/booking/views.py @@ -1,4 +1,5 @@ from django.shortcuts import get_object_or_404 +from drf_yasg.utils import swagger_auto_schema from rest_framework import generics, permissions, status, serializers from rest_framework.response import Response @@ -96,6 +97,13 @@ class CreatePendingBooking(generics.CreateAPIView): permission_classes = (permissions.AllowAny,) serializer_class = PendingBookingSerializer + @swagger_auto_schema(operation_description="Request body params\n\n" + "IN GUESTONLINE (type:G): {" + "'restaurant_id', 'booking_time', " + "'booking_date', 'booked_persons_number'}\n" + "IN LASTABLE (type:L): {'booking_time', " + "'booked_persons_number', 'offer_id' (Req), " + "'email', 'phone', 'first_name', 'last_name'}") def post(self, request, *args, **kwargs): data = request.data.copy() if data.get('type') == Booking.LASTABLE and data.get("offer_id") is None: