mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2026-01-08 21:21:32 +00:00
Added json.Number as recognized type for FieldData
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user