docs: fix Ctx.Scheme/Protocol documentation (#4473)#4474
Conversation
- Rename the non-existent Schema() section to Scheme() to match the actual method on fiber.Ctx - Correct the Protocol() docs: it returns the HTTP protocol version (HTTP/1.1, HTTP/2), not the URL scheme; point readers to Scheme() for the scheme - Update the Secure() example to use Scheme() == "https" to match the implementation Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9d2571t4Y7aJmt4cHuay5
Audited all docs against the code and corrected the following: - redirect.md: fix Messages()/Message()/OldInputs()/OldInput() return types ([]FlashMessage, FlashMessage, []OldInputData, OldInputData) and update the Message/OldInput examples to use the struct's .Value field - constants.md: replace non-existent HeaderFeaturePolicy with the actual HeaderPermissionsPolicy; add missing HeaderSecFetchSite, HeaderXResponseTime, MIMEApplicationJavaScript and MIMEApplicationMsgPack; refresh HTTP status-code RFC citations to match constants.go (RFC 9110) - internal.md: replace the removed OnShutdown hook with OnPreShutdown and OnPostShutdown in both the list and the mermaid diagram - logger.md: document the BeforeHandlerFunc and TimeDone Config fields - client/rest.md & request.md: sync the documented Client/Request struct fields with the current code (transport, isDebug, value-type request fields, isPathNormalizingDisabled) - addon/retry.md: include the currentInterval field in the Config snippet Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9d2571t4Y7aJmt4cHuay5
WalkthroughDocumentation-only update syncing eight doc pages with code changes: renames ChangesFiber Documentation Sync
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
docs/api/redirect.md (1)
231-238: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winUpdate
WithandWithInputexamples to match new return types.The examples for
WithandWithInputcallMessage()andOldInput()but don't account for their new return types (FlashMessageandOldInputData). Lines 237 and 259 need.Valueaccess to compile.// Line 237 should be: return c.SendString(c.Redirect().Message("status").Value) // Line 259 should be: return c.SendString(c.Redirect().OldInput("name").Value)Also applies to: 257-260
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/api/redirect.md` around lines 231 - 238, The redirect docs examples for `c.Redirect().Message("status")` and `c.Redirect().OldInput("name")` no longer match the updated return types, so update the `With`/`WithInput` examples to access the underlying string via `.Value`. Keep the examples in the `app.Get("/")` handlers aligned with the new `FlashMessage` and `OldInputData` types so the snippets compile.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@docs/api/redirect.md`:
- Around line 231-238: The redirect docs examples for
`c.Redirect().Message("status")` and `c.Redirect().OldInput("name")` no longer
match the updated return types, so update the `With`/`WithInput` examples to
access the underlying string via `.Value`. Keep the examples in the
`app.Get("/")` handlers aligned with the new `FlashMessage` and `OldInputData`
types so the snippets compile.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: cc8ab2d3-b885-401e-9033-6c7d142292e6
📒 Files selected for processing (8)
docs/addon/retry.mddocs/api/constants.mddocs/api/ctx.mddocs/api/redirect.mddocs/client/request.mddocs/client/rest.mddocs/extra/internal.mddocs/middleware/logger.md
actual method on fiber.Ctx
(HTTP/1.1, HTTP/2), not the URL scheme; point readers to Scheme()
for the scheme
implementation
Fixes #4473
Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01L9d2571t4Y7aJmt4cHuay5