From c8c792cc1531e9ea536fa90539de3a881b8a5da9 Mon Sep 17 00:00:00 2001 From: Carlton Gibson Date: Tue, 10 Dec 2019 15:53:35 +0100 Subject: [PATCH] Added notes on OpenAPI changes for 3.11. --- docs/community/3.11-announcement.md | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/docs/community/3.11-announcement.md b/docs/community/3.11-announcement.md index 1de4abc3b..6351d9047 100644 --- a/docs/community/3.11-announcement.md +++ b/docs/community/3.11-announcement.md @@ -28,7 +28,33 @@ This release will be the last to support Python 3.5 or Django 1.11. ## 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