Skip to content

Commit 2deb6b4

Browse files
committed
Adding release notes
1 parent f99a87e commit 2deb6b4

File tree

2 files changed

+78
-10
lines changed

2 files changed

+78
-10
lines changed

docs/community/3.9-announcement.md

Lines changed: 77 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,71 @@ If you use REST framework commercially and would like to see this work continue,
2929
**[signing up for a paid plan][funding]**.
3030

3131

32-
TODO: UPDATE SPONSORS.
33-
34-
*We'd like to say thanks in particular our premium backers, [Rover](http://jobs.rover.com/), [Sentry](https://getsentry.com/welcome/), [Stream](https://getstream.io/?utm_source=drf&utm_medium=banner&utm_campaign=drf), [Machinalis](https://hello.machinalis.co.uk/), and [Rollbar](https://rollbar.com).*
32+
<ul class="premium-promo promo">
33+
<li><a href="http://jobs.rover.com/" style="background-image: url(https://fund-rest-framework.s3.amazonaws.com/rover_130x130.png)">Rover.com</a></li>
34+
<li><a href="https://getsentry.com/welcome/" style="background-image: url(https://fund-rest-framework.s3.amazonaws.com/sentry130.png)">Sentry</a></li>
35+
<li><a href="https://getstream.io/try-the-api/?utm_source=drf&utm_medium=banner&utm_campaign=drf" style="background-image: url(https://fund-rest-framework.s3.amazonaws.com/stream-130.png)">Stream</a></li>
36+
<li><a href="https://auklet.io" style="background-image: url(https://fund-rest-framework.s3.amazonaws.com/auklet-new.png)">Auklet</a></li>
37+
<li><a href="https://rollbar.com" style="background-image: url(https://fund-rest-framework.s3.amazonaws.com/rollbar2.png)">Rollbar</a></li>
38+
<li><a href="https://cadre.com" style="background-image: url(https://fund-rest-framework.s3.amazonaws.com/cadre.png)">Cadre</a></li>
39+
<li><a href="https://loadimpact.com/?utm_campaign=Sponsorship%20links&utm_source=drf&utm_medium=drf" style="background-image: url(https://fund-rest-framework.s3.amazonaws.com/load-impact.png)">Load Impact</a></li>
40+
<li><a href="https://hubs.ly/H0f30Lf0" style="background-image: url(https://fund-rest-framework.s3.amazonaws.com/kloudless.png)">Kloudless</a></li>
41+
</ul>
42+
<div style="clear: both; padding-bottom: 20px;"></div>
43+
44+
*Many thanks to all our [wonderful sponsors][sponsors], and in particular to our premium backers, [Rover](http://jobs.rover.com/), [Sentry](https://getsentry.com/welcome/), [Stream](https://getstream.io/?utm_source=drf&utm_medium=banner&utm_campaign=drf), [Auklet](https://auklet.io/), [Rollbar](https://rollbar.com), [Cadre](https://cadre.com), [Load Impact](https://loadimpact.com/?utm_campaign=Sponsorship%20links&utm_source=drf&utm_medium=drf), and [Kloudless](https://hubs.ly/H0f30Lf0).*
3545

3646
---
3747

48+
## In-built OpenAPI schema support
49+
50+
REST framework now has a first-pass at directly including OpenAPI schema support.
51+
52+
Specifically:
53+
54+
* There are now `OpenAPIRenderer`, and `JSONOpenAPIRenderer` classes that deal with encoding `coreapi.Document` instances into OpenAPI YAML or OpenAPI JSON.
55+
* The `get_schema_view(...)` method now defaults to OpenAPI YAML, with CoreJSON as a secondary
56+
option if it is selected via HTTP content negotiation.
57+
* There is a new management command `generateschema`, which you can use to dump
58+
the schema into your repository.
59+
60+
Here's an example of adding an OpenAPI schema to the URL conf:
61+
62+
```python
63+
from rest_framework.schemas import get_schema_view
64+
from rest_framework.renderers import JSONOpenAPIRenderer
65+
66+
schema_view = get_schema_view(
67+
title='Server Monitoring API',
68+
url='https://www.example.org/api/',
69+
renderer_classes=[JSONOpenAPIRenderer]
70+
)
71+
72+
urlpatterns = [
73+
url('^schema.json$', schema_view),
74+
...
75+
]
76+
```
77+
78+
And here's how you can use the `generateschema` management command:
79+
80+
```
81+
$ python manage.py generateschema --format openapi > schema.yml
82+
```
83+
84+
## Composable permission classes
85+
86+
You can now compose permission classes using the and/or operators, `&` and `|`.
87+
88+
For example...
89+
90+
```python
91+
permission_classes = [IsAuthenticated & (ReadOnly | IsAdmin)]
92+
```
93+
94+
If you're using custom permission classes then make sure that you are subclassing
95+
from `BasePermission` in order to enable this support.
96+
3897
## ViewSet _Extra Actions_ available in the Browsable API
3998

4099
Following the introduction of the `action` decorator in v3.8, _extra actions_ defined on a ViewSet are now available
@@ -44,10 +103,6 @@ from the Browsable API.
44103

45104
When defined, a dropdown of "Extra Actions", appropriately filtered to detail/non-detail actions, is displayed.
46105

47-
## In-built OpenAPI schema support
48-
49-
TODO
50-
51106
---
52107

53108
## Deprecations
@@ -92,17 +147,29 @@ For function based views the `@schema` decorator can be used to exclude the view
92147

93148
## Minor fixes and improvements
94149

95-
There are a large number of minor fixes and improvements in this release. See the [release notes](release-notes.md) page
96-
for a complete listing.
150+
There are a large number of minor fixes and improvements in this release. See the [release notes](release-notes.md) page for a complete listing.
97151

98152

99153
## What's next
100154

155+
We're planning to iteratively working towards OpenAPI becoming the standard schema
156+
representation. This will mean that the `coreapi` dependency will gradually become
157+
removed, and we'll instead generate the schema directly, rather than building
158+
a CoreAPI `Document` object.
159+
160+
OpenAPI has clearly become the standard for specifying Web APIs, so there's not
161+
much value any more in our schema-agnostic document model. Making this change
162+
will mean that we'll more easily be able to take advantage of the full set of
163+
OpenAPI functionality.
101164

102-
TODO...
165+
This will also make a wider range of tooling available.
103166

167+
We'll focus on continuing to develop the `apistar` library and client tool into
168+
a recommended option for generating API docs, validating API schemas, and
169+
providing a dynamic client library.
104170

105171
[funding]: funding.md
106172
[gh5886]: https://github.com/encode/django-rest-framework/issues/5886
107173
[gh5705]: https://github.com/encode/django-rest-framework/issues/5705
108174
[openapi]: https://www.openapis.org/
175+
[sponsors]: https://fund.django-rest-framework.org/topics/funding/#our-sponsors

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ pages:
6565
- 'Contributing to REST framework': 'community/contributing.md'
6666
- 'Project management': 'community/project-management.md'
6767
- 'Release Notes': 'community/release-notes.md'
68+
- '3.9 Announcement': 'community/3.9-announcement.md'
6869
- '3.8 Announcement': 'community/3.8-announcement.md'
6970
- '3.7 Announcement': 'community/3.7-announcement.md'
7071
- '3.6 Announcement': 'community/3.6-announcement.md'

0 commit comments

Comments
 (0)