Closed hsz1273327 closed 3 years ago
from sanic import Blueprint, Sanic, text
from sanic_openapi import openapi3_blueprint
app = Sanic(__name__)
app.config.API_URI_FILTER = "all"
bp = Blueprint(__name__, version=1)
async def handler(request):
return text(request.ip)
bp.get("/", strict_slashes=True)(handler)
bp.post("/", strict_slashes=True)(handler)
bp.get("/<uid:int>", strict_slashes=True)(handler)
bp.put("/<uid:int>", strict_slashes=True)(handler)
bp.delete("/<uid:int>", strict_slashes=True)(handler)
app.blueprint(bp)
app.blueprint(openapi3_blueprint)
app.run(port=9999, debug=True)
Seems to work okay for me. One thing to note, app.config.API_URI_FILTER = "all"
forces the inclusion of routes that end with /
. Since you have the empty routes with strict_slashes
on, they would be removed.
LMK if I am missing something.
thanks
Describe the bug can not render all methods with the same url when use
routes of Blueprint
wayScreenshots![api-1](https://user-images.githubusercontent.com/7850148/118247993-65de4a80-b4d6-11eb-9341-e6e4975d2fb4.PNG)
To Reproduce Your code snippet or steps to reproduce the bug.
code as blow:
Expected behavior
there should have all method sections in
user
part,but there are only 2 with diffrent urlEnvironment (please complete the following information):
Additional context Add any other context about the problem here. This might be how to fix this bug or some hint to fix it.