Skip to content

docs: fix Ctx.Scheme/Protocol documentation (#4473)#4474

Merged
ReneWerner87 merged 2 commits into
mainfrom
claude/github-issue-4473-plan-p8nf4r
Jun 29, 2026
Merged

docs: fix Ctx.Scheme/Protocol documentation (#4473)#4474
ReneWerner87 merged 2 commits into
mainfrom
claude/github-issue-4473-plan-p8nf4r

Conversation

@gaby

@gaby gaby commented Jun 28, 2026

Copy link
Copy Markdown
Member
  • 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

Fixes #4473

Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01L9d2571t4Y7aJmt4cHuay5

claude added 2 commits June 28, 2026 19:07
- 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
@coderabbitai

coderabbitai Bot commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Documentation-only update syncing eight doc pages with code changes: renames Schema() to Scheme() and redefines Protocol() on Ctx; updates redirect flash/input method signatures to typed structs; adds MIME and header constants; updates client Request and Client struct fields; replaces OnShutdown hook with OnPreShutdown/OnPostShutdown; and adds logger and retry config fields.

Changes

Fiber Documentation Sync

Layer / File(s) Summary
API constants: MIME types, headers, annotations
docs/api/constants.md
Adds MIMEApplicationJavaScript, MIMEApplicationMsgPack; replaces RFC annotations with numeric codes for Status*/Err*; adds HeaderPermissionsPolicy, HeaderSecFetchSite, HeaderXResponseTime.
Ctx Protocol/Scheme rename and Secure update
docs/api/ctx.md
Redefines Protocol() to return HTTP version string; renames Schema() to Scheme(); updates Secure() example to use c.Scheme() == "https".
Redirect flash/input typed return types
docs/api/redirect.md
Messages() returns []FlashMessage; OldInputs() returns []OldInputData; Message() and OldInput() return typed structs; examples updated to read .Value.
Client and Request struct fields
docs/client/request.md, docs/client/rest.md
Request wrapper fields change from pointer to value types; adds isPathNormalizingDisabled. Client replaces fasthttp with transport/logger, renames debug to isDebug, removes proxyURL, adds cookieJar/retryConfig.
Lifecycle hooks, logger, and retry config
docs/extra/internal.md, docs/middleware/logger.md, docs/addon/retry.md
OnShutdown replaced by OnPreShutdown/OnPostShutdown in hooks list and diagram; logger Config gains TimeDone and BeforeHandlerFunc; retry Config gains currentInterval.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • gofiber/fiber#3206: Modifies docs/api/ctx.md for the same Protocol/Schema request scheme documentation area.
  • gofiber/fiber#3498: Directly conflicts on MIMEApplicationJavaScript in docs/api/constants.md.
  • gofiber/fiber#3827: Implements the client.Request pointer→value field changes that this PR documents.

Suggested labels

🧹 Updates

Suggested reviewers

  • sixcolors
  • efectn
  • ReneWerner87

🐇 Hoppity hop, the docs are neat,
Scheme() and Protocol() no longer compete!
Flash messages typed, old inputs too,
New constants shine in shades of blue.
OnPreShutdown waits, OnPostShutdown cheers—
The rabbit stamps docs and happily veers! 🎉

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the doc fix, but it doesn't follow the required template and omits the Changes introduced, Type of change, and Checklist sections. Reformat the PR description to match the template and add sections for changes introduced, type of change, checklist items, and any relevant docs or migration notes.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: correcting Ctx.Scheme/Protocol documentation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/github-issue-4473-plan-p8nf4r

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ReneWerner87 ReneWerner87 added this to v3 Jun 28, 2026
@ReneWerner87 ReneWerner87 added this to the v3 milestone Jun 28, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 win

Update With and WithInput examples to match new return types.

The examples for With and WithInput call Message() and OldInput() but don't account for their new return types (FlashMessage and OldInputData). Lines 237 and 259 need .Value access 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

📥 Commits

Reviewing files that changed from the base of the PR and between 0ca0741 and bb40218.

📒 Files selected for processing (8)
  • docs/addon/retry.md
  • docs/api/constants.md
  • docs/api/ctx.md
  • docs/api/redirect.md
  • docs/client/request.md
  • docs/client/rest.md
  • docs/extra/internal.md
  • docs/middleware/logger.md

@ReneWerner87 ReneWerner87 merged commit d8da941 into main Jun 29, 2026
12 checks passed
@ReneWerner87 ReneWerner87 deleted the claude/github-issue-4473-plan-p8nf4r branch June 29, 2026 06:31
@github-project-automation github-project-automation Bot moved this to Done in v3 Jun 29, 2026
@ReneWerner87 ReneWerner87 modified the milestones: v3, v3.4.0 Jul 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

🐛 [Bug]: Online documentation errors: fiber/v3.Ctx.Schema(), fiber/v3.Ctx.Protocol()

3 participants