Added json.Number as recognized type for FieldData

This commit is contained in:
vishalnayak 2016-07-06 18:54:18 -04:00
parent ad7cb2c8f1
commit 98fca2a31a
1 changed files with 7 additions and 1 deletions

View File

@ -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)
}