sanic-org / sanic-openapi

Easily document your Sanic API with a UI
https://sanic-openapi.readthedocs.io/
MIT License
505 stars 108 forks source link

Can't handle duplicate path #239

Closed koug44 closed 3 years ago

koug44 commented 3 years ago

Here is the simple bug to show the bug. Sanic server has two handlers having the same path:

from sanic import Sanic
from sanic.response import json
from sanic_openapi import openapi2_blueprint

app = Sanic(name="AwesomeApi")
app.blueprint(openapi2_blueprint)

@app.get("/path")
async def test(request):
    return json({"hello": "world"})

@app.post("/path")
async def post_test(request):
    return json({"hello": "world"})

if __name__ == "__main__":
    app.run(host="0.0.0.0", port=8000)

Swagger doc only includes one handler

image

artcg commented 3 years ago

Thanks for the report, will check that out over next couple days