flask-swagger-ui


Nameflask-swagger-ui JSON
Version 4.11.1 PyPI version JSON
download
home_pagehttps://github.com/sveint/flask-swagger-ui
SummarySwagger UI blueprint for Flask
upload_time2022-05-24 07:29:26
maintainer
docs_urlNone
authorSvein Tore Koksrud Seljebotn
requires_python
licenseMIT
keywords flask swagger
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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: 4.11.1.

## 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"}
    # }
)

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#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 .

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/sveint/flask-swagger-ui",
    "name": "flask-swagger-ui",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "flask swagger",
    "author": "Svein Tore Koksrud Seljebotn",
    "author_email": "sveint@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/6c/80/c53f1d3758b07d4a0c86e03ce97097382e7e559ccb25d959bbaf3d17ddca/flask-swagger-ui-4.11.1.tar.gz",
    "platform": null,
    "description": "# flask-swagger-ui\n\nSimple Flask blueprint for adding [Swagger UI](https://github.com/swagger-api/swagger-ui) to your flask application.\n\nIncluded Swagger UI version: 4.11.1.\n\n## Installation\n\n`pip install flask-swagger-ui`\n\n## Usage\n\nExample application:\n\n```python\nfrom flask import Flask\nfrom flask_swagger_ui import get_swaggerui_blueprint\n\napp = Flask(__name__)\n\n\nSWAGGER_URL = '/api/docs'  # URL for exposing Swagger UI (without trailing '/')\nAPI_URL = 'http://petstore.swagger.io/v2/swagger.json'  # Our API url (can of course be a local resource)\n\n# Call factory function to create our blueprint\nswaggerui_blueprint = get_swaggerui_blueprint(\n    SWAGGER_URL,  # Swagger UI static files will be mapped to '{SWAGGER_URL}/dist/'\n    API_URL,\n    config={  # Swagger UI config overrides\n        'app_name': \"Test application\"\n    },\n    # oauth_config={  # OAuth config. See https://github.com/swagger-api/swagger-ui#oauth2-configuration .\n    #    'clientId': \"your-client-id\",\n    #    'clientSecret': \"your-client-secret-if-required\",\n    #    'realm': \"your-realms\",\n    #    'appName': \"your-app-name\",\n    #    'scopeSeparator': \" \",\n    #    'additionalQueryStringParams': {'test': \"hello\"}\n    # }\n)\n\napp.register_blueprint(swaggerui_blueprint)\n\napp.run()\n\n# Now point your browser to localhost:5000/api/docs/\n\n```\n\n## Configuration\n\nThe blueprint supports overloading all Swagger UI configuration options that can be JSON serialized.\nSee https://github.com/swagger-api/swagger-ui#parameters for options.\n\nPlugins and function parameters are not supported at this time.\n\nOAuth2 parameters can be found at https://github.com/swagger-api/swagger-ui#oauth2-configuration .\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Swagger UI blueprint for Flask",
    "version": "4.11.1",
    "project_urls": {
        "Homepage": "https://github.com/sveint/flask-swagger-ui"
    },
    "split_keywords": [
        "flask",
        "swagger"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a520df137e8efb744209135f70cb2b00c8917369ae4177370d1fab1789a0675c",
                "md5": "4326f2edd7e44f31911ee663576cf4b1",
                "sha256": "c951928fe4592d3561b543e0e1ca32703f55d3474de86c894a9d27f795d96c83"
            },
            "downloads": -1,
            "filename": "flask_swagger_ui-4.11.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4326f2edd7e44f31911ee663576cf4b1",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 1391773,
            "upload_time": "2022-05-24T07:29:23",
            "upload_time_iso_8601": "2022-05-24T07:29:23.305998Z",
            "url": "https://files.pythonhosted.org/packages/a5/20/df137e8efb744209135f70cb2b00c8917369ae4177370d1fab1789a0675c/flask_swagger_ui-4.11.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6c80c53f1d3758b07d4a0c86e03ce97097382e7e559ccb25d959bbaf3d17ddca",
                "md5": "24cdbf024de1d2c6877f16ca2abfe62b",
                "sha256": "a370199a780d678b32e38f1be10d4d81efa0ee63e9fe2fb766ff1a4b6c37dac8"
            },
            "downloads": -1,
            "filename": "flask-swagger-ui-4.11.1.tar.gz",
            "has_sig": false,
            "md5_digest": "24cdbf024de1d2c6877f16ca2abfe62b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 1376697,
            "upload_time": "2022-05-24T07:29:26",
            "upload_time_iso_8601": "2022-05-24T07:29:26.164669Z",
            "url": "https://files.pythonhosted.org/packages/6c/80/c53f1d3758b07d4a0c86e03ce97097382e7e559ccb25d959bbaf3d17ddca/flask-swagger-ui-4.11.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-05-24 07:29:26",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "sveint",
    "github_project": "flask-swagger-ui",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "flask-swagger-ui"
}
        
Elapsed time: 0.94926s