Skip to content

Commit

Permalink
Add Extra to validation Context
Browse files Browse the repository at this point in the history
  • Loading branch information
System-Glitch committed Dec 27, 2021
1 parent 28986bb commit eb88faf
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions validation/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ type Ruler interface {
// Contains all the information needed for validation rules.
type Context struct {
Data map[string]interface{}
Extra map[string]interface{}
Value interface{}
Parent interface{}
Field *Field
Expand Down Expand Up @@ -530,6 +531,7 @@ func validateField(fieldName string, field *Field, isJSON bool, data map[string]

ctx := &Context{
Data: data,
Extra: map[string]interface{}{},
Value: value,
Parent: c.Parent,
Field: field,
Expand Down

0 comments on commit eb88faf

Please sign in to comment.