-
Notifications
You must be signed in to change notification settings - Fork 90
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: PrepareForValidation Context fixes [#589] #859
Open
ahmed3mar
wants to merge
61
commits into
goravel:v1.15.x
Choose a base branch
from
ahmed3mar:patch-5
base: v1.15.x
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
61 commits
Select commit
Hold shift + click to select a range
e8dea15
fix: artisan bug (#802)
hwbrzzl 736808b
upgrade v1.15.2
hwbrzzl 951b489
chore: optimize grpc link (#806)
hwbrzzl 273efc8
chore(deps): Update non-major dependencies (#807)
renovate[bot] 9f64a3c
chore(deps): Update non-major dependencies (#811)
renovate[bot] 634f3b3
chore: [#539] Remove the SQL migrator module (#809)
hwbrzzl bc907a5
chore: move testing.http to a single folder (#814)
hwbrzzl 225df76
chore(deps): Update github.com/charmbracelet/huh/spinner digest to 6cβ¦
renovate[bot] 28200d6
test: submodule (#816)
hwbrzzl 458efb9
feat: migrator support to change table column (#813)
almas1992 aa6a927
README
hwbrzzl 0f24e0c
chore(deps): Update module google.golang.org/grpc to v1.69.4 (#817)
renovate[bot] d747f79
chore(deps): Update dependency go to v1.23.5 (#822)
renovate[bot] 8c46b8a
chore: optimize make:command for auto-generated Signature and simplifβ¦
almas1992 cdd2b8b
feat: [#540] Move the Postgres driver to a single package (#810)
hwbrzzl 29c6fd4
feat: [#540] Remove contracts/database/config.go::Driver (#823)
hwbrzzl c28d76f
feat: [#540] Remove SQL in show_command.go (#825)
hwbrzzl 85749fc
feat: [#540] Remove database.connections.* (#827)
hwbrzzl 737d24e
chore: add GetContent and PutContent methods to support/file (#824)
almas1992 187beae
chore(deps): Update module google.golang.org/grpc to v1.70.0 (#832)
renovate[bot] 1026257
feat: [#540] Remove DriverSchema (#828)
hwbrzzl 463cb24
chore: [#540] Add common functions (#833)
hwbrzzl 9f9dfdb
chore: [#540] Fix tests (#834)
hwbrzzl 208f44e
chore(deps): Update module github.com/samber/lo to v1.48.0 (#835)
renovate[bot] 5c8f7f9
chore(deps): Update module github.com/samber/lo to v1.49.0 (#837)
renovate[bot] 5496ec6
chore(deps): Update module github.com/samber/lo to v1.49.1 (#838)
renovate[bot] ec545a6
chore(deps): Update non-major dependencies (#839)
renovate[bot] 724ab86
chore(deps): Update github.com/charmbracelet/huh/spinner digest to c7β¦
renovate[bot] 9826b37
chore(deps): Update module github.com/brianvoe/gofakeit/v7 to v7.2.1 β¦
renovate[bot] 219c1fd
chore: merge v1.15.3 (#842)
hwbrzzl 49649aa
chore: update tests (#843)
hwbrzzl cbb806d
feat: [#540] Adapt Mysql driver (#844)
hwbrzzl 702075c
chore: [#540] Add test cases (#845)
hwbrzzl d0de53e
chore(deps): Update github.com/charmbracelet/huh/spinner digest to f0β¦
renovate[bot] 656636e
chore: update tests mod (#846)
hwbrzzl 9aa404b
chore(deps): Update non-major dependencies (#849)
renovate[bot] ffb840d
chore: upgrade db packages (#848)
hwbrzzl dc45fb9
feat: grpc graceful shutdown (#850)
devhaozi 90fdd5f
chore(deps): Update golang.org/x/exp digest to f9890c6 (#852)
renovate[bot] b635f38
chore: [#585] update db config to use proper casing for DB server namβ¦
almas1992 b9727ea
chore(deps): Update tests module (#854)
almas1992 2105677
update renovate
hwbrzzl dbb8ec6
update renovate
hwbrzzl 98a0ffd
update renovate
hwbrzzl 7ed72e5
test renovate
hwbrzzl de582d3
test renovate
hwbrzzl b777507
refactor: queue pr part 1 (#808)
devhaozi e60cacf
test renovate
hwbrzzl 482669b
test renovate
hwbrzzl 1f9e5b3
test renovate
hwbrzzl 57590a7
chore: Update github.com/goravel/postgres digest to e505779 (#857)
renovate[bot] 69f41c5
chore: Update dependency go to v1.23.6 (#858)
renovate[bot] e3f5532
fix: PrepareForValidation Context fixes [#589]
ahmed3mar b8242bc
chore: restructure testing folder (#861)
hwbrzzl 26901e3
fix: unit test
ahmed3mar 782a508
chore: Update upgrade DB packages (#862)
renovate[bot] 5ae99eb
Merge branch 'master' into patch-5
ahmed3mar d969b31
Merge branch 'v1.15.x' into patch-5
ahmed3mar c43112d
reset
ahmed3mar f1b8e7b
update
ahmed3mar a7df673
unit test
ahmed3mar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ import ( | |
"github.com/goravel/framework/contracts/http" | ||
httpvalidate "github.com/goravel/framework/contracts/validation" | ||
"github.com/goravel/framework/errors" | ||
goravelhttp "github.com/goravel/framework/http" | ||
) | ||
|
||
func TestMake(t *testing.T) { | ||
|
@@ -81,6 +82,9 @@ func TestMake(t *testing.T) { | |
rules: map[string]string{"a": "required"}, | ||
options: []httpvalidate.Option{ | ||
Filters(map[string]string{"a": "trim"}), | ||
func(o map[string]any) { | ||
o["ctx"] = goravelhttp.NewContext() | ||
}, | ||
Comment on lines
+85
to
+87
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can create a new |
||
PrepareForValidation(func(ctx http.Context, data httpvalidate.Data) error { | ||
return ErrInvalidData | ||
}), | ||
|
@@ -93,6 +97,9 @@ func TestMake(t *testing.T) { | |
rules: map[string]string{"a": "required"}, | ||
options: []httpvalidate.Option{ | ||
Filters(map[string]string{"a": "trim"}), | ||
func(o map[string]any) { | ||
o["ctx"] = goravelhttp.NewContext() | ||
}, | ||
PrepareForValidation(func(ctx http.Context, data httpvalidate.Data) error { | ||
if _, exist := data.Get("a"); exist { | ||
return data.Set("a", "c") | ||
|
@@ -116,6 +123,9 @@ func TestMake(t *testing.T) { | |
Attributes(map[string]string{ | ||
"b": "B", | ||
}), | ||
func(o map[string]any) { | ||
o["ctx"] = goravelhttp.NewContext() | ||
}, | ||
PrepareForValidation(func(ctx http.Context, data httpvalidate.Data) error { | ||
if _, exist := data.Get("a"); exist { | ||
return data.Set("a", "c") | ||
|
@@ -135,6 +145,9 @@ func TestMake(t *testing.T) { | |
rules: map[string]string{"A": "required"}, | ||
options: []httpvalidate.Option{ | ||
Filters(map[string]string{"A": "trim"}), | ||
func(o map[string]any) { | ||
o["ctx"] = goravelhttp.NewContext() | ||
}, | ||
PrepareForValidation(func(ctx http.Context, data httpvalidate.Data) error { | ||
if _, exist := data.Get("A"); exist { | ||
return data.Set("A", "c") | ||
|
@@ -158,6 +171,9 @@ func TestMake(t *testing.T) { | |
Attributes(map[string]string{ | ||
"B": "b", | ||
}), | ||
func(o map[string]any) { | ||
o["ctx"] = goravelhttp.NewContext() | ||
}, | ||
PrepareForValidation(func(ctx http.Context, data httpvalidate.Data) error { | ||
if _, exist := data.Get("a"); exist { | ||
return data.Set("a", "c") | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Need check if existing:
ctx, ok := generateOptions["ctx"].(http.Context)