8000 Fix issue #359 by kaziiriad · Pull Request #367 · fastapiutils/fastapi-utils · GitHub
[go: up one dir, main page]

Skip to content

8000 Fix issue #359 #367

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fix issue #359 #367

wants to merge 1 commit into from

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
0