mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-22 09:36:49 +03:00
Add drf-yasg to documentation and schema 3rd party packages (#5720)
Also fixed broken `swagger` link.
This commit is contained in:
parent
68519c092f
commit
522d453546
|
@ -806,6 +806,12 @@ A short description of the meaning and intended usage of the input field.
|
||||||
|
|
||||||
# Third party packages
|
# Third party packages
|
||||||
|
|
||||||
|
## drf-yasg - Yet Another Swagger Generator
|
||||||
|
|
||||||
|
[drf-yasg][drf-yasg] generates [OpenAPI][open-api] documents suitable for code generation - nested schemas,
|
||||||
|
named models, response bodies, enum/pattern/min/max validators, form parameters, etc.
|
||||||
|
|
||||||
|
|
||||||
## DRF OpenAPI
|
## DRF OpenAPI
|
||||||
|
|
||||||
[DRF OpenAPI][drf-openapi] renders the schema generated by Django Rest Framework
|
[DRF OpenAPI][drf-openapi] renders the schema generated by Django Rest Framework
|
||||||
|
@ -815,6 +821,7 @@ in [OpenAPI][open-api] format.
|
||||||
[cite]: https://blog.heroku.com/archives/2014/1/8/json_schema_for_heroku_platform_api
|
[cite]: https://blog.heroku.com/archives/2014/1/8/json_schema_for_heroku_platform_api
|
||||||
[coreapi]: http://www.coreapi.org/
|
[coreapi]: http://www.coreapi.org/
|
||||||
[corejson]: http://www.coreapi.org/specification/encoding/#core-json-encoding
|
[corejson]: http://www.coreapi.org/specification/encoding/#core-json-encoding
|
||||||
|
[drf-yasg]: https://github.com/axnsan12/drf-yasg/
|
||||||
[open-api]: https://openapis.org/
|
[open-api]: https://openapis.org/
|
||||||
[drf-openapi]: https://github.com/limdauto/drf_openapi
|
[drf-openapi]: https://github.com/limdauto/drf_openapi
|
||||||
[json-hyperschema]: http://json-schema.org/latest/json-schema-hypermedia.html
|
[json-hyperschema]: http://json-schema.org/latest/json-schema-hypermedia.html
|
||||||
|
|
BIN
docs/img/drf-yasg.png
Normal file
BIN
docs/img/drf-yasg.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 58 KiB |
|
@ -136,6 +136,21 @@ The `rest_framework.documentation` module provides three helper functions to hel
|
||||||
|
|
||||||
There are a number of mature third-party packages for providing API documentation.
|
There are a number of mature third-party packages for providing API documentation.
|
||||||
|
|
||||||
|
#### drf-yasg - Yet Another Swagger Generator
|
||||||
|
|
||||||
|
[drf-yasg][drf-yasg] is a [Swagger][swagger] generation tool implemented without using the schema generation provided
|
||||||
|
by Django Rest Framework.
|
||||||
|
|
||||||
|
It aims to implement as much of the [OpenAPI][open-api] specification as possible - nested schemas, named models,
|
||||||
|
response bodies, enum/pattern/min/max validators, form parameters, etc. - and to generate documents usable with code
|
||||||
|
generation tools like `swagger-codegen`.
|
||||||
|
|
||||||
|
This also translates into a very useful interactive documentation viewer in the form of `swagger-ui`:
|
||||||
|
|
||||||
|
|
||||||
|
![Screenshot - drf-yasg][image-drf-yasg]
|
||||||
|
|
||||||
|
|
||||||
#### DRF OpenAPI
|
#### DRF OpenAPI
|
||||||
|
|
||||||
[DRF OpenAPI][drf-openapi] bridges the gap between OpenAPI specification and tool chain with the schema exposed
|
[DRF OpenAPI][drf-openapi] bridges the gap between OpenAPI specification and tool chain with the schema exposed
|
||||||
|
@ -278,6 +293,8 @@ In this approach, rather than documenting the available API endpoints up front,
|
||||||
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.
|
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.
|
||||||
|
|
||||||
[cite]: http://roy.gbiv.com/untangled/2008/rest-apis-must-be-hypertext-driven
|
[cite]: http://roy.gbiv.com/untangled/2008/rest-apis-must-be-hypertext-driven
|
||||||
|
[drf-yasg]: https://github.com/axnsan12/drf-yasg/
|
||||||
|
[image-drf-yasg]: ../img/drf-yasg.png
|
||||||
[drf-openapi]: https://github.com/limdauto/drf_openapi/
|
[drf-openapi]: https://github.com/limdauto/drf_openapi/
|
||||||
[image-drf-openapi]: ../img/drf-openapi.png
|
[image-drf-openapi]: ../img/drf-openapi.png
|
||||||
[drfdocs-repo]: https://github.com/ekonstantinidis/django-rest-framework-docs
|
[drfdocs-repo]: https://github.com/ekonstantinidis/django-rest-framework-docs
|
||||||
|
@ -285,7 +302,8 @@ To implement a hypermedia API you'll need to decide on an appropriate media type
|
||||||
[drfdocs-demo]: http://demo.drfdocs.com/
|
[drfdocs-demo]: http://demo.drfdocs.com/
|
||||||
[drfautodocs-repo]: https://github.com/iMakedonsky/drf-autodocs
|
[drfautodocs-repo]: https://github.com/iMakedonsky/drf-autodocs
|
||||||
[django-rest-swagger]: https://github.com/marcgibbons/django-rest-swagger
|
[django-rest-swagger]: https://github.com/marcgibbons/django-rest-swagger
|
||||||
[swagger]: https://developers.helloreverb.com/swagger/
|
[swagger]: https://swagger.io/
|
||||||
|
[open-api]: https://openapis.org/
|
||||||
[rest-framework-docs]: https://github.com/marcgibbons/django-rest-framework-docs
|
[rest-framework-docs]: https://github.com/marcgibbons/django-rest-framework-docs
|
||||||
[apiary]: http://apiary.io/
|
[apiary]: http://apiary.io/
|
||||||
[markdown]: http://daringfireball.net/projects/markdown/
|
[markdown]: http://daringfireball.net/projects/markdown/
|
||||||
|
|
Loading…
Reference in New Issue
Block a user