Closed kates closed 2 years ago
response = Crest.post(url, { "name" => "hello", "time" => Time.utc.to_unix }, json: true)
The code above will not compile with the following message
Showing last frame. Use --error-trace for full trace. In lib/crest/src/crest/params_encoder.cr:105:16 105 | memo << {processed_key, v} ^- Error: no overload matches 'Array(Tuple(String, Bool | File | Int32 | String | Symbol | Nil))#<<' with type Tuple(String, Int32 | Int64 | String) Overloads are: - Array(T)#<<(value : T)
Integer values in Crystal JSON are Int64. Currently, I worked around this issue by editing Crest's source to include Int64 in the ParamsValue type.
ParamsValue
alias ParamsValue = Bool | Int32 | String | Symbol | Nil | File? | Int64 <--- this one
Hi @kates . Thanks for your contribution. Fixed in v1.0.1.
v1.0.1
The code above will not compile with the following message
Integer values in Crystal JSON are Int64. Currently, I worked around this issue by editing Crest's source to include Int64 in the
ParamsValue
type.