PhoenixApiToolkit.GenericRequestValidator.path_param

You're seeing just the function path_param, go back to PhoenixApiToolkit.GenericRequestValidator module for more information.

Specs

path_param(map()) :: Ecto.Changeset.t()

Validates the path parameter of a generic GET request of a RESTful resource.

Examples

# "id" is a required parameter
iex> path_param(%{}) |> Map.get(:valid?)
false

# "id" must be an integer
iex> path_param(%{"id" => "boom"}) |> Map.get(:valid?)
false

# "id" must be greater than 0
iex> path_param(%{"id" => 0}) |> Map.get(:valid?)
false

iex> path_param(%{"id" => 1}) |> Map.get(:valid?)
true