We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
class ObjectsFilterSet(FilterSet): type = MultipleChoiceFilter( field_name='type', label='Type of object', choices=( ('A', 'A'), ('B', 'B'), ('C', 'C') ), )
- name: type required: false in: query description: Type of object schema: type: string enum: - A - B - C
- name: type required: false in: query description: Type of object schema: type: array items: type: string enum: - A - B - C
Fix https://github.com/carltongibson/django-filter/blob/master/django_filters/rest_framework/backends.py#L168:
if field.extra and 'choices' in field.extra: parameter['schema']['enum'] = [c[0] for c in field.extra['choices']] if isinstance(field, (MultipleChoiceFilter, ModelMultipleChoiceFilter)): parameter['schema'] = { 'type': 'array', 'items': parameter['schema'] }
The text was updated successfully, but these errors were encountered:
fixed in https://github.com/tfranzel/drf-spectacular/blob/0f3e8f134a3214271fabc2b81283123d7bdf6c48/drf_spectacular/contrib/django_filters.py#L130
Sorry, something went wrong.
Moving to #1432
No branches or pull requests
FilterSet
Current result
Expected result
Proposed solution
Fix https://github.com/carltongibson/django-filter/blob/master/django_filters/rest_framework/backends.py#L168:
The text was updated successfully, but these errors were encountered: