Commit Graph

23 Commits (main)

Author SHA1 Message Date
耗子 8e54c8f938
🐛 fix: Update binder in form_test (#3336)
* Fix: error binder in form_test

* fix: form tag

* Fix: error package name
2025-03-04 05:46:05 +01:00
M. Efe Çetin bc4c920ea6
bind: add support for multipart file binding (#3309)
* deps: update schema to v1.3.0

* bind: add support for multipart file binding

* bind: fix linter

* improve coverage

* fix linter

* add test cases

---------

Co-authored-by: René <rene@gofiber.io>
2025-02-25 19:45:19 +01:00
M. Efe Çetin ef04a8a99e
🐛 bug: Fix square bracket notation in Multipart FormData (#3235)
* 🐛 bug: add square bracket notation support to BindMultipart

* Fix golangci-lint issues

* Fixing undef variable

* Fix more lint issues

* test

* update1

* improve coverage

* fix linter

* reduce code duplication

* reduce code duplications in bindMultipart

---------

Co-authored-by: Juan Calderon-Perez <835733+gaby@users.noreply.github.com>
Co-authored-by: René <rene@gofiber.io>
2024-12-31 16:34:28 +01:00
Juan Calderon-Perez 845a7f8b8e
🧹 chore: Improve Performance of Fiber Router (#3261)
* Initial improvements

* Update test

* Improve RemoveEscapeChar performance

* Fix lint issues

* Re-add comments

* Add dedicated request handlers

* Fix lint issues

* Add test case for app.All with custom method

* Add test for custom Ctx and Request Methods

* Simplify test logic

* Simplify test
2024-12-29 19:34:34 +01:00
M. Efe Çetin 57744ebbe8
🐛 bug: fix EnableSplittingOnParsers is not functional (#3231)
* 🐛 bug: fix EnableSplittingOnParsers is not functional

* remove wrong testcase

* add support for external xml decoders

* improve test coverage

* fix linter

* update

* add reset methods

* improve test coverage

* merge Form and MultipartForm methods

* fix linter

* split reset and putting steps

* fix linter
2024-12-25 12:53:14 +01:00
Sumit Kumar 26cc477500
🔥 feat: Add support for CBOR encoding (#3173)
* feat(cbor): allow encoding response bodies in cbor

* fix(tests::cbor): encode struct instead of a randomly ordered hashmap

* docs(whats_new): add cbor in context section

* feat(binder): introduce CBOR

* feat(client): allow cbor in fiber client

* chore(tests): add more test

* chore(packages): go mod tidy

* fix(binder): update CBOR name and test

* improve test coverage

* improve test coverage

* update1

* add docs

* doc fixes

* update

* Fix markdown lint

* Add missing entry from binder README

* add/refresh documentation

---------

Co-authored-by: Juan Calderon-Perez <835733+gaby@users.noreply.github.com>
Co-authored-by: M. Efe Çetin <efectn@protonmail.com>
Co-authored-by: RW <rene@gofiber.io>
2024-12-01 11:03:50 +01:00
ItsMeSamey f08ebf4335
🐛 fix: Nil pointer dereference with Must Bind binding (#3171)
* Fix nil pointer dereference with Must Bind binding error

if err is nil err.Error() panics
(eg. c.Bind().Must().JSON(...) successfully binds but panics

* Added returnErr test

make sure returnErr works with nil error

* Reordered returnErr nil check

as in majority of cases we expect err to be nil, this should provide better short-cutting

* Use require.NoError

* Update bind_test.go

* Renamed Must to WithAutoHandling

* Update bind.md

Added a requested clarification

* renamed Should to WithoutAutoHandling and Bind.should to Bind.dontHandle

* renamed dontHandle to dontHandleErrs

* fixed formatting

* fixed a typo

* Update binder documentation

---------

Co-authored-by: Juan Calderon-Perez <835733+gaby@users.noreply.github.com>
2024-11-25 11:51:36 +01:00
M. Efe Çetin 3fc1b29748
chore: replace vendored gorilla/schema package (#3152) 2024-10-11 14:52:09 +03:00
Vaibhav Gupta 62f66e5968
🩹 Fix (v3): handle un-matched open brackets in the query params (#3126)
* Add logic for handling unmatched square brackets in query params

* Add UTs

* Fix lint: fieldalignment error

* Add UTs
2024-09-09 08:11:47 +02:00
耗子 062ac3bf7b
🩹 Fix: error check in Form binder (#3110)
fix: error check
2024-08-26 08:29:13 +02:00
Juan Calderon-Perez 8c3f81e2b7
v3: Use Named Fields Instead of Positional and Align Structures to Reduce Memory Usage (#3079)
* Use composites for internal structures. Fix alignment of structures across Fiber

* Update struct alignment in test files

* Enable alignment check with govet

* Fix ctx autoformat unit-test

* Revert app Config struct. Add betteralign to Makefile

* Disable comment on alert since it wont work for forks

* Update benchmark.yml

* Update benchmark.yml

* Remove warning from using positional fields

* Update router.go
2024-07-23 08:37:45 +02:00
Juan Calderon-Perez 9463a8f626
v3: Add support for consistent documentation using markdownlint (#3064)
* Add support for consistent documentation using markdownlint

* Only run workflow during changes to markdown files

* Fix more inconsistencies

* Fixes to markdown under .github/

* More fixes

* Apply suggestions from code review

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Fix typo in limiter docs

* Add missing space before code-block

* Add check for dead-links

* Add write-good

* Remove legacy README files

* Fix glob for skipping .md files

* Use paths-ignore instead

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2024-07-11 15:21:56 +02:00
Joshua Benfield e25a31b731
🩹 Fix: improper query/body parsing with embedded structs (#2906)
* added fix for embedded struct field query parsing

* updated ctx parser tests to test embedded struct field parsing

---------

Co-authored-by: Juan Calderon-Perez <835733+gaby@users.noreply.github.com>
2024-03-17 13:39:28 +01:00
nickajacks1 ccf16117c0
ci: Update golangci-lint to v1.55.2 (#2817)
ci: bump golangci-lint to 1.55.2
2024-01-30 09:53:17 +01:00
Muhammed Efe Çetin 41866cd3dd
👷 v3 (ci): fix some linter warnings 2023-03-06 17:35:39 +03:00
Muhammed Efe Çetin c2749c36c2
👷 v3 (ci): fix some linter warnings 2023-02-09 22:33:45 +03:00
leonklingele 802defa5ff
v3 (chore): cleanup (#2255)
* middleware: switch to new Ctx interface in documentation

* all: use any instead of interface{}
2022-12-03 15:39:57 +03:00
Kris Carr f26d9b1d4e
v3 (deps): update to use gofiber/utils/v2 (#2184) 2022-10-31 16:44:53 +03:00
Muhammed Efe Çetin 9428befb9c
Merge remote-tracking branch 'origin/master' into v3-beta 2022-10-28 17:26:17 +03:00
Muhammed Efe Çetin ca6f25a890
v3 (deps): move `utils` to `https://github.com/gofiber/utils` 2022-09-23 21:19:44 +03:00
Trim21 c964fda009
v3(tests): use testify for assertion (#2036)
* replace

* write

* rewrite more

* rewrite

* rewrite

* fix

* rewrite
2022-08-22 07:57:10 +02:00
Muhammed Efe Çetin 1512053c97
v3: optimize binding (reduce 1 alloc) 2022-08-08 11:16:05 +03:00
M. Efe Çetin eacde70294
v3 (feature): initial support for binding (#1981)
*  v3 (feature): initial support for binding

*  v3 (feature): initial support for binding #1981
use pointer/references instead of copies

*  v3 (feature): initial support for binding
embed bind into the ctx

*  v3 (feature): initial support for binding
- add URI binder.

*  v3 (feature): initial support for binding
- add response header binder.

*  v3 (feature): initial support for binding
- add response header binder.

*  v3 (feature): initial support for binding
- add cookie binder.

*  v3 (feature): initial support for binding
- custom binder support for body binding.
- test case for custom binder.

*  v3 (feature): initial support for binding
- add map[string][]string & map[string]string support for binders.

*  v3 (feature): initial support for binding
- fix Test_Bind_Header_Map

*  v3 (feature): initial support for binding
- Functional Should/Must

*  v3 (feature): initial support for binding
- custom struct validator support.

*  v3 (feature): initial support for binding
- README for binding.
- Docs for binding methods.

*  v3 (feature): initial support for binding
- Bind() -> BindVars(), Binding() -> Bind()

*  v3 (feature): initial support for binding
- fix doc problems

*  v3 (feature): initial support for binding
- fix doc problems

Co-authored-by: wernerr <rene@gofiber.io>
2022-08-08 09:16:08 +02:00