Skip to content

doc: Fix example code in documentation of app.add_websocket#421

Closed
502E532E wants to merge 1 commit intopallets:mainfrom
502E532E:main
Closed

doc: Fix example code in documentation of app.add_websocket#421
502E532E wants to merge 1 commit intopallets:mainfrom
502E532E:main

Conversation

@502E532E
Copy link
Copy Markdown

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 502E532E deleted the branch pallets:main March 27, 2025 13:28
@502E532E 502E532E closed this Mar 27, 2025
@502E532E 502E532E deleted the main branch March 27, 2025 13:28
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Apr 11, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant