Skip to content
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

Fix missing description for ManyRelatedField and tested for SlugField #895

Merged

Conversation

StopMotionCuber
Copy link
Contributor

This fixes #894

Here I went with a list description of "[$help_text]", which could be modified in case needed.

I have also adapted the tests based on that, they are passing with my changeset

@codecov
Copy link

codecov bot commented Dec 9, 2022

Codecov Report

Base: 98.68% // Head: 98.71% // Increases project coverage by +0.02% 🎉

Coverage data is based on head (393e157) compared to base (0307ff9).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #895      +/-   ##
==========================================
+ Coverage   98.68%   98.71%   +0.02%     
==========================================
  Files          68       68              
  Lines        7827     7921      +94     
==========================================
+ Hits         7724     7819      +95     
+ Misses        103      102       -1     
Impacted Files Coverage Δ
drf_spectacular/openapi.py 97.57% <100.00%> (+<0.01%) ⬆️
tests/test_fields.py 100.00% <100.00%> (ø)
tests/test_command.py 100.00% <0.00%> (ø)
tests/test_warnings.py 100.00% <0.00%> (ø)
tests/test_postprocessing.py 100.00% <0.00%> (ø)
drf_spectacular/views.py 94.48% <0.00%> (+0.11%) ⬆️
drf_spectacular/plumbing.py 97.26% <0.00%> (+0.13%) ⬆️
drf_spectacular/drainage.py 99.20% <0.00%> (+0.23%) ⬆️
drf_spectacular/management/commands/spectacular.py 96.49% <0.00%> (+0.57%) ⬆️

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

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@StopMotionCuber
Copy link
Contributor Author

StopMotionCuber commented Dec 9, 2022

Eh, appying this to my own API, it seems like the "[$help_text]" format is not pretty with Redoc. Possibly we should just take the description, as the type is already clear from the type field

@tfranzel
Copy link
Owner

tfranzel commented Dec 9, 2022

Possibly we should just take the description, as the type is already clear from the type field

I agree

I will still need to think a bit about the implications before merging this.

@StopMotionCuber
Copy link
Contributor Author

Then think 😄

As no tests were failing I'm assuming that this shouldn't break something.
My implementation is also making sure that the description is not overwritten in case it is already available. So, this would only lead to "more documentation", but not really to "changed documentation".

But take your time to evaluate whether there are really no unintended side-effect. After all it's you who needs to maintain the library

@tfranzel tfranzel merged commit 72a05cf into tfranzel:master Dec 13, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing description for SlugRelatedField and PrimaryKeyRelatedField with many=True
2 participants