Skip to content

Comments

docs: update documentation for parser configuration and request handling#4096

Merged
ReneWerner87 merged 4 commits intomainfrom
fix-docs
Feb 20, 2026
Merged

docs: update documentation for parser configuration and request handling#4096
ReneWerner87 merged 4 commits intomainfrom
fix-docs

Conversation

@ReneWerner87
Copy link
Member

No description provided.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @ReneWerner87, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request primarily focuses on enhancing and clarifying the documentation across various core components. It includes important corrections to code examples, improved descriptions for parser configurations and request handling, and updates to reflect recent API changes, ensuring the documentation accurately represents the current state of the application.

Highlights

  • Form Binding Documentation Update: The documentation for the Form method in bind.go has been updated to explicitly state that multipart file fields are now supported, clarifying previous limitations.
  • API Configuration Documentation Refinements: The docs/api/app.md file received several corrections, including fixing the Timeout syntax from time.Second() to time.Second and updating default values for IdleTimeout, ReadTimeout, WriteTimeout, and MsgPack encoders/decoders from nil to 0 or specific binder types.
  • Detailed Parser Configuration Explanation: The docs/api/bind.md file now includes an important note regarding the conditions under which the request body is included as a binding source. It also provides a more detailed and accurate explanation of SetParserDecoder, including explicit binder.ParserConfig and binder.ParserType struct definitions and corrected usage examples.
  • "What's New" Section Enhancements: The docs/whats_new.md file has been revised to reflect error return types for SendStreamWriter, Drop, and End methods. Additionally, an import in a service example was changed from strconv to context, and syntax in RouteChain and dynamic route examples was corrected for better readability and accuracy.
Changelog
  • bind.go
    • Updated the comment for the Form method to indicate support for multipart file fields.
  • docs/api/app.md
    • Corrected Timeout value from time.Second() to time.Second.
    • Updated default values for IdleTimeout, ReadTimeout, and WriteTimeout from nil to 0.
    • Renamed MsgpackEncoder to MsgPackEncoder and MsgpackDecoder to MsgPackDecoder and updated their default values.
  • docs/api/bind.md
    • Added an info block explaining when the request body is included as a binding source.
    • Updated the SetParserDecoder signature to use binder.ParserConfig.
    • Included the struct definitions for binder.ParserConfig and binder.ParserType.
    • Corrected example code to use binder.ParserType and binder.ParserConfig instead of fiber.ParserType and fiber.ParserConfig.
  • docs/whats_new.md
    • Updated SendStreamWriter signature to return error.
    • Updated app.Get handler signature in SSE example to return error.
    • Updated Drop method signature to return error.
    • Updated End method signature to return error.
    • Changed import from strconv to context in a service example.
    • Adjusted line breaks in the RouteChain example for better readability.
    • Corrected Ctx to fiber.Ctx in dynamic route examples.
Activity
  • No activity found in the provided context.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@ReneWerner87 ReneWerner87 added this to the v3 milestone Feb 20, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 20, 2026

Walkthrough

This PR updates docs and binding docs: clarifies multipart file-field binding, moves parser config types to binder (ParserConfig, ParserType, renames CustomtypeCustomType, and changes SetParserDecoder signature), renames several encoder/decoder doc symbols, adjusts timeout defaults in docs, and documents fiber.Ctx methods now returning error.

Changes

Cohort / File(s) Summary
Binder & binding
bind.go, docs/api/bind.md
Document multipart file binding via *multipart.FileHeader, []*multipart.FileHeader, *[]*multipart.FileHeader. Change SetParserDecoder to accept binder.ParserConfig; add binder.ParserConfig and binder.ParserType; rename CustomtypeCustomType; update examples to binder.*.
Context / whats_new
docs/whats_new.md
Document signature changes: SendStreamWriter, Drop, and End on fiber.Ctx now return error. Update examples and handler signatures to propagate/ignore returned errors.
API docs & naming / small examples
docs/api/app.md, docs/api/fiber.md
Minor example fix: time.Second()time.Second. Rename documented encoder/decoder symbols (Msgpack*MsgPack*, CBOR → CBOREncoder/CBORDecoder). Update displayed timeout defaults from nil to 0.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • gaby
  • sixcolors
  • efectn

