|
|
@ -498,9 +498,16 @@ func (u *Unmarshaler) fillSlice(fieldType reflect.Type, value reflect.Value, map
|
|
|
|
|
|
|
|
|
|
|
|
func (u *Unmarshaler) fillSliceFromString(fieldType reflect.Type, value reflect.Value, mapValue interface{}) error {
|
|
|
|
func (u *Unmarshaler) fillSliceFromString(fieldType reflect.Type, value reflect.Value, mapValue interface{}) error {
|
|
|
|
var slice []interface{}
|
|
|
|
var slice []interface{}
|
|
|
|
|
|
|
|
switch v := mapValue.(type) {
|
|
|
|
|
|
|
|
case json.Number:
|
|
|
|
|
|
|
|
if err := jsonx.UnmarshalFromString(v.String(), &slice); err != nil {
|
|
|
|
|
|
|
|
return err
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
default:
|
|
|
|
if err := jsonx.UnmarshalFromString(mapValue.(string), &slice); err != nil {
|
|
|
|
if err := jsonx.UnmarshalFromString(mapValue.(string), &slice); err != nil {
|
|
|
|
return err
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
baseFieldType := Deref(fieldType.Elem())
|
|
|
|
baseFieldType := Deref(fieldType.Elem())
|
|
|
|
baseFieldKind := baseFieldType.Kind()
|
|
|
|
baseFieldKind := baseFieldType.Kind()
|
|
|
|