File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,10 @@ type ValidationOption struct {
2727 Nested []ValidationOption // Validation options for nested objects
2828}
2929
30- // Validate checks the request body against the validation options and returns the first error.
30+ // Validate validates the request body based on the provided validation options.
31+ // It applies any transformers to update field values, enforces required fields,
32+ // and executes associated validators, returning the first error encountered.
33+ // For fields with nested validation options, it recursively validates the sub-objects.
3134func Validate (body map [string ]interface {}, options []ValidationOption ) error {
3235 for _ , option := range options {
3336 value , exists := body [option .Key ]
You can’t perform that action at this time.
0 commit comments