mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-28 17:09:59 +03:00
Minor docs tweaking
This commit is contained in:
parent
c8c792cc15
commit
352410fff2
|
@ -38,23 +38,23 @@ include:
|
||||||
* Porting of the old CoreAPI parsing of docstrings to form OpenAPI operation
|
* Porting of the old CoreAPI parsing of docstrings to form OpenAPI operation
|
||||||
descriptions.
|
descriptions.
|
||||||
|
|
||||||
Here with an example view class:
|
In this example view operation descriptions for the `get` and `post` methods will
|
||||||
|
be extracted from the class docstring:
|
||||||
|
|
||||||
class DocStringExampleListView(APIView):
|
```python
|
||||||
"""
|
class DocStringExampleListView(APIView):
|
||||||
get: A description of my GET operation.
|
"""
|
||||||
post: A description of my POST operation.
|
get: A description of my GET operation.
|
||||||
"""
|
post: A description of my POST operation.
|
||||||
|
"""
|
||||||
permission_classes = [permissions.IsAuthenticatedOrReadOnly]
|
permission_classes = [permissions.IsAuthenticatedOrReadOnly]
|
||||||
|
|
||||||
def get(self, *args, **kwargs):
|
def get(self, request, *args, **kwargs):
|
||||||
pass
|
...
|
||||||
|
|
||||||
def post(self, request, *args, **kwargs):
|
def post(self, request, *args, **kwargs):
|
||||||
pass
|
...
|
||||||
|
```
|
||||||
Operation descriptions for the `get` and `post` methods will be extracted
|
|
||||||
from the class docstring.
|
|
||||||
|
|
||||||
## Validator / Default Context
|
## Validator / Default Context
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user