In the Phoenix Framework, how can I customize my own media type in Accepts?
my own comments on the Phoenix code indicate that everything that is needed, plus the recompilation of the depot, although the need for this eludes me. But it doesn't seem to work:
config.exs:
[β¦] config :plug, :mimes, %{ "application/vnd.api+json" => ["json-api"] }
router.ex:
pipeline :api do plug :accepts, ["json-api"] end [β¦] scope "/", SomeApp do pipe_through :api [β¦]
some_test.ex:
setup do conn = conn() |> put_req_header("accept", "application/vnd.api+json") {:ok, conn: conn} end
Requests for all tests (using the connection from the installation) receive HTTP 406 responses.
source share