Poem

🐰 I hopped through docs with nimble feet,
Parsers moved homes and types to meet,
Files now bind where once they stalled,
MsgPack named and timeouts called,
A tiny hop — the docs feel neat! 🎉

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The pull request has no description provided. The template requires clear description of changes, purpose, affected sections, and completion of various checklists for documentation updates. Add a comprehensive description including: overview of documentation changes, specific files modified, relevant issues fixed, confirmation of documentation and test updates, and completion of applicable checklist items.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main focus of the changes, which involve documentation updates for parser configuration and request handling across multiple doc files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-docs

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 and usage tips.

@codecov
Copy link

codecov bot commented Feb 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.03%. Comparing base (562043e) to head (9ebe8c7).
⚠️ Report is 10 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4096      +/-   ##
==========================================
+ Coverage   90.99%   91.03%   +0.03%     
==========================================
  Files         119      119              
  Lines       11337    11320      -17     
==========================================
- Hits        10316    10305      -11     
+ Misses        648      643       -5     
+ Partials      373      372       -1     
Flag Coverage Δ
unittests 91.03% <ø> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates Fiber v3 documentation to better reflect current parser/binding configuration and request/response handling APIs, plus a small inline comment correction in Bind.Form.

Changes:

  • Align whats_new.md examples/signatures with v3 APIs (handlers returning error, SendStreamWriter/Drop/End returning error, use of fiber.Ctx in examples).
  • Fix/clarify config documentation (IdleTimeout/ReadTimeout/WriteTimeout defaults as 0, correct MsgPackEncoder/Decoder naming and types).
  • Clarify binding behavior/docs around parser decoder configuration and when request body participates in Bind().All(), and update Bind.Form comment about multipart file support.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
docs/whats_new.md Updates migration notes and code samples to match v3 signatures and types.
docs/api/fiber.md Corrects config table entries (timeouts default values; MsgPack encoder/decoder naming/types/defaults).
docs/api/bind.md Adds binding-source clarification and updates parser decoder configuration docs (but see review comment on signature accuracy).
docs/api/app.md Fixes TestConfig.Timeout example to use time.Second (not time.Second()).
bind.go Updates Bind.Form comment to reflect multipart file header binding support.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

The pull request correctly updates the documentation to reflect changes in Fiber v3, specifically regarding the new binding system, parser configuration, and updated method signatures that now return errors. It also fixes several typos in code examples (e.g., time.Second() to time.Second) and improves consistency in default value descriptions for durations and encoders. I have identified one minor inconsistency in the fiber.md configuration table where the * prefix was removed for MsgPack default values but retained for CBOR, despite both being function values.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

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/whats_new.md (1)

724-751: ⚠️ Potential issue | 🟡 Minor

c.End() error silently discarded after the signature now returns one.

Line 724 correctly documents the new error return for End(), but the example at line 747 silently drops the error:

c.End() // Closes the underlying connection
return errors.New("No name provided")

Readers following this example will learn to discard the error return. The example should either handle it or explicitly discard it with _:

