Skip to content

Duplicate route names error #258

@m-aliansari

Description

@m-aliansari

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
image

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions