Skip to main content

Swagger UI blueprint for Flask

Project description

flask-swagger-ui

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

Included Swagger UI version: 5.32.2.

This project is automatically updated to latest Swagger UI version on a weekly basis, but is otherwise not actively maintained.

Installation

pip install flask-swagger-ui

Usage

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 = 'https://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"}
    # }
)

app.register_blueprint(swaggerui_blueprint)

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/blob/master/docs/usage/configuration.md#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 .

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-5.32.2.tar.gz (613.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flask_swagger_ui-5.32.2-py3-none-any.whl (618.3 kB view details)

Uploaded Python 3

File details

Details for the file flask_swagger_ui-5.32.2.tar.gz.

File metadata

  • Download URL: flask_swagger_ui-5.32.2.tar.gz
  • Upload date:
  • Size: 613.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for flask_swagger_ui-5.32.2.tar.gz
Algorithm Hash digest
SHA256 94eb860540b1df0358fd04febcd28235be95c2e2d2ca03c33bbab9cab14cf04d
MD5 391a63a981824e5828e6f748a26904bb
BLAKE2b-256 2c755dd4d21cf3f5be74e2e6de11743c512244008b38a046ece87263d9cc1dcc

See more details on using hashes here.

Provenance

The following attestation bundles were made for flask_swagger_ui-5.32.2.tar.gz:

Publisher: release.yml on sveint/flask-swagger-ui

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file flask_swagger_ui-5.32.2-py3-none-any.whl.

File metadata

File hashes

Hashes for flask_swagger_ui-5.32.2-py3-none-any.whl
Algorithm Hash digest
SHA256 32ec65abf7a554f3a5efb188226ca22e9d924aa6656ca3c5bc0c393d94dcf21c
MD5 a1834c4ad7dac660661fc93a70b13174
BLAKE2b-256 a22799672315ba67226024cb99a1cc2cf48067cb460bb326b8f46f8043c46ccf

See more details on using hashes here.

Provenance

The following attestation bundles were made for flask_swagger_ui-5.32.2-py3-none-any.whl:

Publisher: release.yml on sveint/flask-swagger-ui

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page