Skip to content

Commit

Permalink
Fix validation of boolean used in a union
Browse files Browse the repository at this point in the history
  • Loading branch information
Allan Glen committed Dec 30, 2016
1 parent 4ed2cdd commit 86e51ec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ func (*BooleanSchema) Prop(key string) (interface{}, bool) {

// Validate checks whether the given value is writeable to this schema.
func (*BooleanSchema) Validate(v reflect.Value) bool {
return dereference(v).Kind() == reflect.Bool
return reflect.TypeOf(dereference(v).Interface()).Kind() == reflect.Bool
}

// MarshalJSON serializes the given schema as JSON. Never returns an error.
Expand Down

0 comments on commit 86e51ec

Please sign in to comment.