Skip to content

Commit

Permalink
update apply() with custom changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Aashutosh committed Jan 16, 2024
1 parent b10cb78 commit 2ea6fe0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions validating.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,12 @@ func (r *Rule) Apply(v *Validation) (stop bool) {
v.AddError(field, r.validator, r.errorMessage(field, r.validator, v))
}

if v.shouldStop() {
// Customization: To validate all the fields we need to continue iterating rather stopping on single error.

// stop on error
/*if v.shouldStop() {
return true
}
}*/
}

return false
Expand Down

1 comment on commit 2ea6fe0

@guptaaashutosh
Copy link
Owner

Choose a reason for hiding this comment

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

changes in apply

Please sign in to comment.