Yojson to parse int64 (ocaml) Yojson to parse int64 (ocaml) json json

Yojson to parse int64 (ocaml)


It seems Yojson returns Int if it fits in an OCaml int and `Intlit otherwise so you need to treat all the cases:

match json with | `Assoc [("xxx", `Intlit lit)] -> Int64.of_string lit| `Assoc [("xxx", `Int i)] -> Int64.of_int i