pagantis_elixir_tools v0.17.5 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 section Functions
Link to this function
bad_input(conn, error \\ "Bad Request")
bad_input(Plug.Conn.t(), error()) :: Plug.Conn.t()
Link to this function
http_timeout(conn, error \\ "Request Timeout")
http_timeout(Plug.Conn.t(), error()) :: Plug.Conn.t()
Link to this function
not_found(conn, error \\ "Not Found")
not_found(Plug.Conn.t(), error()) :: Plug.Conn.t()
Link to this function
server_error(conn, error)
server_error(Plug.Conn.t(), error()) :: Plug.Conn.t()
Link to this function
unprocessable_entity(conn, error \\ "Unprocessable Entity")
unprocessable_entity(Plug.Conn.t(), error()) :: Plug.Conn.t()
Link to this function