quart icon indicating copy to clipboard operation
quart copied to clipboard

doc: Fix example code in documentation of app.add_websocket

Open 502E532E opened this issue 9 months ago • 0 comments

The current example code in the documentation assigns a function to the endpoint: str | None argument of add_websocket. Example code from docs:

def websocket_route():
    ...

app.add_websocket('/', websocket_route)

Function signature:

add_websocket(rule, endpoint=None, view_func=None, **options)

This does not work. I believe the intended way is to assign the function to the view_func parameter and change the corresponding doc entry with this pull request.

502E532E avatar Mar 27 '25 13:03 502E532E