Browse Source
self.routes[-1] is typed as Starlette's BaseRoute, which lacks the stream_item_type/stream_item_field/app attributes used by APIRoute. Narrow the type with an isinstance check so mypy is satisfied and the access is defensively guarded even though the preceding isinstance(route, APIRoute) plus route_class_override=type(route) make it true in practice.pull/15426/head
1 changed files with 4 additions and 3 deletions
Loading…
Reference in new issue