Skip to content
New issue

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

BugFix: Error generating schema for ChoiceField with callable choices #1523

Closed
wants to merge 3 commits into from

Conversation

dd
Copy link

@dd dd commented Aug 9, 2022

No description provided.

Copy link
Owner

@carltongibson carltongibson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HI @dd — Seems reasonable (and small). Could you add a regression test please? Thanks.

@codecov-commenter
Copy link

Codecov Report

Merging #1523 (9dcc179) into main (c816887) will decrease coverage by 0.07%.
The diff coverage is 80.00%.

@@            Coverage Diff             @@
##             main    #1523      +/-   ##
==========================================
- Coverage   99.44%   99.36%   -0.08%     
==========================================
  Files          15       15              
  Lines        1255     1259       +4     
==========================================
+ Hits         1248     1251       +3     
- Misses          7        8       +1     
Impacted Files Coverage Δ
django_filters/rest_framework/backends.py 98.82% <80.00%> (-1.18%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@carltongibson
Copy link
Owner

As per #1432 the in-built schema support is going to be deprecated in the next version.

Rather, I recommend you migrate to use drf-spectacular, which is much more fully featured, and under active development.

https://drf-spectacular.readthedocs.io/en/latest/readme.html

If for some reason you're not able to use drf-spectacular you can copy the django_filters.rest_framework.backends.DjangoFilterBackend into your own project to customise as needed. (But use drf-spectacular.)

Thanks.

@dd
Copy link
Author

dd commented Mar 28, 2023

Yes, but drf-spectacular uses the get_schema_operation_parameters method from the filtering backend.

@carltongibson
Copy link
Owner

Can you open a ticket over there? Ideally we don't want the logic spread over the two projects. I'm aiming for removal in 25.1, so plenty of time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants