{"id":5936,"library":"flask-swagger-ui","title":"Flask-Swagger-UI","description":"Flask-Swagger-UI is a Python library that provides a simple Flask blueprint to integrate Swagger UI into your Flask applications. It currently bundles Swagger UI version 5.32.1. While the project is not actively maintained, it receives occasional updates to keep the bundled Swagger UI version current. Users requiring more active development or specific new features might consider forking the repository.","status":"maintenance","version":"5.32.2","language":"en","source_language":"en","source_url":"https://github.com/sveint/flask-swagger-ui","tags":["Flask","Swagger","API","Documentation","UI"],"install":[{"cmd":"pip install flask-swagger-ui","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"Required for Flask blueprint integration.","package":"Flask","optional":false}],"imports":[{"symbol":"get_swaggerui_blueprint","correct":"from flask_swagger_ui import get_swaggerui_blueprint"}],"quickstart":{"code":"from flask import Flask\nfrom flask_swagger_ui import get_swaggerui_blueprint\n\napp = Flask(__name__)\n\nSWAGGER_URL = '/api/docs'  # URL for exposing Swagger UI (without trailing '/')\nAPI_URL = 'https://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={\n        'app_name': 'Test application'\n    }\n)\n\napp.register_blueprint(swaggerui_blueprint)\n\n@app.route('/')\ndef hello_world():\n    return 'Hello, World!'\n\nif __name__ == '__main__':\n    app.run(debug=True)","lang":"python","description":"This example sets up a basic Flask application and registers the Swagger UI blueprint, pointing to a remote OpenAPI specification. After running, navigate to `/api/docs` in your browser to see the Swagger UI."},"warnings":[{"fix":"Review the project's GitHub for recent activity. For custom features or critical bug fixes, consider forking the repository or integrating Swagger UI manually.","message":"The `flask-swagger-ui` project is not actively maintained, though it receives occasional updates primarily for bundling the latest Swagger UI. Users requiring more active feature development or prompt bug fixes may need to consider forking the repository.","severity":"gotcha","affected_versions":"All versions"},{"fix":"For local files, ensure `API_URL` correctly points to a Flask static route (e.g., `/static/swagger.json`) and that the file exists in the corresponding static folder.","message":"When using a local `swagger.json` or `openapi.json` file as the `API_URL`, ensure that Flask is configured to serve static files from the directory where your API definition resides. Common issues include 'Fetch error: Not Found' if the static path is incorrect or the file isn't accessible via the web server.","severity":"gotcha","affected_versions":"All versions"},{"fix":"For advanced Swagger UI features like plugins or custom functions, you may need to integrate Swagger UI directly into your Flask application without using this blueprint, or investigate alternative Flask extensions that offer more control.","message":"The `get_swaggerui_blueprint` factory function supports overriding Swagger UI configuration options that can be JSON serialized via the `config` dictionary parameter. However, it does *not* support Swagger UI plugins or function parameters for advanced customization.","severity":"gotcha","affected_versions":"All versions"},{"fix":"If you are using Flask-RESTX for API development, its integrated documentation might be a more seamless solution. Otherwise, ensure your API definition is separate and served correctly for `flask-swagger-ui`.","message":"`flask-swagger-ui` provides a standalone blueprint for Swagger UI. It is different from the built-in Swagger UI functionality offered by `Flask-RESTPlus` (now `Flask-RESTX`), which integrates Swagger documentation directly with API definitions.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-14T00:00:00.000Z","next_check":"2026-07-13T00:00:00.000Z","problems":[]}