Pre-release
This release is a pre-release and may not be stable for production use.
# flask-swagger-ui
Simple Flask blueprint for adding [Swagger UI](https://github.com/swagger-api/swagger-ui) to your flask application.
Included Swagger UI version: 3.0.12.
## Installation
`pip install flask-swagger-ui`
## Usage
Example application:
```python
from flask import Flask
from flask_swagger_ui import get_swaggerui_blueprint
app = Flask(__name__)
SWAGGER_URL = '/api/docs' # URL for exposing Swagger UI (without trailing '/')
API_URL = 'http://petstore.swagger.io/v2/swagger.json' # Our API url (can of course be a local resource)
# Call factory function to create our blueprint
swaggerui_blueprint = get_swaggerui_blueprint(
SWAGGER_URL, # Swagger UI static files will be mapped to '{SWAGGER_URL}/dist/'
API_URL,
config={ # Swagger UI config overrides
'app_name': "Test application"
},
# oauth_config={ # OAuth config. See https://github.com/swagger-api/swagger-ui#oauth2-configuration .
# 'clientId': "your-client-id",
# 'clientSecret': "your-client-secret-if-required",
# 'realm': "your-realms",
# 'appName': "your-app-name",
# 'scopeSeparator': " ",
# 'additionalQueryStringParams': {'test': "hello"}
# }
)
# Register blueprint at URL
# (URL must match the one given to factory function above)
app.register_blueprint(swaggerui_blueprint, url_prefix=SWAGGER_URL)
app.run()
# Now point your browser to localhost:5000/api/docs/
```
## Configuration
The blueprint supports overloading all Swagger UI configuration options that can be JSON serialized.
See https://github.com/swagger-api/swagger-ui#parameters for options.
Plugins and function parameters are not supported at this time.
OAuth2 parameters can be found at https://github.com/swagger-api/swagger-ui#oauth2-configuration .
Simple Flask blueprint for adding [Swagger UI](https://github.com/swagger-api/swagger-ui) to your flask application.
Included Swagger UI version: 3.0.12.
## Installation
`pip install flask-swagger-ui`
## Usage
Example application:
```python
from flask import Flask
from flask_swagger_ui import get_swaggerui_blueprint
app = Flask(__name__)
SWAGGER_URL = '/api/docs' # URL for exposing Swagger UI (without trailing '/')
API_URL = 'http://petstore.swagger.io/v2/swagger.json' # Our API url (can of course be a local resource)
# Call factory function to create our blueprint
swaggerui_blueprint = get_swaggerui_blueprint(
SWAGGER_URL, # Swagger UI static files will be mapped to '{SWAGGER_URL}/dist/'
API_URL,
config={ # Swagger UI config overrides
'app_name': "Test application"
},
# oauth_config={ # OAuth config. See https://github.com/swagger-api/swagger-ui#oauth2-configuration .
# 'clientId': "your-client-id",
# 'clientSecret': "your-client-secret-if-required",
# 'realm': "your-realms",
# 'appName': "your-app-name",
# 'scopeSeparator': " ",
# 'additionalQueryStringParams': {'test': "hello"}
# }
)
# Register blueprint at URL
# (URL must match the one given to factory function above)
app.register_blueprint(swaggerui_blueprint, url_prefix=SWAGGER_URL)
app.run()
# Now point your browser to localhost:5000/api/docs/
```
## Configuration
The blueprint supports overloading all Swagger UI configuration options that can be JSON serialized.
See https://github.com/swagger-api/swagger-ui#parameters for options.
Plugins and function parameters are not supported at this time.
OAuth2 parameters can be found at https://github.com/swagger-api/swagger-ui#oauth2-configuration .
Release files for flask-swagger-ui 3.0.12a0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| flask-swagger-ui-3.0.12a0.tar.gz | 454.4 kB | Details |
Release files / flask-swagger-ui-3.0.12a0.tar.gz
| Download URL | flask-swagger-ui-3.0.12a0.tar.gz |
|---|---|
| Size | 454.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
56faeaee8392c8d3c8f4853e800c10afcd4b138beb5bf833cb8b415f35e895c2
|
|
BLAKE2b-256 checksum How to use checksums |
14487926684ba48459edc8cb3fc01b129c3bc57959180b62f7a713bbcc2189d1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |