annotation Schema::Param

Overview

An HTTP parameter annotation.

Options:

require "schema"
require "schema/ext/time/epoch_converter"

struct MyParams
  include Schema::Definition

  @[Schema::Param(converter: Time::EpochConverter, key: "theTime")]
  getter time : Array(Time)
end

params = MyParams.from_query("theTime[]=1544958806")
pp params.time.class # => Array(Time)

Defined in:

schema/annotations.cr