annotation HTTP::Param
Overview
An HTTP parameter annotation.
Options:
- converter -- a converter to use for casting.
Some types implement converter forwarding, for example,
Array
:
require "http-params-parseable"
require "http-params-parseable/ext/time/epoch_converter"
struct MyParams
include HTTP::Params::Serializable
@[HTTP::Param(converter: Time::EpochConverter)]
getter time : Array(Time)
end
params = MyParams.new("time[]=1544958806")
pp params.time.class # => Array(Time)