longinteger values are exposed as strings by default by AppEngine API since they are 64 bit integers and JSON is only able to represent ~53 bit integers at most since all numbers are double.
This means that we should also accept integer values as input (since they are the only way to send longinteger values bigger than 53 bits with a JSON), but we currently don't.
Sketch of the fix
Add another clause to cast_valuehere which more or less does this:
defp cast_value(:longinteger, string_value) when is_binary(string_value) do
# Try to parse the value as integer, return `{:ok, int_value}` or `{:error, :unexpected_value_type}`
end
defp cast_value(:longintegerarray, string_values) do
# Similar but for an array of values. Map over them and return an `{:ok, list_of_ints}` or an error tuple.
end
longinteger
values are exposed as strings by default by AppEngine API since they are 64 bit integers and JSON is only able to represent ~53 bit integers at most since all numbers are double.This means that we should also accept integer values as input (since they are the only way to send
longinteger
values bigger than 53 bits with a JSON), but we currently don't.Sketch of the fix
Add another clause to
cast_value
here which more or less does this: