{"id":26703,"library":"aiohttp-swagger","title":"aiohttp-swagger","description":"Swagger API Documentation builder for aiohttp server. Version 1.0.16 (last release 2020). No recent updates; likely in maintenance mode.","status":"maintenance","version":"1.0.16","language":"python","source_language":"en","source_url":"https://github.com/cr0hn/aiohttp-swagger","tags":["swagger","aiohttp","api-documentation","openapi"],"install":[{"cmd":"pip install aiohttp-swagger","lang":"bash","label":"pip install"}],"dependencies":[{"reason":"Requires aiohttp server","package":"aiohttp","optional":false}],"imports":[{"note":"Wrong symbol, older examples used 'swagger' but current uses setup_swagger","wrong":"from aiohttp_swagger import swagger","symbol":"setup_swagger","correct":"from aiohttp_swagger import setup_swagger"},{"note":"Valid alternative import for the swagger decorator","wrong":"","symbol":"swagger","correct":"from aiohttp_swagger import swagger"},{"note":"Commonly imported for YAML file path","wrong":"","symbol":"swagger_path","correct":"from aiohttp_swagger import swagger_path"}],"quickstart":{"code":"from aiohttp import web\nfrom aiohttp_swagger import setup_swagger\n\nasync def handler(request):\n    return web.json_response({\"hello\": \"world\"})\n\napp = web.Application()\napp.router.add_get('/hello', handler)\nsetup_swagger(app, swagger_url=\"/api/v1/doc\")\nweb.run_app(app, host='0.0.0.0', port=8080)","lang":"python","description":"Basic aiohttp app with Swagger UI enabled"},"warnings":[{"fix":"Pin aiohttp<4 or use alternative like aiohttp-swagger3 or aiohttp-swagger-ui","message":"aiohttp-swagger may not work with aiohttp >= 4.x due to API changes.","severity":"breaking","affected_versions":"all"},{"fix":"Switch to aiohttp-swagger3 or aiohttp-swagger-ui","message":"Project has not been updated since 2020. Consider using more actively maintained alternatives.","severity":"deprecated","affected_versions":"all"},{"fix":"Ensure you pass the main app object, not a nested app.","message":"setup_swagger expects aiohttp.Application instance. Passing a sub-app may cause issues.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Upgrade to latest: pip install --upgrade aiohttp-swagger","cause":"Installed version < 1.0.0 or wrong import path","error":"ImportError: cannot import name 'setup_swagger' from 'aiohttp_swagger'"},{"fix":"Use 'url' instead: setup_swagger(app, url='/api/v1/doc')","cause":"Older version of library does not support swagger_url parameter","error":"TypeError: setup_swagger() got an unexpected keyword argument 'swagger_url'"},{"fix":"Use: from aiohttp_swagger import swagger as swagger_decorator","cause":"Misunderstanding the import; 'swagger' is a decorator, not a function","error":"AttributeError: module 'aiohttp_swagger' has no attribute 'swagger'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}