Implementation of Swagger UI for Django Rest Framework
Project description
.. role:: python(code) :language: python
Rest-Swagger
An API documentation generator for Swagger UI and Django REST Framework
Installation
-
pip install rest-swagger
-
Add
rest_swagger
to yourINSTALLED_APPS
setting:INSTALLED_APPS = ( ... 'rest_swagger', )
Rendering Swagger Specification and Documentation
This package ships with two renderer classes:
OpenAPIRenderer
generates the OpenAPI (fka Swagger) JSON schema specification. This renderer will be presented if:
Content-Type: application/openapi+json
is specified in the headers.?format=openapi
is passed as query param
SwaggerUIRenderer
generates the Swagger UI and requires theOpenAPIRenderer
Quick Start Example:
from django.conf.urls import url
from rest_swagger.views import get_swagger_view
schema_view = get_swagger_view(title='Pastebin API')
urlpatterns = [
url(r'^$', schema_view)
]
Requirements
- Django >=2.2
- Django REST framework >=3.5
- Python >=3.7
Bugs & Contributions
Please report bugs by opening an issue
Contributions are welcome and are encouraged!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
rest-swagger-1.0.0.tar.gz
(498.3 kB
view hashes)
Built Distribution
Close
Hashes for rest_swagger-1.0.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 358b0219ed400eb59a8e34efe2c621537c163ad0f61857d5197b2ca15a7a2a49 |
|
MD5 | ec81be09d55b3f9f6236bd78ceeea939 |
|
BLAKE2b-256 | 294aeb2bda90fca702a0410f1c103604c855497fe404af0dd922e844d18b80a6 |