-
-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix typo in SSE doc #448
Fix typo in SSE doc #448
Conversation
WalkthroughThe recent update corrects a typo in the event type name within the Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Outside diff range and nitpick comments (4)
docs/docs/features/server-sent-events-sse.md (4)
Line range hint
37-37
: Consider reducing the number of exclamation marks to maintain a professional tone in the documentation.
Line range hint
56-59
: Adjust the indentation of the unordered list to align with Markdown best practices.- Reference - [`sse.Register`](https://pkg.go.dev/github.com/danielgtaylor/huma/v2/sse#Register) - [`sse.Sender`](https://pkg.go.dev/github.com/danielgtaylor/huma/v2/sse#Sender) - External Links - [Server Sent Events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events) + - Reference + - [`sse.Register`](https://pkg.go.dev/github.com/danielgtaylor/huma/v2/sse#Register) + - [`sse.Sender`](https://pkg.go.dev/github.com/danielgtaylor/huma/v2/sse#Sender) + - External Links + - [Server Sent Events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events)
Line range hint
20-34
: Replace hard tabs with spaces to ensure consistency in the document formatting.- // Register using sse.Register instead of huma.Register - sse.Register(api, huma.Operation{ - OperationID: "sse", - Method: http.MethodGet, - Path: "/sse", - Summary: "Server sent events example", - }, map[string]any{ - "message": DefaultMessage{}, - "userCreate": UserCreatedEvent{}, - "mailReceived": MailReceivedEvent{}, - }, func(ctx context.Context, input *struct{}, send sse.Sender) { - // Send an event every second for 10 seconds. - for x := 0; x < 10; x++ { - send.Data(MailReceivedEvent{UserID: "abc123"}) - time.Sleep(1 * time.Second) - } - }) + // Register using sse.Register instead of huma.Register + sse.Register(api, huma.Operation{ + OperationID: "sse", + Method: http.MethodGet, + Path: "/sse", + Summary: "Server sent events example", + }, map[string]any{ + "message": DefaultMessage{}, + "userCreate": UserCreatedEvent{}, + "mailReceived": MailReceivedEvent{}, + }, func(ctx context.Context, input *struct{}, send sse.Sender) { + // Send an event every second for 10 seconds. + for x := 0; x < 10; x++ { + send.Data(MailReceivedEvent{UserID: "abc123"}) + time.Sleep(1 * time.Second) + } + })
Line range hint
40-40
: Ensure the code block is fenced (using triple backticks) instead of indented for better readability and consistency in Markdown files.
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- docs/docs/features/server-sent-events-sse.md (1 hunks)
Additional Context Used
LanguageTool (1)
docs/docs/features/server-sent-events-sse.md (1)
Near line 37: Using many exclamation marks might seem excessive (in this case: 3 exclamation marks for a text that’s 1348 characters long)
Context: ... time.Sleep(1 * time.Second) } }) ``` !!! info "Type Reuse" Each event model...
Additional comments not posted (1)
docs/docs/features/server-sent-events-sse.md (1)
28-28
: Corrected typo in event type name from "mailRecieved" to "mailReceived".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Summary by CodeRabbit