sanic-openapi
sanic-openapi copied to clipboard
Duplicate route names error
Describe the bug
The getting started example in the sanic-openapi docs does not appear to be working with the latest sanic version. It's giving duplicate route names error. I used the code in this URL https://sanic-openapi.readthedocs.io/en/stable/sanic_openapi2/index.html. Also there is a simple error that sanic doesn't allow spaces in the app name, so the line app = Sanic("Hello world")
should be changed to app = Sanic("HelloWorld")
. I am attaching the error below.
Screenshots
To Reproduce
from sanic import Sanic
from sanic.response import json
from sanic_openapi import openapi2_blueprint
app = Sanic("HelloWorld")
app.blueprint(openapi2_blueprint)
@app.route("/")
async def test(request):
return json({"hello": "world"})
if __name__ == "__main__":
app.run(host="0.0.0.0", port=8000)
Environment:
- OS: Windows 10