annotation Athena::Routing::QueryParam

Overview

Defines a query parameter tied to a given argument.

The type of the query param is derived from the type restriction of the associated controller action argument.

A non-nilable type denotes it as required. If the parameter is not supplied, and no default value is assigned, an ART::Exceptions::BadRequest exception is raised. A nilable type denotes it as optional. If the parameter is not supplied (or could not be converted), and no default value is assigned, it is nil.

Fields

Example

@[ART::Get(path: "/example")]
@[ART::QueryParam("query_param")]
def get_user(query_param : String) : Nil
end

Defined in:

annotations.cr