JSONAPI.PlugResponseContentType

Simply add this plug to your endpoint or your router :api pipeline and it will ensure you return the correct response type.

If you need to override the response type simple set conn.assigns[:override_jsonapi] and this will be skipped.

Source

Summary

call(conn, opts)

Callback implementation for c:Plug.call/2

init(opts)

Callback implementation for c:Plug.init/1

Functions

call(conn, opts)

Callback implementation for c:Plug.call/2.

Source
init(opts)

Callback implementation for c:Plug.init/1.

Source