-
Notifications
You must be signed in to change notification settings - Fork 273
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
duplicate choices in FilterSet.ChoiceFilter #991
Comments
Aha. I think one of the choices is coming from default documentation. And the other one is actually rendering choices. This can be fixed be either adding explicit help_text on the filter field, adding explicit help_text on the model field, or adding explicit documentation on the view using something like:
|
Hi, these are not duplicated. Each choice usually has a value and a name/description. In your case this just looks superfluous. E.g. consider having integers as choices without a proper description, would make the schema not really useful. Other times, the choices are just abbreviations that make no sense without description. Therefore we add this where we think it is useful. You can turn off this added list with the setting: |
I don't understand your answer. I don't mean that the value |
ohh, I totally misunderstood your question. That of course looks like a bug and should not happen. |
Sorry for the long delay. That fixes the problem. This issue can be closed. Thanks very much. |
Describe the bug
I have a ViewSet w/ a Filterset which includes a ChoiceFilter. When the schema is rendered in the browser, it duplicates each choice. (See the attached image to understand what I mean).
To Reproduce
Expected behavior

There should only be one choice rendered in the schema documentation.
The text was updated successfully, but these errors were encountered: