Add filtering parameters in drf_yasg Swagger in django-rest-framework Viewsets
I am using django-rest-framework Viewset and i have one list API in that i have to add filtering parameters start_date and end_date in request body in swagger.
class SchoolManagementView(ViewSet):
def __init__(self, *args, **kwargs):
super().__init__(**kwargs)
self.payload = {}
self.college_list_service = CollegeListService(view=self)
@swagger_auto_schema(
operation_description="Listing Inward Document",
responses={status.HTTP_200_OK: "Success"}
)
def list(self, request, *args, **kwargs):
self.payload = self.college_list_service.execute(request)
return ResponseHandler.success(payload=self.payload)
Note: Here i am using all my filter backends in "college_list_service" file