Skip to content

Commit

Permalink
no validate struct if it not a struct
Browse files Browse the repository at this point in the history
  • Loading branch information
zomborsz authored and Som-Som-CC committed Oct 25, 2024
1 parent 34f2097 commit 72e5414
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mux_lambda_wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func lambdaGetParams(w http.ResponseWriter, r *http.Request, f any) ([]reflect.V
return nil, r, err
}

if LambdaValidator {
if LambdaValidator && reflect.ValueOf(reqDataInterface).Elem().Kind() == reflect.Struct {
if err := validate.Struct(reqDataInterface); err != nil {
return nil, r, NewError(err, http.StatusUnprocessableEntity)
}
Expand Down

0 comments on commit 72e5414

Please sign in to comment.