encode/django-rest-framework (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

Schemas Generator produces error for views with no pagination class. #4289

@f1shear

Description

@f1shear

Checklist

Steps to reproduce

Class TaskList(generics.ListCreateAPIView):
    queryset =  TaskModel.objects.all()
    serializer_class = TaskSerializer
    pagination_class = None


class ApiDocView(APIView):

    def get(self, request, format=None):
        generator = schemas.SchemaGenerator(title='API')
        return Response(generator.get_schema(request=request))

Expected behavior

Schema generator should consider views with pagination_class = None.
This issue is similar to #4265

Actual behavior

Schema generator gives error
File "/path/to/env/local/lib/python2.7/site-packages/rest_framework/schemas.py", line 284, in get_pagination_fields
paginator = view.pagination_class()
TypeError: 'NoneType' object is not callable