mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-28 00:49:49 +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
|
||||
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):
|
||||
"""
|
||||
get: A description of my GET operation.
|
||||
post: A description of my POST operation.
|
||||
"""
|
||||
permission_classes = [permissions.IsAuthenticatedOrReadOnly]
|
||||
```python
|
||||
class DocStringExampleListView(APIView):
|
||||
"""
|
||||
get: A description of my GET operation.
|
||||
post: A description of my POST operation.
|
||||
"""
|
||||
permission_classes = [permissions.IsAuthenticatedOrReadOnly]
|
||||
|
||||
def get(self, *args, **kwargs):
|
||||
pass
|
||||
def get(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.
|
||||
def post(self, request, *args, **kwargs):
|
||||
...
|
||||
```
|
||||
|
||||
## Validator / Default Context
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user