🔧 Suggested fix
-        c.SendString("You don't have a name?")
-        c.End() // Closes the underlying connection
+        _ = c.SendString("You don't have a name?")
+        _ = c.End() // Closes the underlying connection; errors intentionally ignored
         return errors.New("No name provided")
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/whats_new.md` around lines 724 - 751, Update the example showing
Ctx.End() to not silently ignore its error return: in the example handler that
calls c.End() (method Ctx.End), either check and handle the returned error
(e.g., capture it and log or wrap it before returning) or explicitly discard it
using the blank identifier (e.g., _ = c.End()). Modify the snippet inside the
app.Get("/hello"...) example so the call to c.End() is followed by an explicit
error handling or `_ = c.End()` and keep the subsequent `return errors.New("No
name provided")` behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@docs/whats_new.md`:
- Around line 724-751: Update the example showing Ctx.End() to not silently
ignore its error return: in the example handler that calls c.End() (method
Ctx.End), either check and handle the returned error (e.g., capture it and log
or wrap it before returning) or explicitly discard it using the blank identifier
(e.g., _ = c.End()). Modify the snippet inside the app.Get("/hello"...) example
so the call to c.End() is followed by an explicit error handling or `_ =
c.End()` and keep the subsequent `return errors.New("No name provided")`
behavior.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
docs/whats_new.md (1)

499-502: ⚠️ Potential issue | 🟡 Minor

Pre-existing compile error in the Test Config example — return with a value in a void handler.

The handler at line 500 is declared as func(c fiber.Ctx) (no return type), but line 501 uses return c.SendString("hello world"), which attempts to return an error value from a void function. This is a compile error in Go, independent of the handler-compatibility table's Case 2 support.

🐛 Proposed fix
-app.Get("/", func(c fiber.Ctx) {
-    return c.SendString("hello world")
-})
+app.Get("/", func(c fiber.Ctx) error {
+    return c.SendString("hello world")
+})
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/whats_new.md` around lines 499 - 502, The handler used in the Test
Config example is declared as func(c fiber.Ctx) (no return) but uses return
c.SendString("hello world"), causing a compile error; change the handler
signature to accept and return an error (e.g., func(c *fiber.Ctx) error) or
remove the return and call c.SendString without returning, and ensure you use
the correct ctx type (fiber.Ctx vs *fiber.Ctx) consistent with app.Get's
expected handler (reference app, fiber.New, app.Get, the handler func signature,
and c.SendString).
🧹 Nitpick comments (2)
docs/api/bind.md (1)

640-668: Consider adding the binder package import path to the example.

The example uses binder.SetParserDecoder, binder.ParserConfig, and binder.ParserType — a package-level import that is not obvious to readers. Unlike handler-scoped calls, this function is typically called from main() or init(), so readers need to know the import path. Adding an import block at the top of the example would make it self-contained.

✏️ Suggested addition to the Example block
import (
    "reflect"
    "time"
    "github.com/gofiber/fiber/v3/binder"
)

The API rename from fiber.* to binder.* in the usage and type instantiation (lines 659, 665, 667) is correct and matches the binder package's exported SetParserDecoder function.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/api/bind.md` around lines 640 - 668, The example is missing the import
block for the binder package and other used packages; add an import statement
including "github.com/gofiber/fiber/v3/binder" plus "reflect" and "time" (and
any other standard packages used) at the top of the snippet so the usages of
binder.SetParserDecoder, binder.ParserConfig, and binder.ParserType and the
CustomTime/time.Parse calls compile and the example is self-contained.
docs/whats_new.md (1)

746-747: LGTM — intentional _ = error-ignore pattern is appropriate here.

The c.End() comment is clear. Consider adding a matching inline comment to line 746 (// response already ended below) so both ignored errors are self-documented at the call site.

✏️ Optional: symmetric comments
-        _ = c.SendString("You don't have a name?")
-        _ = c.End() // Closes the underlying connection; errors intentionally ignored
+        _ = c.SendString("You don't have a name?") // errors intentionally ignored; connection is closed below
+        _ = c.End()                                 // Closes the underlying connection; errors intentionally ignored
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/whats_new.md` around lines 746 - 747, Add a symmetric inline comment to
the c.SendString call to document the intentional ignored error like the c.End()
line does; update the call to c.SendString (in the same block that calls
c.End()) to append a short comment such as "// response already ended below" so
both ignored "_ = ..." calls (c.SendString and c.End) clearly explain why their
errors are intentionally discarded.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/api/bind.md`:
- Around line 621-622: The Signature block shows a bare call expression instead
of a Go function declaration; replace the line
"binder.SetParserDecoder(parserConfig binder.ParserConfig)" with a proper
function signature declaration "func SetParserDecoder(parserConfig
ParserConfig)" (i.e., add the "func" keyword, use the local type name
ParserConfig rather than binder.ParserConfig) so the Signature section correctly
documents the SetParserDecoder function and references ParserConfig.

