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
|
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))))
|
fieldValue.Set(reflect.ValueOf(int(v.Interface().(float64))))
|
||||||
} else {
|
} else {
|
||||||
fieldValue.Set(reflect.ValueOf(val))
|
fieldValue.Set(reflect.ValueOf(val))
|
||||||
|
|
Loading…
Reference in New Issue