Browse Source
When a route is registered with multiple HTTP methods via add_api_route(), generate_unique_id() uses list(route.methods)[0] which is non-deterministic (methods is a set) and the same for every method in the route. This causes get_openapi_operation_metadata to assign identical operationIds to POST and DELETE (or any other method pair), triggering "Duplicate Operation ID" warnings. Two fixes: - generate_unique_id: use sorted(route.methods)[0] so the fallback unique_id is deterministic for single-method routes - get_openapi_operation_metadata: for multi-method routes without an explicit operation_id, derive the operationId from the route name/path plus the per-iteration method instead of reusing route.unique_id Fixes #13175 Co-Authored-By: Claude Sonnet 4.6 <[email protected]>pull/15114/head
3 changed files with 38 additions and 2 deletions
Loading…
Reference in new issue