Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for HTTPMethodView #67

Closed
wants to merge 1 commit into from
Closed

add support for HTTPMethodView #67

wants to merge 1 commit into from

Conversation

morentharia
Copy link

from sanic.views import HTTPMethodView
from sanic.response import json

class CarHandler(HTTPMethodView):
    @doc.summary("Get a car")
    async def get(self, request):
        return json(dict(get='get'))

    @doc.summary("Post a car")
    async def post(self, request):
        return json(dict(post='post'))

```python
from sanic.views import HTTPMethodView
from sanic.response import json

class CarHandler(HTTPMethodView):
    @doc.summary("Get a car")
    async def get(self, request):
        return json(dict(get='get'))

    @doc.summary("Post a car")
    async def post(self, request):
        return json(dict(post='post'))
```
@wswld
Copy link

wswld commented Jun 25, 2018

This would indeed be very useful.

@sebjamesfd
Copy link

sebjamesfd commented Jul 6, 2018

@morentharia Nice work!

Unfortunately this will not add the blueprint tags to each method resulting in swagger showing the methods as belonging to the "default" blueprint.

Some similar work of retrieving the route_specs of each method and then assigning the blueprint name as tags to each here https://github.com/channelcat/sanic-openapi/blob/master/sanic_openapi/openapi.py#L50

Copy link
Member

@ahopkins ahopkins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is this different than #64? Do we need this still? Can we get rid of one of them?

@logileifs
Copy link

Can we get this pull request or 64 merged?
Is there something I can do to help? I could resolve the conflicts if that's the only thing keeping this from being merged

@chenjr0719
Copy link
Member

Thanks for contribution but I'm going to close this PR because it is duplicated with #64.

@chenjr0719 chenjr0719 closed this May 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants