Skip to content

Use Literal type for WebSocketEndpoint encoding values#3027

Merged
Kludex merged 1 commit intoKludex:mainfrom
gmos2104:chore/better_ws_encoding_typing
Sep 20, 2025
Merged

Use Literal type for WebSocketEndpoint encoding values#3027
Kludex merged 1 commit intoKludex:mainfrom
gmos2104:chore/better_ws_encoding_typing

Conversation

@gmos2104
Copy link

@gmos2104 gmos2104 commented Sep 20, 2025

Summary

Use Literal type to better type the accepted values for encoding in WebSocketEndpoint

The documentation already states that it only accepts 'text', 'bytes' or 'json' so this only enforces it at typing level

Checklist

  • I understand that this PR may be closed in case there was no previous discussion. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.

@Kludex Kludex changed the title Use Literal type for WebSocketEndpoint encoding values Use Literal type for WebSocketEndpoint encoding values Sep 20, 2025
@Kludex Kludex merged commit 30f18da into Kludex:main Sep 20, 2025
7 checks passed
@Kludex
Copy link
Owner

Kludex commented Sep 20, 2025

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