Added json.Number as recognized type for FieldData
This commit is contained in:
parent
ad7cb2c8f1
commit
98fca2a31a
|
@ -1,6 +1,7 @@
|
|||
package framework
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
@ -177,7 +178,12 @@ func (d *FieldData) getPrimitive(
|
|||
}
|
||||
result = int(val)
|
||||
}
|
||||
|
||||
case json.Number:
|
||||
valInt64, err := inp.Int64()
|
||||
if err != nil {
|
||||
return nil, true, err
|
||||
}
|
||||
result = int(valInt64)
|
||||
default:
|
||||
return nil, false, fmt.Errorf("invalid input '%v'", raw)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue