View Source Solicit.Plugs.ValidatePathParam (solicit v1.3.2)

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

Types

Plug options.

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 using Ecto.Type.cast/2. Required.
  • :required - if true, requires the parameter to not be nil or an empty string after
              casting. **Default:** `true`.

Link to this section Functions