sanic-org / sanic-ext

Extended Sanic functionality

Home Page:https://sanic.dev/en/plugins/sanic-ext/getting-started.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug] Can't apply openapi decorators to blueprintss' routes

EverettDunamu opened this issue · comments

Describe the bug
A clear and concise description of what the bug is. It there is error log, please provide it.

  • I have an Sanic app and I registered some blueprints to it with openapi decorators
  • I cannot make any change from openapi decorators in this case.

Screenshots
The screenshots of Swagger UI if this bug is related to it.

To Reproduce
Your code snippet or steps to reproduce the bug.

my_blueprint = Blueprint("MyBlueprint")

@my_blueprint.get("/my-route")
@openapi.summary("I want to apply this summary!") # it is not working
async def get_my_route(request):
    return response.json({})
app = Sanic("MyApp")
app.blueprint(my_blueprint)

app.run()

Expected behavior
A clear and concise description of what you expected to happen.

I want to show the result of applied summary written in the above example.

Environment (please complete the following information):

  • OS: macOS
  • Browser: Chrome
  • Version: 120.0.6099.234

Additional context
Add any other context about the problem here. This might be how to fix this bug or some hint to fix it.