diff --git a/rest_framework/schemas.py b/rest_framework/schemas.py index cdf2d5f3e..ee99a1c45 100644 --- a/rest_framework/schemas.py +++ b/rest_framework/schemas.py @@ -251,11 +251,11 @@ class SchemaGenerator(object): if method not in ('PUT', 'PATCH', 'POST'): return [] - fields = [] - - if not (hasattr(view, 'get_serializer_class') and callable(getattr(view, 'get_serializer_class'))): + if not hasattr(view, 'get_serializer_class'): return [] + fields = [] + serializer_class = view.get_serializer_class() serializer = serializer_class()