Skip to content

Commit ab0c577

Browse files
nmgeektomchristie
authored andcommitted
Direct readers to info on how to add viewset docs (#4844)
I believe the original statement was wrong. You can, in fact, document the various API endpoints of a ViewSet.
1 parent 6b399f1 commit ab0c577

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

docs/topics/documenting-your-api.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ If the python `markdown` library is installed, then [markdown syntax][markdown]
105105
[ref]: http://example.com/activating-accounts
106106
"""
107107

108-
Note that one constraint of using viewsets is that any documentation be used for all generated views, so for example, you cannot have differing documentation for the generated list view and detail view.
108+
Note that when using viewsets the basic docstring is used for all generated views. To provide descriptions for each view, such as for the the list and retrieve views, use docstring sections as described in [Schemas as documentation: Examples][schemas-examples].
109109

110110
#### The `OPTIONS` method
111111

@@ -148,3 +148,4 @@ To implement a hypermedia API you'll need to decide on an appropriate media type
148148
[image-django-rest-swagger]: ../img/django-rest-swagger.png
149149
[image-apiary]: ../img/apiary.png
150150
[image-self-describing-api]: ../img/self-describing.png
151+
[schemas-examples]: api-guide/schemas/#examples

0 commit comments

Comments
 (0)