I have a custom render function in a view to send a complex json like this:
def render("slow.json-api", %{data: %{category: category, things: things, other_things: other_things}}) do
%{
data: %{
category: render_one(category, ApiWeb.CategoryView , "show.json-api"),
things: render_many(things, ApiWeb.ThingsView , "show.json-api"),
other_things: render_many(other_things, ApiWeb.OtherThingsView , "show.json-api")
}
}
end
I get this warning:
warning: Passing data via `:model`, `:categorys` or `:category`
atoms to JaSerializer.PhoenixView has be deprecated. Please use
`:data` instead. This will stop working in a future version.
Can anyone explain this behavior and tell me what I shall do?