forked from Mirrors/jsonapi
explicitly check for float64
This commit is contained in:
parent
c887cfc585
commit
beb1f77731
|
@ -106,7 +106,7 @@ func unmarshalJsonApiNode(data *JsonApiNode, model reflect.Value) error {
|
|||
return false
|
||||
}
|
||||
|
||||
if fieldValue.Kind() == reflect.Int && v.Kind() != reflect.Int {
|
||||
if fieldValue.Kind() == reflect.Int && v.Kind() == reflect.Float64 {
|
||||
fieldValue.Set(reflect.ValueOf(int(v.Interface().(float64))))
|
||||
} else {
|
||||
fieldValue.Set(reflect.ValueOf(val))
|
||||
|
|
Loading…
Reference in New Issue