{"id":18495341,"url":"https://github.com/diptangsu/sanic-swagger-ui","last_synced_at":"2025-05-14T03:12:36.202Z","repository":{"id":57463869,"uuid":"299394681","full_name":"diptangsu/sanic-swagger-ui","owner":"diptangsu","description":"Inspired by flask-swagger-ui (https://github.com/sveint/flask-swagger-ui).","archived":false,"fork":false,"pushed_at":"2020-10-04T16:44:49.000Z","size":3204,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-20T03:23:51.583Z","etag":null,"topics":["documentation","documentation-generator","documentation-tool","sanic","sanic-framework","swagger","swagger-ui"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/diptangsu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-09-28T18:17:15.000Z","updated_at":"2020-12-07T10:13:54.000Z","dependencies_parsed_at":"2022-09-05T06:01:22.728Z","dependency_job_id":null,"html_url":"https://github.com/diptangsu/sanic-swagger-ui","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diptangsu%2Fsanic-swagger-ui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diptangsu%2Fsanic-swagger-ui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diptangsu%2Fsanic-swagger-ui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diptangsu%2Fsanic-swagger-ui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/diptangsu","download_url":"https://codeload.github.com/diptangsu/sanic-swagger-ui/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254059526,"owners_count":22007771,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["documentation","documentation-generator","documentation-tool","sanic","sanic-framework","swagger","swagger-ui"],"created_at":"2024-11-06T13:24:24.711Z","updated_at":"2025-05-14T03:12:31.191Z","avatar_url":"https://github.com/diptangsu.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sanic Swagger UI\n\nSimple Sanic blueprint for adding [Swagger UI](https://github.com/swagger-api/swagger-ui) to your sanic application.\n\nInspired by [flask-swagger-ui](https://github.com/sveint/flask-swagger-ui).\n\n## Installation\n\nYou can install it using `pip`.\n\n```shell\npip install sanic_swagger_ui\n```\n\n## Usage\n\n```python\nfrom sanic import Sanic\nfrom sanic import response\nfrom sanic_swagger_ui import get_swaggerui_blueprint\n\napp = Sanic(__name__)\nSTATIC_URL = '/static'\napp.static(STATIC_URL, './static')  # set static dir path\n\nSWAGGER_URL = '/swagger'\nDOCS_PATH = STATIC_URL + '/swagger/index.yaml'  # serves files from the static dir\n\nswaggerui_blueprint = get_swaggerui_blueprint(\n    DOCS_PATH,\n    SWAGGER_URL,\n    app_name='Swagger BP Test'\n)\napp.blueprint(swaggerui_blueprint)\n\n\n@app.route('/')\nasync def index(req):\n    return response.html((\n        'Hello World from Sanic'\n        '\u003cbr\u003e'\n        'Click \u003ca href=\"/swagger/docs\"\u003ehere\u003c/a\u003e to view swagger docs'),\n        status=200\n    )\n\n\nif __name__ == '__main__':\n    app.run(debug=True)\n```\n\nYou can find this example in [examples](/examples) directory in this repository.\n\nPlease add an issue if you want something added here or if you find a bug.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiptangsu%2Fsanic-swagger-ui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdiptangsu%2Fsanic-swagger-ui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiptangsu%2Fsanic-swagger-ui/lists"}