Repository navigation
Fixes Register Endpoint for Router of Instance of APIWebSocketRoute - #358
Closed
HideyoshiNakazone wants to merge 4 commits into
Closed
HideyoshiNakazone wants to merge 4 commits into
HideyoshiNakazone wants to merge 4 commits into
Conversation
Author
|
Hey @yuval9313, could you or another maintainer take a look in this merge request please? Thanks a lot, |
yuval9313
requested changes
Feb 18, 2025
yuval9313
left a comment
Collaborator
There was a problem hiding this comment.
You are also missing test case
| for route in router.routes: | ||
| if not isinstance(route, APIRoute): | ||
| raise ValueError("The provided routes should be of type APIRoute") | ||
| if not isinstance(route, APIRoute) and not isinstance(route, APIWebSocketRoute): |
Collaborator
There was a problem hiding this comment.
I'm sorry, this is really nit pick but I prefer not (condition a or condition b)
Author
There was a problem hiding this comment.
Versions
Python Version: 3.13
Package Versions:
Bug
When creating a Route of type
APIWebSocketRoutethe following error is thrown:This error can be replicated using the following example:
Solution
The solution i recommend is to just add the class to instance check of the
_register_endpointsfunction and then add it with a fixedroute_methodof"WS"since theAPIWebSocketRoutedoes not have amethodsatribute.Thank you very much,
Vitor Hideyoshi.