open Thoth.Json.Net
type test_type = { i: int64 }
let extra = Extra.empty |> Extra.withInt64
let test_type_decoder = Decode.Auto.generateDecoder<test_type> (extra = extra)
let test_type_json1 = """{"i": 9223372036854775806}"""
let test_type_json2 = """{"i": 8223372036854775806}"""
let test_type1 = Decode.Auto.fromString<test_type> (test_type_json1, extra = extra)
let test_type2 = Decode.fromString test_type_decoder test_type_json2
printfn "test_type1: %A" test_type1
printfn "test_type2: %A" test_type2
For some reason the first value gets parsed as -ve. This seems to only happen for numbers close to the max value. Maybe some sort of overflow is happening.
For some reason the first value gets parsed as -ve. This seems to only happen for numbers close to the max value. Maybe some sort of overflow is happening.