You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have reduced the issue to the simplest possible case.
I have included a failing test as a pull request. (If you are unable to do so we can still accept the issue.)
Steps to reproduce
DRF version 3.10.0.
Create simple view with DjangoFilterBackend from django_filters.rest_framework
from rest_framework import generics
from django_filters import rest_framework as filters
class SimpleView(generics.ListAPIView):
serializer_class = SomeSerializer
filter_backends = (filters.DjangoFilterBackend,)
Run server and try generate OpenAPI schema(by view)
Expected behavior
Should work
Actual behavior
This causes a corresponding error:
Internal Server Error: /openapi
Traceback (most recent call last):
File "/Users/alex/PycharmProjects/handiscover_api/venv/lib/python3.7/site-packages/django/core/handlers/exception.py", line 34, in inner
response = get_response(request)
File "/Users/alex/PycharmProjects/handiscover_api/venv/lib/python3.7/site-packages/django/core/handlers/base.py", line 115, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/Users/alex/PycharmProjects/handiscover_api/venv/lib/python3.7/site-packages/django/core/handlers/base.py", line 113, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/Users/alex/PycharmProjects/handiscover_api/venv/lib/python3.7/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
return view_func(*args, **kwargs)
File "/Users/alex/PycharmProjects/handiscover_api/venv/lib/python3.7/site-packages/django/views/generic/base.py", line 71, in view
return self.dispatch(request, *args, **kwargs)
File "/Users/alex/PycharmProjects/handiscover_api/venv/lib/python3.7/site-packages/rest_framework/views.py", line 497, in dispatch
response = self.handle_exception(exc)
File "/Users/alex/PycharmProjects/handiscover_api/venv/lib/python3.7/site-packages/rest_framework/schemas/views.py", line 48, in handle_exception
return super().handle_exception(exc)
File "/Users/alex/PycharmProjects/handiscover_api/venv/lib/python3.7/site-packages/rest_framework/views.py", line 457, in handle_exception
self.raise_uncaught_exception(exc)
File "/Users/alex/PycharmProjects/handiscover_api/venv/lib/python3.7/site-packages/rest_framework/views.py", line 468, in raise_uncaught_exception
raise exc
File "/Users/alex/PycharmProjects/handiscover_api/venv/lib/python3.7/site-packages/rest_framework/views.py", line 494, in dispatch
response = handler(request, *args, **kwargs)
File "/Users/alex/PycharmProjects/handiscover_api/venv/lib/python3.7/site-packages/rest_framework/schemas/views.py", line 37, in get
schema = self.schema_generator.get_schema(request, self.public)
File "/Users/alex/PycharmProjects/handiscover_api/venv/lib/python3.7/site-packages/rest_framework/schemas/openapi.py", line 62, in get_schema
paths = self.get_paths(None if public else request)
File "/Users/alex/PycharmProjects/handiscover_api/venv/lib/python3.7/site-packages/rest_framework/schemas/openapi.py", line 49, in get_paths
operation = view.schema.get_operation(path, method)
File "/Users/alex/PycharmProjects/handiscover_api/venv/lib/python3.7/site-packages/rest_framework/schemas/openapi.py", line 96, in get_operation
parameters += self._get_filter_parameters(path, method)
File "/Users/alex/PycharmProjects/handiscover_api/venv/lib/python3.7/site-packages/rest_framework/schemas/openapi.py", line 185, in _get_filter_parameters
parameters += filter_backend().get_schema_operation_parameters(self.view)
File "/Users/alex/PycharmProjects/handiscover_api/venv/lib/python3.7/site-packages/django_filters/utils.py", line 61, in __getattr__
return self.__getattribute__(name)
AttributeError: 'DjangoFilterBackend' object has no attribute 'get_schema_operation_parameters'
The text was updated successfully, but these errors were encountered:
Checklist
master
branch of Django REST framework.Steps to reproduce
Expected behavior
Should work
Actual behavior
This causes a corresponding error:
The text was updated successfully, but these errors were encountered: