update serialize
This commit is contained in:
@ -141,7 +141,7 @@ func handleMapAnyAny(inputVal any, rule *define.FieldRule) (map[any]any, error)
|
||||
if inputValStr, ok := inputVal.(string); ok {
|
||||
jsonRes = gjson.Parse(inputValStr)
|
||||
} else {
|
||||
jsonRes = gjson.Parse(serialize.JSON.MarshalForString(inputVal))
|
||||
jsonRes = gjson.Parse(serialize.JSON.MarshalForStringIgnoreError(inputVal))
|
||||
}
|
||||
|
||||
if !jsonRes.IsObject() {
|
||||
@ -176,7 +176,7 @@ func strOrMapConvert(inputVal any, mapConfig *define.MapConfig, receiver any) er
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
byteData := serialize.JSON.MarshalForByte(inputVal)
|
||||
byteData := serialize.JSON.MarshalForByteIgnoreError(inputVal)
|
||||
if err = serialize.JSON.UnmarshalWithNumber(byteData, receiver); nil != err {
|
||||
return err
|
||||
}
|
||||
@ -195,7 +195,7 @@ func strOrMapConvert(inputVal any, mapConfig *define.MapConfig, receiver any) er
|
||||
}
|
||||
|
||||
if mapConfig.Mode == consts.DataMapModelReal {
|
||||
byteData := serialize.JSON.MarshalForByte(inputVal)
|
||||
byteData := serialize.JSON.MarshalForByteIgnoreError(inputVal)
|
||||
if err = serialize.JSON.UnmarshalWithNumber(byteData, receiver); nil != err {
|
||||
return err
|
||||
}
|
||||
|
Reference in New Issue
Block a user