First Check
Commit to Help
Example Code
router.add_api_route(
"/clear",
clear,
methods=["POST", "DELETE"]
)
Description
Seems to be caused by #4650.
The new generate_unique_id() function uses list(route.methods)[0].lower() as suffix for the operation_id. Therefore, in my example, both post and delete endpoints get _post suffix for operation_id, causing it to no longer be unique.
It then issues a "UserWarning: Duplicate Operation ID"
Operating System
Windows
Operating System Details
No response
FastAPI Version
0.75.0
Python Version
3.10.2
Additional Context
No response
First Check
Commit to Help
Example Code
Description
Seems to be caused by #4650.
The new
generate_unique_id()function useslist(route.methods)[0].lower()as suffix for theoperation_id. Therefore, in my example, both post and delete endpoints get_postsuffix for operation_id, causing it to no longer be unique.It then issues a "UserWarning: Duplicate Operation ID"
Operating System
Windows
Operating System Details
No response
FastAPI Version
0.75.0
Python Version
3.10.2
Additional Context
No response