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

If available, use docstrings from properties for field descriptions #698

Conversation

spookylukey
Copy link
Contributor

Should be self-explanatory from the tests. This can be a big help in transferring knowledge from docstrings into the schema for frontend developers.

There was one issue with partial that the test suite found, I just added a special case top deal with that. Otherwise you get things like description: partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords which is unhelpful noise.

@codecov
Copy link

codecov bot commented Apr 4, 2022

Codecov Report

Merging #698 (c589962) into master (6f5bd16) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master     #698   +/-   ##
=======================================
  Coverage   98.80%   98.80%           
=======================================
  Files          64       64           
  Lines        7253     7261    +8     
=======================================
+ Hits         7166     7174    +8     
  Misses         87       87           
Impacted Files Coverage Δ
tests/test_fields.py 100.00% <ø> (ø)
drf_spectacular/openapi.py 97.29% <100.00%> (+0.02%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6f5bd16...c589962. Read the comment docs.

tfranzel added a commit that referenced this pull request Mar 4, 2023
tfranzel added a commit that referenced this pull request Mar 4, 2023
…954)

* Use dosctrings from properties for field descriptions if available

* add test, modify impl details of #698

---------

Co-authored-by: Luke Plant <[email protected]>
Co-authored-by: T. Franzel <[email protected]>
@tfranzel
Copy link
Owner

tfranzel commented Mar 4, 2023

resolved and superceded by #954

@tfranzel tfranzel closed this Mar 4, 2023
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.

2 participants