pagantis_elixir_tools v0.21.3 ElixirTools.JsonApi.Controller
Works together with the JsonApi
. The JSON API expects a validated request and converts the
controller into a Json Api Controller by passing only the validated parameters using
JaSerializer
.
Allows two action_name
calls:
action_name/2
. Calls the action name with the params:conn, json_api_params
action_name/3
. To keep access to original parameter object it will call`conn, phoenix_params, json_api_params`
Example:
defmodule Controller do
use MyPhoenixWeb, :controller
use ElixirTools.JsonApi.Controller
def my_method(conn, json_params), do: conn
def my_method(conn, phoenix_params, json_params), do: conn
end
Link to this section Summary
Link to this section Types
Link to this type
idempotency_key()
Specs
idempotency_key() :: Ecto.UUID.t() | nil
Link to this type
params()
Specs
params() :: map()
Link to this section Functions
Link to this function
bad_input(conn, error \\ "Bad Request")
Specs
bad_input(Plug.Conn.t(), error()) :: Plug.Conn.t()
Link to this function
http_timeout(conn, error \\ "Request Timeout")
Specs
http_timeout(Plug.Conn.t(), error()) :: Plug.Conn.t()
Link to this function
not_found(conn, error \\ "Not Found")
Specs
not_found(Plug.Conn.t(), error()) :: Plug.Conn.t()
Link to this function
server_error(conn, error)
Specs
server_error(Plug.Conn.t(), error()) :: Plug.Conn.t()
Link to this function
unprocessable_entity(conn, error \\ "Unprocessable Entity")
Specs
unprocessable_entity(Plug.Conn.t(), error()) :: Plug.Conn.t()
Link to this function