---

Outside diff comments:
In `@docs/whats_new.md`:
- Around line 499-502: The handler used in the Test Config example is declared
as func(c fiber.Ctx) (no return) but uses return c.SendString("hello world"),
causing a compile error; change the handler signature to accept and return an
error (e.g., func(c *fiber.Ctx) error) or remove the return and call
c.SendString without returning, and ensure you use the correct ctx type
(fiber.Ctx vs *fiber.Ctx) consistent with app.Get's expected handler (reference
app, fiber.New, app.Get, the handler func signature, and c.SendString).

---

Nitpick comments:
In `@docs/api/bind.md`:
- Around line 640-668: The example is missing the import block for the binder
package and other used packages; add an import statement including
"github.com/gofiber/fiber/v3/binder" plus "reflect" and "time" (and any other
standard packages used) at the top of the snippet so the usages of
binder.SetParserDecoder, binder.ParserConfig, and binder.ParserType and the
CustomTime/time.Parse calls compile and the example is self-contained.

In `@docs/whats_new.md`:
- Around line 746-747: Add a symmetric inline comment to the c.SendString call
to document the intentional ignored error like the c.End() line does; update the
call to c.SendString (in the same block that calls c.End()) to append a short
comment such as "// response already ended below" so both ignored "_ = ..."
calls (c.SendString and c.End) clearly explain why their errors are
intentionally discarded.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/api/bind.md`:
- Around line 590-592: The documentation line describing WithAutoHandling has a
run-on sentence and missing punctuation; update the sentence "This function does
NOT panic therefore you must still return on error explicitly" to include a
comma after "panic" and end the sentence with a period (e.g., "This function
does NOT panic, therefore you must still return on error explicitly."); ensure
the WithAutoHandling description line also ends with a trailing period.

---

Duplicate comments:
In `@docs/api/bind.md`:
- Around line 620-622: The Signature block incorrectly uses a qualified type
name; change the parameter type in the SetParserDecoder signature from
binder.ParserConfig to the unqualified ParserConfig (i.e., update the function
signature for SetParserDecoder to accept ParserConfig) so it follows Go doc
conventions for types within the same package.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

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/whats_new.md (1)

734-751: ⚠️ Potential issue | 🟡 Minor

log.Println doesn't process format verbs — %v will appear literally.

Line 736 in the same End example block uses log.Println("Got error: %v", err). log.Println does not support format specifiers; the output will be Got error: %v <error_string> instead of the intended interpolated form.

🐛 Proposed fix
-        log.Println("Got error: %v", err)
+        log.Printf("Got error: %v\n", err)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/whats_new.md` around lines 734 - 751, The log call inside the middleware
using log.Println("Got error: %v", err) is incorrect because log.Println doesn't
process format verbs; update the middleware's logging to either use
log.Printf("Got error: %v", err) or change to log.Println("Got error:", err) so
the error value is logged correctly — locate the anonymous middleware passed to
app.Use and replace the log.Println call accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@docs/whats_new.md`:
- Around line 734-751: The log call inside the middleware using log.Println("Got
error: %v", err) is incorrect because log.Println doesn't process format verbs;
update the middleware's logging to either use log.Printf("Got error: %v", err)
or change to log.Println("Got error:", err) so the error value is logged
correctly — locate the anonymous middleware passed to app.Use and replace the
log.Println call accordingly.

@ReneWerner87 ReneWerner87 merged commit 8b4b146 into main Feb 20, 2026
31 of 35 checks passed
@ReneWerner87 ReneWerner87 deleted the fix-docs branch February 20, 2026 20:04
@github-project-automation github-project-automation bot moved this to Done in v3 Feb 20, 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.

1 participant