Skip to main content

Swagger UI blueprint for Flask

Project description


Simple Flask blueprint for adding Swagger UI to your flask application.

Included Swagger UI version: 4.11.1.


pip install flask-swagger-ui


Example application:

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 = ''  # 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/'
    config={  # Swagger UI config overrides
        'app_name': "Test application"
    # oauth_config={  # OAuth config. See .
    #    'clientId': "your-client-id",
    #    'clientSecret': "your-client-secret-if-required",
    #    'realm': "your-realms",
    #    'appName': "your-app-name",
    #    'scopeSeparator': " ",
    #    'additionalQueryStringParams': {'test': "hello"}
    # }


# Now point your browser to localhost:5000/api/docs/


The blueprint supports overloading all Swagger UI configuration options that can be JSON serialized. See for options.

Plugins and function parameters are not supported at this time.

OAuth2 parameters can be found at .

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flask-swagger-ui-4.11.1.tar.gz (1.4 MB view hashes)

Uploaded source

Built Distribution

flask_swagger_ui-4.11.1-py3-none-any.whl (1.4 MB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page