diff --git a/django_filters/rest_framework/backends.py b/django_filters/rest_framework/backends.py index 835a67f9a..2cc0f7012 100644 --- a/django_filters/rest_framework/backends.py +++ b/django_filters/rest_framework/backends.py @@ -154,7 +154,7 @@ def get_schema_operation_parameters(self, view): return [] parameters = [] - for field_name, field in filterset_class.base_filters.items(): + for field_name, field in filterset_class().filters.items(): parameter = { 'name': field_name, 'required': field.extra['required'], diff --git a/tests/rest_framework/models.py b/tests/rest_framework/models.py index a6f5e8a1c..f9be5e8f6 100644 --- a/tests/rest_framework/models.py +++ b/tests/rest_framework/models.py @@ -29,4 +29,4 @@ class Meta: class CategoryItem(BaseFilterableItem): - category = models.CharField(max_length=10, choices=(("home", "Home"), ("office", "Office"))) + category = models.CharField('item category', max_length=10, choices=(("home", "Home"), ("office", "Office"))) diff --git a/tests/rest_framework/test_backends.py b/tests/rest_framework/test_backends.py index 124383363..88d4d17b8 100644 --- a/tests/rest_framework/test_backends.py +++ b/tests/rest_framework/test_backends.py @@ -260,7 +260,7 @@ def test_get_operation_parameters_with_filterset_fields_list_with_choices(self): 'name': 'category', 'required': False, 'in': 'query', - 'description': 'category', + 'description': 'Item category', 'schema': { 'type': 'string', 'enum': ['home', 'office']