You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/topics/documenting-your-api.md
+19Lines changed: 19 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -75,6 +75,23 @@ When using viewsets, you should use the relevant action names as delimiters.
75
75
76
76
There are a number of mature third-party packages for providing API documentation.
77
77
78
+
#### DRF OpenAPI
79
+
80
+
[DRF OpenAPI][drf-openapi] bridges the gap between OpenAPI specification and tool chain with the schema exposed
81
+
out-of-the-box by Django Rest Framework. Its goals are:
82
+
83
+
* To be dropped into any existing DRF project without any code change necessary.
84
+
* Provide clear disctinction between request schema and response schema.
85
+
* Provide a versioning mechanism for each schema. Support defining schema by version range syntax, e.g. >1.0, <=2.0
86
+
* Support multiple response codes, not just 200
87
+
* All this information should be bound to view methods, not view classes.
88
+
89
+
It also tries to stay current with the maturing schema generation mechanism provided by DRF.
90
+
91
+
![Screenshot - DRF OpenAPI][image-drf-openapi]
92
+
93
+
---
94
+
78
95
#### DRF Docs
79
96
80
97
[DRF Docs][drfdocs-repo] allows you to document Web APIs made with Django REST Framework and it is authored by Emmanouil Konstantinidis. It's made to work out of the box and its setup should not take more than a couple of minutes. Complete documentation can be found on the [website][drfdocs-website] while there is also a [demo][drfdocs-demo] available for people to see what it looks like. **Live API Endpoints** allow you to utilize the endpoints from within the documentation in a neat way.
@@ -197,6 +214,8 @@ In this approach, rather than documenting the available API endpoints up front,
197
214
To implement a hypermedia API you'll need to decide on an appropriate media type for the API, and implement a custom renderer and parser for that media type. The [REST, Hypermedia & HATEOAS][hypermedia-docs] section of the documentation includes pointers to background reading, as well as links to various hypermedia formats.
0 commit comments