mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-28 17:09:59 +03:00
Added notes on OpenAPI changes for 3.11.
This commit is contained in:
parent
1213699905
commit
c8c792cc15
|
@ -28,7 +28,33 @@ This release will be the last to support Python 3.5 or Django 1.11.
|
||||||
|
|
||||||
## OpenAPI Schema Generation Improvements
|
## OpenAPI Schema Generation Improvements
|
||||||
|
|
||||||
...
|
The OpenAPI schema generation continues to mature. Some highlights in 3.11
|
||||||
|
include:
|
||||||
|
|
||||||
|
* Automatic mapping of Django REST Framework renderers and parsers into OpenAPI
|
||||||
|
request and response media-types.
|
||||||
|
* Improved mapping JSON schema mapping types, for example in HStoreFields, and
|
||||||
|
with large integer values.
|
||||||
|
* Porting of the old CoreAPI parsing of docstrings to form OpenAPI operation
|
||||||
|
descriptions.
|
||||||
|
|
||||||
|
Here with an example view class:
|
||||||
|
|
||||||
|
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 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