JSONAPI Elixir

A project that will render your data models into JSONAPI Documents.

Currently in beta status.

JSONAPI Support

JSONAPI Elixir TODO

How to use

A View is simply a module that define certain callbacks to configure proper rendering of your JSONAPI documents.

defmodule UserView do
use JSONAPI.PhoenixView
def url_func() do
&App.Helpers.user_url/3
end
def type, do: "user"
def attributes(model) do
Map.take(model, [:username, :created_at,])
end
def relationships() do
%{
image: %{
view: ImageView
},
posts: %{
view: PostView
optional: true
}
}
end
end

is an example of a basic view. You can now call render normally in your phoenix application.

Philosophy

Contributions