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
+19-1Lines changed: 19 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -136,6 +136,21 @@ The `rest_framework.documentation` module provides three helper functions to hel
136
136
137
137
There are a number of mature third-party packages for providing API documentation.
138
138
139
+
#### drf-yasg - Yet Another Swagger Generator
140
+
141
+
[drf-yasg][drf-yasg] is a [Swagger][swagger] generation tool implemented without using the schema generation provided
142
+
by Django Rest Framework.
143
+
144
+
It aims to implement as much of the [OpenAPI][open-api] specification as possible - nested schemas, named models,
145
+
response bodies, enum/pattern/min/max validators, form parameters, etc. - and to generate documents usable with code
146
+
generation tools like `swagger-codegen`.
147
+
148
+
This also translates into a very useful interactive documentation viewer in the form of `swagger-ui`:
149
+
150
+
151
+
![Screenshot - drf-yasg][image-drf-yasg]
152
+
153
+
139
154
#### DRF OpenAPI
140
155
141
156
[DRF OpenAPI][drf-openapi] bridges the gap between OpenAPI specification and tool chain with the schema exposed
@@ -278,14 +293,17 @@ In this approach, rather than documenting the available API endpoints up front,
278
293
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