Skip to content

Conversation

@kaziiriad
Copy link

Fix: Allow both APIRoute and WebSocketRoute to be consistent with processing logic

if not isinstance(route, (APIRoute, WebSocketRoute)):
            raise ValueError("The provided routes should be of type APIRoute or WebSocketRoute")

Only processed route_methods for APIRoute (WebSocketRoute doesn't have methods). For WebSocketRoute, use the actual route type name

if isinstance(route, APIRoute):
    route_methods: Any = route.methods
    cast(Tuple[Any], route_methods)
    router_roles.append((route.path, tuple(route_methods)))
else:
   router_roles.append((route.path, (type(route).__name__,)))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant