-
Notifications
You must be signed in to change notification settings - Fork 272
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
Component re-registration warning when two paginated list endpoints use the same serializer #233
Comments
hey @Lucidiot, yes that looks like a bug. the warning is unwarranted in most circumstances. i'll refine that spot to catch problems and not emit false positives. |
that should do it. please confirm and close the issue |
I'm not sure if you would consider this the same issue, but (using the 0.12.0 release), I see this:
even though the ListSerializer (implicitly, via
Or perhaps I am not using |
hey @ShaheedHaque, i think you are doing it right and i missed a case. the test case did only cover multiple viewsets and not actions. i can see how this happened. i'll investigate. the schema however should still be correct i believe. |
@ShaheedHaque i extended the test. should now behave as expected. schema was unaffected, only a false positive warning. |
Excellent.
And, as a newbie to (both drf and) drf-spectacular, I'd like to say thank
you for the excellent software.
…On Sun, 20 Dec 2020, 13:05 T. Franzel, ***@***.***> wrote:
@ShaheedHaque <https://github.com/ShaheedHaque> i extended the test.
should now behave as expected. schema was unaffected, only a false positive
warning.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#233 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABFHWKMA4C2PXA62FZ32MVLSVXZBNANCNFSM4U5ZRPYQ>
.
|
Just updated and I no longer see any warnings. Thank you very much! |
Describe the bug
When two or more paginated list endpoints use the same response serializers, a warning appears when generating the schema:
To Reproduce
Create two list endpoints with the same serializer, and set a default pagination class in the settings (or add one in
pagination_class
on each endpoint).Expected behavior
The same component gets reused without a warning.
Maybe this check could be modified to not warn when the two components are the same, not just by key? Or should this part check whether the exact same component already exists before registering?
The text was updated successfully, but these errors were encountered: