Skip to content

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

Merged
pgjones merged 1 commit into
pallets:mainfrom
502E532E:docs_websocket_example_code
Jul 22, 2026
Merged

doc: Fix example code in documentation of app.add_websocket#422
pgjones merged 1 commit into
pallets:mainfrom
502E532E:docs_websocket_example_code

Conversation

@502E532E

Copy link
Copy Markdown
Contributor

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.

@pgjones
pgjones merged commit 0163dda into pallets:main Jul 22, 2026
1 check failed
@pgjones

pgjones commented Jul 22, 2026

Copy link
Copy Markdown
Member

Thanks

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.

2 participants