Skip to content

Commit f04e0d7

Browse files
authored
remove apparently useless condition check (#138)
1 parent 435420b commit f04e0d7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

type.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ func (t *typeValidator) Applies(source interface{}, kind reflect.Kind) bool {
137137
func (t *typeValidator) Validate(data interface{}) *Result {
138138
result := new(Result)
139139
result.Inc()
140-
if data == nil || reflect.DeepEqual(reflect.Zero(reflect.TypeOf(data)), reflect.ValueOf(data)) {
140+
if data == nil {
141141
// nil or zero value for the passed structure require Type: null
142142
if len(t.Type) > 0 && !t.Type.Contains(nullType) && !t.Nullable { // TODO: if a property is not required it also passes this
143143
return errorHelp.sErr(errors.InvalidType(t.Path, t.In, strings.Join(t.Type, ","), nullType))

0 commit comments

Comments
 (0)