diff --git a/rest_framework/schemas/inspectors.py b/rest_framework/schemas/inspectors.py index a91205cde9..7f2c1cc71c 100644 --- a/rest_framework/schemas/inspectors.py +++ b/rest_framework/schemas/inspectors.py @@ -4,13 +4,14 @@ See schemas.__init__.py for package overview. """ import re +import warnings from collections import OrderedDict from django.db import models from django.utils.encoding import force_text, smart_text from django.utils.translation import ugettext_lazy as _ -from rest_framework import serializers +from rest_framework import exceptions, serializers from rest_framework.compat import coreapi, coreschema, uritemplate, urlparse from rest_framework.settings import api_settings from rest_framework.utils import formatting @@ -285,7 +286,14 @@ def get_serializer_fields(self, path, method): if not hasattr(view, 'get_serializer'): return [] - serializer = view.get_serializer() + try: + serializer = view.get_serializer() + except exceptions.APIException: + serializer = None + warnings.warn('{}.get_serializer() raised an exception during ' + 'schema generation. Serializer fields will not be ' + 'generated for {} {}.'.format( + type(view), method, path)) if isinstance(serializer, serializers.ListSerializer): return [ pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy