Closed MrYZhou closed 1 year ago
This is because:
@router.get("/{id}", tags=["web", "app"])
async def index(id):
pass
move it under /list:
@router.get("/list",status_code=200)
async def index():
...
@router.get("/{id}", tags=["web", "app"])
async def index(id):
...
The pattern "/{id}" catch "/list"
thanks very much , list was regnized as a id value
This is because:
@router.get("/{id}", tags=["web", "app"]) async def index(id): pass
move it under /list:
@router.get("/list",status_code=200) async def index(): ... @router.get("/{id}", tags=["web", "app"]) async def index(id): ...
The pattern "/{id}" catch "/list"
thanks very much,
First Check
Commit to Help
Example Code
Description
it can not response a result, a very strange phenomenon. At the command line, the request url has been regnized by fastapi,but can not into breakline. without any error info.
finaly,i change the request method with post,it work. it is so unreasonable. It is worth mentioning that the way can work normally in other router file.
Operating System
Windows
Operating System Details
No response
SQLModel Version
latest
Python Version
3.10.5
Additional Context
Consider that bugs are hard to reproduce,this is my demo url.
about demo path: router/generate.py
@router.get("/list",status_code=200) async def index(): with Session(engine) as session: list = session.exec(select(Config).offset(0).limit(100)).all() return list
[https://github.com/MrYZhou/fastapi-le.git](demo url)