aiohttp-swagger icon indicating copy to clipboard operation
aiohttp-swagger copied to clipboard

Support Class Based Views

Open FuGangqiang opened this issue 8 years ago • 3 comments

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)

FuGangqiang avatar Feb 05 '17 12:02 FuGangqiang

I've also noticed some issues with class based views:

  1. setup_swagger doesn't understand wildcard '*' for method fileld (GET/POST/.. only)
  2. I can't figure out how to distinguish methods within given class view

olexandr-klymenko avatar Oct 18 '17 09:10 olexandr-klymenko

@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!!

PidgeyBE avatar Dec 20 '18 16:12 PidgeyBE

Any chance to upload a new version to pypi?

drgarcia1986 avatar Feb 10 '19 14:02 drgarcia1986