一个方法(路径)设置多个请求方式,debug测试时会报错
xxxx\fastapi\openapi\utils.py:225: UserWarning: Duplicate Operation ID xxxxx for function xxxxxxx at xxxxxxxxx warnings.warn(message, stacklevel=1)
忽略就好
附:设置多方法
METHODS = ["GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS", "HEAD"]
@router.api_route("/your_route", methods=METHODS)
async def your_method(request: Request):
pass