View Source Solicit.Plugs.ValidatePathParam (solicit v1.3.1)
Casts the given path param to the given type. If the cast fails, returns a 404. Uses Solicit for 404 responses, so only API routes are supported.
Link to this section Summary
Link to this section Types
@type options() :: [param: binary(), type: Ecto.Type.t(), required: boolean()]
Plug options.
:param
- the string name of the parameter to be cast. Required.:type
- the type to cast to usingEcto.Type.cast/2
. Required.:required
- if true, requires the parameter to not be nil or an empty string aftercasting. **Default:** `true`.
Link to this section Functions
@spec call( Plug.Conn.t(), keyword() ) :: Plug.Conn.t()