You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you can try it out and give some feedback by installing it from pip install git+https://github.com/maldoinc/wireup.git@fastapi/websocket that'd be great as I haven't tested it extensively yet.
Thank you, it works fine, however I do have a related suggestion. Websocket itself is not injectable, would it be possible to make it so? In a way, similar to how FastAPI Request is handled...
I released v0.14.0 which allows injection in websocket routes. Exposing WebSocket like Request will come in a later release, for now you can just forward the connection or any data from it from the websocket endpoint.
With FastAPI, trying to inject to into a websocket endpoint function fails to resolve the dependency.
Consider this:
Returns:
Note the object type
EmptyContainerInjectionRequest
.Injecting the same into a endpoint function decorated with
@app.get
works perfectly fine.The text was updated successfully, but these errors were encountered: