Packages
A serialization library implementing the jsonapi.org 1.0 spec suitable for use building JSON APIs in Phoenix and any other Plug based framework or app.
Current section
Files
Jump to
Current section
Files
priv/templates/ja_serializer.gen.phoenix_api/view.ex
defmodule <%= module %>View do
use <%= base %>.Web, :view
use JaSerializer.PhoenixView
attributes [<%= non_refs |> Enum.map(&(":" <> &1)) |> Enum.join(", ") %>]
<%= for ref <- refs do %>
has_one :<%= ref %>,
field: :<%= ref %>_id,
type: "<%= ref %>"<% end %>
end