-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
Set view function's docstring to descriptions of coreapi.Link on SchemaGenerator #4444
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
Comments
This is being covered in #4241. |
The issue with this is that with a view you'd end up with the same descriptions for each of Or with a viewset, you'd end up with the same descriptions for all the actions on the viewset. Not obvious what a good way to resolve this would be. You could use the |
@lwm Agree - although let's leave this specific issue open for now, for further discussion. |
@tomchristie You're right. Thank you for your consideration. |
It may use action handler docstring from actions map:
|
@Skorpyon what about generic views? |
Having your company sign up to a paid plan is the most impactful way to help collaborate. I'm working full time on the project right now. And yes this issue oughta come up prior to 3.5 but it's not clear yet what the resolution will be. |
@danield137 For documenting generic views I use this implementation for SchemaGenerator
|
@Zeliboba5 I am aware of this as a possible workaround, but what I mostly care about is arguments and return types and descriptions. |
Version 1.x of django-rest-swagger supported YAML docs like this:
But essentially, you could either add your docs in each method itself (like @Skorpyon mentioned) or you could bundle the docs in the viewset's docstring. |
Now resolved in the upcoming |
Thank you!! |
Checklist
master
branch of Django REST framework.Proposal
Hi, It's a proposal of SchemaGenerator.
Now, SchamaGenerator set only
url
,action
,encoding
andfields
at following source code:https://github.com/tomchristie/django-rest-framework/blob/master/rest_framework/schemas.py#L220-L242
I think it's very useful to set a docstring to a description of
coreapi.Link
like:The text was updated successfully, but these errors were encountered: