🐛 Fix duplicate operation IDs for routes with multiple methods (#13175) by r266-tech · Pull Request #15194 · fastapi/fastapi
Navigation Menu
- Notifications You must be signed in to change notification settings
- Fork 9k
Conversation
When a route is registered with multiple HTTP methods (e.g., methods=['POST', 'DELETE']), the default generate_unique_id function only uses the first method, causing duplicate operation IDs in the OpenAPI schema. This fix ensures that when a route has multiple methods and no explicit operation_id, each method gets a unique operation ID by appending the current method name. Fixes fastapi#13175
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters