aiohttp-swagger
aiohttp-swagger copied to clipboard
Support Class Based Views
class MyView(web.View):
async def get(self):
return await get_resp(self.request)
async def post(self):
return await post_resp(self.request)
app.router.add_route('*', '/path/to', MyView)
I've also noticed some issues with class based views:
- setup_swagger doesn't understand wildcard '*' for method fileld (GET/POST/.. only)
- I can't figure out how to distinguish methods within given class view
@olexandr-klymenko I had the same issue. For me the issue was resolved by installing aiohttp-swagger via git instead of pip! The latest pip version does not contain this fix!!
Any chance to upload a new version to pypi?